Frictional Games Forum (read-only)

Full Version: Problem With A Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 Smile
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.
found it Big Grin
void Timer_03(string &in asTimer)
a2 is not framed
b2 is not framed
c2 is not framed


that should do the trickWink

i see u missed those on more places, just check so all of them are "inside" those
Thanks for the help guys!
haha sorry Demondays1 i wrote same text, the forum should refresh more often^^