The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
Monster despawning after following a path - by ufando - 04-24-2011, 11:36 AM



Users browsing this thread: 1 Guest(s)