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 making scripts - Amnesia CS !!
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#8
RE: Need help with making scripts - Amnesia CS !!

(11-26-2011, 01:59 PM)BesTCracK Wrote: void OnStart()
{
SetEntityPlayerInteractCallback("lantern_1", "Scare1", true);
}

void OnEnter()
{

}

void OnLeave()
{

}

void Scare1(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 3, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "Idle");
SetEntityActive("servant_grunt_1", false);
}


THERE IT IS ! This is what I have exactly in the script file and still it doesnt work Sad((
You need to put a ; after the end of every line in a function block
And your putting your commands down thinking they will only play after the one above has done its thing. That's not how it works with Angelscript. It will do everything at once. For the servant to deactive after all that stuff has happened (him going to the pathnodes etc) you need to add a timer, like this:

AddTimer("internalnameofthistimer", howlonguntiltimerdoesitswork, "nameofthetimertolinkto");
(I know its hard to understand by the way i set it out ^^)

You put that in the Scare 1 function block, than put this anywhere but the void Onstart place or any other function blocks:

void nameoftimer(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
}

Hope that helps

(This post was last modified: 11-26-2011, 03:07 PM by flamez3.)
11-26-2011, 03:03 PM
Find


Messages In This Thread
RE: Need help with making scripts - Amnesia CS !! - by flamez3 - 11-26-2011, 03:03 PM



Users browsing this thread: 2 Guest(s)