Problem With A Script - 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: Problem With A Script (/thread-16663.html) |
Problem With A Script - stjazz - 07-01-2012 Hi, im trying to make a custom story for amnesia with a friend, but, in a level, i got an error ( Fatal Error, Main (130,2) : ERR : Unexpected end of the file ) Here is my script: void OnStart() { AddUseItemCallback("", "key", "door1", "UsedKeyOnDoor", true); AddUseItemCallback("", "key2", "door2", "UsedKeyOnDoor1", true); AddUseItemCallback("", "key3", "door3", "UsedKeyOnDoor2", true); AddUseItemCallback("", "key4", "level3", "UsedKeyOnDoor3", true); AddEntityCollideCallback("Player", "ScriptArea_3", "Scary_3", true, 1); AddEntityCollideCallback("Player", "lel1", "lel1", true, 1); AddEntityCollideCallback("Player", "lel2", "lel2", true, 1); AddEntityCollideCallback("Player", "lel3", "lel3", true, 1); AddEntityCollideCallback("Player", "lel4", "lel4", true, 1); SetEntityPlayerInteractCallback("key2", "Pickup_4", true); SetEntityPlayerInteractCallback("key3", "Pickup_5", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door1", false, true); PlaySoundAtEntity("", "unlock_door", "door1", 0, false); RemoveItem("key"); } void UsedKeyOnDoor1(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door2", false, true); PlaySoundAtEntity("", "unlock_door", "door2", 0, false); RemoveItem("key2"); } void UsedKeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door3", false, true); PlaySoundAtEntity("", "unlock_door", "door3", 0, false); RemoveItem("key3"); } void UsedKeyOnDoor3(string &in asItem, string &in asEntity) { SetSwingDoorLocked("level3", false, true); PlaySoundAtEntity("", "unlock_door", "level3", 0, false); RemoveItem("key4"); } void scary_3(string &in asParent, string &in asChild, int alState) { SetEntityActive("gay1", true); SetEntityActive("gay2", true); SetEntityActive("gay3", true); AddPropImpulse("gay1", -20, 0, -20, "world"); AddPropImpulse("gay2", -20, 0, -20, "world"); AddPropImpulse("gay3", -20, 0, -20, "world"); PlayMusic("scarejump", false, 10, 0.1, 10, false); SetEntityActive("key3", true); } void Pickup_4(string &in asEntity) { SetEntityActive("gay2_1", true); SetEntityActive("gay2_2", true); SetEntityActive("gay2_3", true); SetEntityActive("gay2_4", true); SetEntityActive("servant_grunt_1", true); PlayMusic("scarejump", false, 10, 0.1, 10, false); } void Pickup_5(string &in asEntity) { SetEntityActive("key4", true); } void lel1(string &in asParent, string &in asChild, int alState) { AddTimer("", 0.01f, "Timer_01"); } void Timer_01(string &in asTimer) { SetEntityActive("a", true); AddPropForce("a", -30000, 0, 0, "World"); SetEntityActive("b", true); AddPropForce("b", -30000, 0, 0, "World"); SetEntityActive("c", true); AddPropForce("c", -30000, 0, 0, "World"); SetEntityActive("d", true); AddPropForce("d", -30000, 0, 0, "World"); SetEntityActive("e", true); AddPropForce("e", -30000, 0, 0, "World"); PlayMusic("scarejump", false, 10, 0.1, 10, false); } void lel2(string &in asParent, string &in asChild, int alState) { AddTimer("", 0.01f, "Timer_02"); } void Timer_02(string &in asTimer) { SetEntityActive("a1", true); AddPropForce("a1", -30000, 0, 0, "World"); etEntityActive("b1", true); AddPropForce("b1", -30000, 0, 0, "World"); PlayMusic("scarejump", false, 10, 0.1, 10, false); } void lel3(string &in asParent, string &in asChild, int alState) { AddTimer("", 0.01f, "Timer_03"); } void Timer_03(string &in asTimer) { SetEntityActive("a2, true); AddPropForce("a2", -30000, 0, 0, "World"); SetEntityActive("b2, true); AddPropForce("b2, -30000, 0, 0, "World"); SetEntityActive("c2, true); AddPropForce("c2, -30000, 0, 0, "World"); PlayMusic("scarejump", false, 10, 0.1, 10, false); } void lel4(string &in asParent, string &in asChild, int alState) } AddTimer("", 0.01f, "Timer_04"); SetEntityActive("a3,true); ShowEnemyPlayerPosition("a3); SetEntityActive("c3,true); } void Timer_04(string &in asTimer) { SetEntityActive("b3,true); AddPropForce("b3", -30000, 0, 0, "World"); } Thanks for the help and support RE: Problem With A Script - Demondays1 - 07-01-2012 From the looks on your script, your troll map will fail with those cheap jumpscares (flying jesus out of deh closet) theres lots of " your missing towards the end. RE: Problem With A Script - EXAWOLT - 07-01-2012 found it void Timer_03(string &in asTimer) a2 is not framed b2 is not framed c2 is not framed that should do the trick i see u missed those on more places, just check so all of them are "inside" those RE: Problem With A Script - stjazz - 07-01-2012 Thanks for the help guys! RE: Problem With A Script - EXAWOLT - 07-01-2012 haha sorry Demondays1 i wrote same text, the forum should refresh more often^^ |