Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem With A Script
stjazz Offline
Junior Member

Posts: 5
Threads: 2
Joined: Jul 2012
Reputation: 0
#1
Problem With A Script

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
(This post was last modified: 07-01-2012, 10:03 PM by stjazz.)
07-01-2012, 09:45 PM
Find
Demondays1 Offline
Member

Posts: 57
Threads: 7
Joined: Jun 2012
Reputation: 0
#2
RE: Problem With A Script

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.

Intel HD Lag fix: tiny.cc/pyv1gw
(This post was last modified: 07-01-2012, 09:53 PM by Demondays1.)
07-01-2012, 09:51 PM
Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#3
RE: Problem With A Script

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

simply nuff said




(This post was last modified: 07-01-2012, 10:01 PM by EXAWOLT.)
07-01-2012, 09:59 PM
Find
stjazz Offline
Junior Member

Posts: 5
Threads: 2
Joined: Jul 2012
Reputation: 0
#4
RE: Problem With A Script

Thanks for the help guys!
07-01-2012, 10:02 PM
Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#5
RE: Problem With A Script

haha sorry Demondays1 i wrote same text, the forum should refresh more often^^

simply nuff said




07-01-2012, 10:05 PM
Find




Users browsing this thread: 2 Guest(s)