(06-22-2012, 06:08 PM)Jagsrs28 Wrote: So is this right?
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Grunty1", "monster_opendoor_area", monster_opendoor", true, 1);
}
void MonsterPath(AddEnemyPatrolNode("Grunty1", "PathNodeArea1", "");
void monster_opendoor(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("Cabby1", -10.0 , 0, 0, "World");
AddTimer("", 1.0, monsterdisable);
}
void monsterdisable(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
}
////////////////////////////
// Run when leaving map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
Then keep adding nodes?
Almost but not quite,
////////////////////////////
// Run first time starting map
void OnStart()
{
AddTimer("", 1.0, "MonsterPath");
AddEntityCollideCallback("Grunty1", "monster_opendoor_area", monster_opendoor", true, 1);
}
void MonsterPath(string &in asTimer)
{
AddEnemyPatrolNode("Grunt1", "PathNodeArea1", 0,"");
then add all your other path nodes in here (the zero is the time in seconds until the grunt moves on to the next node)
}
void monster_opendoor(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("Cabby1", -10.0 , 0, 0, "World");
AddTimer("", 1.0, monsterdisable);
}
void monsterdisable(string &in asTimer)
{
SetEntityActive("Grunt1", false);
}
////////////////////////////
// Run when leaving map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}