Frictional Games Forum (read-only)
Script doesnt work once again. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script doesnt work once again. (/thread-12487.html)



Script doesnt work once again. - kartanonperuna - 01-09-2012

Sorry for bothering all the time but reading all those scripting tutorials doesnt really help me.



////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("crowbar_joint_2", "crowcollide", "crowopen_func", true, 1);
AddUseItemCallback("", "crowbar_1", "prison_locked", "activatecrowdoor", true);
AddUseItemCallback("", "key_tomb_rusty", "cellar_wood01_slow", "KeyOnDoor", true);
AddUseItemCallback("", "key_torture_chamber_1", "hatch_metal01_1", "KeyOnDoor2", true);
AddUseItemCallback("", "key_study_1", "cellar_wood01_1", "KeyOnDoor3", true);
PlayMusic("humming ambient.ogg", true, 1.0f, 1.0f, 1, false);
AddEntityCollideCallback("Player", "TriggerArea1", "TriggerMonster", true, 1);
AddEntityCollideCallback("Player", "TriggerArea2", "TriggerMonster2", true, 1);
AddEntityCollideCallback("Player", "VoiceTrigger", "Prisoner", true, 1);
}

void Prisoner(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("prisoner edited.snt", "prisoner edited.snt", "Player", 94, true);
}

void TriggerMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_suitor_1", true);
}

void TriggerMonster2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_silent_1", true);
}

void KeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01_1", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_1", 0, false);
RemoveItem("key_study_1");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

It says "expected )" or something in somewhere 18th line.


RE: Script doesnt work once again. - flamez3 - 01-09-2012


I tried this script myself, it works fine. I only see 1 problem (if it is one that is) you would need to put _ in the spaces of prisoner edited.snt (this means in the actual files as well). Two more things:

1. Did you download a torrented version of Amnesia (sorry if I asked you this before, can't remember Smile )

2. I used notepad ++ and in two seconds I can find anything that is wrong with a script (to an extent), you should consider using it.


RE: Script doesnt work once again. - kartanonperuna - 01-09-2012

I use notepad +++ yes.I did pirate Amnesia at first but then I bought it.


RE: Script doesnt work once again. - flamez3 - 01-09-2012

Are you sure you are using the right version of Amnesia (the one you bought), cause I didn't get an error at all.

Also, in the menu of Notepad ++ go to Language, go to C and C++


RE: Script doesnt work once again. - BlueFury - 01-09-2012

You probably copied it wrong or you renamed/removed something in the editor.


RE: Script doesnt work once again. - kartanonperuna - 01-09-2012

Nah it works now.Thanks.