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
Need help with a script.
Cole Woods Offline
Junior Member

Posts: 2
Threads: 1
Joined: May 2012
Reputation: 0
#1
Need help with a script.

For some reason my script just doesn't want to work. I'm not an experienced scripter so I don't know how to fix it. The point of the script is that a brute is activated and patrols the PosNode path and then keeps patroling that area. Here's the script:



void OnStart()
{
SetEntityPlayerInteractCallback("FirstNote", "BruteAttack", false);
}


void BruteAttack(string& asEntity)
{
SetMessage("Message", "Brute", 3);
SetEntityActive("Brute1", true);
AddEnemyPatrolNode("Brute1", "PosNodeArea1", 0, ""); <---- This part doesn't want to work
AddEnemyPatrolNode("Brute1", "PosNodeArea2", 3, ""); <---- This part doesn't want to work
AddEnemyPatrolNode("Brute1", "PosNodeArea1", 0, ""); <---- This part doesn't want to work
AddTimer("", 5, "BrutePatrol1"); <---- This part doesn't want to work
}

void BrutePatrol1(string &in asTimer)
{
AddEnemyPatrolNode("Brute1", "PosNodeArea3", 2, "");
AddTimer("", 5, "BrutePatrol2");
}

void BrutePatrol2(string &in asTimer)
{
AddEnemyPatrolNode("Brute1", "PosNodeArea4", 2, "");
AddTimer("", 5, "BrutePatrol1");
}


When the player interacts with the note the message is activated together with the Brute. But he won't patrol the PosNode path... I don't know if the timer won't activate or he won't follow the PosNode in the other function. Please help I would really appreciate!

//Thanks alot
Cole Woods
(This post was last modified: 06-03-2012, 03:17 PM by Cole Woods.)
06-03-2012, 12:32 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Need help with a script.

I can't really see anything wrong with it... Are the patrol nodes "PATH nodes"? Or are they "Pos Nodes"?
They have to be Path Nodes.
06-03-2012, 02:15 PM
Find
Cole Woods Offline
Junior Member

Posts: 2
Threads: 1
Joined: May 2012
Reputation: 0
#3
RE: Need help with a script.

(06-03-2012, 02:15 PM)Statyk Wrote: I can't really see anything wrong with it... Are the patrol nodes "PATH nodes"? Or are they "Pos Nodes"?
They have to be Path Nodes.
... I did not know that... Yes they are Pos Nodes. As I said I'm not experienced with scripting. Thanks alot!
(This post was last modified: 06-03-2012, 03:18 PM by Cole Woods.)
06-03-2012, 03:15 PM
Find




Users browsing this thread: 1 Guest(s)