unexpected token { - 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: unexpected token { (/thread-14796.html) |
unexpected token { - Combustible Lemon - 04-15-2012 void OnStart() { AddUseItemCallback("", "key_1", "prison_1", "KeyOnDoor", true); AddUseItemCallback("", "key_tomb_rusty_1", "mansion_3", "KeyOnDoor2", true); } void KeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("prison_1", false, true); PlaySoundAtEntity("", "unlock_door.snt", "prison_1", 0.0f, true); RemoveItem("key_1"); } void KeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_3", false, true); PlaySoundAtEntity("", "unlock_door.snt", "mansion_3", 0.0f, true); RemoveItem("rusty_1"); } { AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1); } void MonsterFunc1(string &in asParent , string &in asChild , int alState) { SetEntityActive("servant_grunt" , true); } It says unexpected token { and i can't find out what to do. Im new at scripting. RE: unexpected token { - Strembitsky - 04-15-2012 void OnStart() { AddUseItemCallback("", "key_1", "prison_1", "KeyOnDoor", true); AddUseItemCallback("", "key_tomb_rusty_1", "mansion_3", "KeyOnDoor2", true); AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1); } void KeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("prison_1", false, true); PlaySoundAtEntity("", "unlock_door.snt", "prison_1", 0.0f, true); RemoveItem("key_1"); } void KeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_3", false, true); PlaySoundAtEntity("", "unlock_door.snt", "mansion_3", 0.0f, true); RemoveItem("rusty_1"); } void MonsterFunc1(string &in asParent , string &in asChild , int alState) { SetEntityActive("servant_grunt" , true); } Try that. Your AddEntityCollideCallback wasn't in a function... it was in the middle of nowhere. RE: unexpected token { - Combustible Lemon - 04-15-2012 It worked thanks. |