Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Monster despawning after following a path
ufando Offline
Junior Member

Posts: 3
Threads: 1
Joined: Apr 2011
Reputation: 0
#1
Monster despawning after following a path

How can i set it so that after a monster has gone to the last node, it despawns?
My code is
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "SpawnMonsterFunction", true, 1);

}

void SpawnMonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 2, "");
}

I tried putting;
SetEntityActive("servant_grunt_1", false);

at the end of it, but it happens as soon as i walk into the area, so i tried putting a timer on it

AddTimer("xyz", 6f, "Pathtime");

void Pathtime(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
}

That caused a fatal error, something about ' ")" or "," expected.

Any help would be apprieciated
04-24-2011, 11:36 AM
Find
DamnNoHtml Offline
Senior Member

Posts: 469
Threads: 34
Joined: Sep 2010
Reputation: 16
#2
RE: Monster despawning after following a path

Monsters automatically despawn once they reach the end of their paths and are not visible by the player.

Creator of Wake, Through the Portal, Insomnia, and Cycles What to do with HPL3....
04-24-2011, 11:48 AM
Find
ufando Offline
Junior Member

Posts: 3
Threads: 1
Joined: Apr 2011
Reputation: 0
#3
RE: Monster despawning after following a path

(04-24-2011, 11:48 AM)DamnNoHtml Wrote: Monsters automatically despawn once they reach the end of their paths and are not visible by the player.

oh cool, i fixed it now, there was a gap in the wall that i didn't notice at first, so i could still see it.

thanks
04-24-2011, 11:52 AM
Find




Users browsing this thread: 2 Guest(s)