03-04-2011, 08:07 AM
Hi guys, quick question...
What's the proper code to create an event where a monster is spawned after I interact with a door? I haven't created one of these specific situations before so I'm pretty much using trial and error methods right now...
Right now my code looks like this:
Something's wrong here, but I'm not too sure what, any help?
What's the proper code to create an event where a monster is spawned after I interact with a door? I haven't created one of these specific situations before so I'm pretty much using trial and error methods right now...
Right now my code looks like this:
Code:
void CollideAreaGruntDoorCallback(string &in asParent, string &in asChild, int alState)
{
SetEntityPlayerInteractCallback("DoorGrunt", "SpawnGrunt", false);
}
void SpawnGrunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("SpotGrunt2", true);
GiveSanityDamage(10, true);
AddEnemyPatrolNode("SpotGrunt", "PathNodeArea_98", 1, "");
AddTimer("Waypoints", 13.0f, "TimerSpotGrunt2");
}
void TimerSpotGrunt2(string &in asTimer)
{
if(asTimer == "Waypoints")
{
ClearEnemyPatrolNodes("SpotGrunt2");
AddEnemyPatrolNode("SpotGrunt2", "PathNodeArea_83", 1, "");
}
}
Something's wrong here, but I'm not too sure what, any help?