Frictional Games Forum (read-only)

Full Version: Problems with non-despawning monster
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to set the monster not despawn when the player dies? (Or spawn a new monster with exactly the same name when the player respawns)
Not sure, but if you try looping the path nodes, that might do the trick
Make a checkpoint and make it call a function when you die:
Put there:

Code:
ResetProp("NAME OF THE ENEMY");

You'll need to make it active again and when its active,
its in the same position as it were when the map startedSmile
Or if you have the monster spawn on an area collide, make sure the "autoremove" is set to FALSE.. E.g...

AddEntityCollideCallback("Player", "COLLIDEAREA", "MONSTERFUNCTION", false, 1);

This allows the function to be called repeatedly, as the function is not deleted. Result, monster spawning after each death.
Monsters cannot be "respawned" if the player is killed by the monster within the same map session. You have to either reload the map or have another monster with a different name waiting to be enabled afterwards.
Try this maybe:

void SetEnemyDisabled(string& asName, bool abDisabled);

As in...

void SetEnemyDisabled("NAME OF ENEMY", true);


Or, if it's part of a function...

SetEnemyDisabled("NAME OF ENEMY", true);
Your Computer really answered my question, thank you.
This means that I'm just going to make two version of the same map file and have a loading screen when the player dies..

Thanks for help!