Frictional Games Forum (read-only)

Full Version: Resetting a Map or an Entity?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I currently try to create a chase&Puzzle Sequence and I could need some help: In order to complete the Puzzle, the Enemy must still be present but if the Player dies he will get stuck and cannot continue... Is there a way to respawn the Enemy or Reset the Map so that the Player can try once more upon diing?
Code:
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
Sets a checkpoint at which the player will respawn in case he dies.

With the checkpoint you can also call a function after the player dies. In that checkpoint function you can for example reset some entities with:

Code:
void ResetProp(string& asName);
Resets a prop's state to the original one when the map was loaded.

And you can just use
Code:
SetEntityActive("enemy_name", true);
again on the same enemy to spawn it again
You can also use a local variable to keep track of the number of deaths. If the death value is greater than or equal to 1, then call any functions to reset props or enemies. Hope this helps. Smile
Thanks for Responses, I will try things out