Frictional Games Forum (read-only)

Full Version: Simple help with scripting?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay so I've been searching the forum, and I've found a lot of useful scripts. So far I've been able to spawn a monster when I walk to a certain spot, but I don't know how to make it go to a path node.

I've found some lines I can't find again on how to make it instantly spot my location or go to the path node, but I don't know HOW to add them. I've tried a lot of different things. My problem is just that I don't know how to ADD stuff to the OnStart part.

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player" , "MonsterArea" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("Monsterguy" , true);
}
ShowEnemyPlayerPosition("Monsterguy");
}

If I want my monster to go to "Path01", EXACTLY what do I have to add where? Can anyone write me a modified version of this script that would make him head for "Path01"? And maybe try to explain how it works? Help is VERY much appreciated
Here, try this:

Code:
void OnStart()
{
     AddEntityCollideCallback("Player", "MonsterArea", "MonsterFunc1", true, 1);
}
void MonsterFunc1(string &in asParent, string &in asChild, int alState)
{
     SetEntityActive("Monsterguy", true);
     AddEnemyPatrolNode("Monsterguy", "Path01", 0, "");
}
Thank you SO MUCH!! It worked now, and I learned A LOT about how scripting works in a flash!!