Frictional Games Forum (read-only)
Need help with a script. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Need help with a script. (/thread-15810.html)



Need help with a script. - Cole Woods - 06-03-2012

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



RE: Need help with a script. - Statyk - 06-03-2012

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.


RE: Need help with a script. - Cole Woods - 06-03-2012

(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!