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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with script error
liquiddr3amz Offline
Junior Member

Posts: 14
Threads: 5
Joined: Nov 2012
Reputation: 0
#1
Need help with script error

ok so i took a break from a custom story i was working on, i picked it back up, i decided (as shown in bold) i would like the door to lock after it slams shut, and then use a hollow needle to open it, does it matter if i code from bottom of my script or do i got to go back up to the middle where it is bold? i keep getting errors(when i try changing it, this script currently works) can someone please help?

void OnStart()
{
AddEntityCollideCallback("Player","scr2","monster",true,1);
AddEntityCollideCallback("jim","scr1","monsterend",true,-1);
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "scr_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player", "KillTheLights", "LightsOut", true, 1);
}


void monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("jim",true);
AddEnemyPatrolNode("jim", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_8", 0, "");
}
void monsterend(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("jim",false);
}

void keyfunc(string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1",true);
GiveSanityDamage(10.0f, true);
StartPlayerLookAt("servant_brute_1",15,15,"");
AddTimer("monstertimer",2,"monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");
PlayGuiSound("react/react_pant3.ogg",10.0f);
StartScreenShake(0.1f,2,0,0.6);
}


void monstertimer(string &in asTimer)
{
StopPlayerLookAt();
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
StartScreenShake(0.1f,2,0,0.3);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}

void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(0,10000, -30000, false);
}

void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("lamp_1", false, true);
AddTimer("", 1, "Out2");
}


void Out2(string &in asTimer)
{
SetLampLit("lamp_2", false, true);
AddTimer("", 1, "Out3");
}


void Out3(string &in asTimer)
{
SetLampLit("lamp_3", false, true);
AddTimer("", 1, "Out4");
}


void Out4(string &in asTimer)
{
SetLampLit("lamp_4", false, true);
AddTimer("", 1, "Out5");
}


void Out5(string &in asTimer)
{
SetLampLit("lamp_5", false, true);
AddTimer("", 1, "Out6");
}


void Out6(string &in asTimer)
{
SetLampLit("lamp_6", false, true);
AddTimer("",1,"Out7");
}

void Out7(string &in asTimer)
{
SetLampLit("lamp_7", false, true);
AddTimer("", 1, "Out8");
}


void Out8(string &in asTimer)
{
SetLampLit("lamp_8", false, true);
AddTimer("", 1, "Out9");
}


void Out9(string &in asTimer)
{
SetLampLit("lamp_9", false, true);
AddTimer("", 1, "Out10");
}


void Out10(string &in asTimer)
{
SetLampLit("lamp_10", false, true);
AddTimer("", 1, "Out11");
}


void Out11(string &in asTimer)
{
SetLampLit("lamp_11", false, true);
AddTimer("", 1, "Out12");
}


void Out12(string &in asTimer)
{
SetLampLit("lamp_12", false, true);
AddTimer("",1,"Out13");
}

void Out13(string &in asTimer)
{
SetLampLit("lamp_13", false, true);
AddTimer("", 1, "Out14");
}

void Out14(string &in asTimer)
{
SetLampLit("lamp_14", false, true);
}
06-25-2013, 06:03 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Need help with script error

It's okay. You can put any function called in the beginning everywhere.

"Veni, vidi, vici."
"I came, I saw, I conquered."
06-25-2013, 06:25 AM
Find
Icaab2607 Offline
Junior Member

Posts: 34
Threads: 13
Joined: Mar 2013
Reputation: 0
#3
RE: Need help with script error

And where scipt on keyfunc?
06-25-2013, 06:27 AM
Find
liquiddr3amz Offline
Junior Member

Posts: 14
Threads: 5
Joined: Nov 2012
Reputation: 0
#4
RE: Need help with script error

ok but i when i try to put a command to lock the door i get a error, it says

token }

bla Bla what ever line its on,
06-25-2013, 06:29 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#5
RE: Need help with script error

(06-25-2013, 06:29 AM)liquiddr3amz Wrote: ok but i when i try to put a command to lock the door i get a error, it says

token }

bla Bla what ever line its on,

What's the command? And add it to the script and give us the contents of the function that's troublesome. Also as Icaab2607 said, where is keyfunc called?

"Veni, vidi, vici."
"I came, I saw, I conquered."
06-25-2013, 06:33 AM
Find




Users browsing this thread: 1 Guest(s)