Frictional Games Forum (read-only)

Full Version: Player death event
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to run an event when the player dies? All I could find is setting up death hints.
Use Checkpoints, and define what you would like to occur as an event in the CheckPoint callback. You can also make a DeathHint in your lang file which doesn't have any associated text, so that when you die, you'll momentarily see a black screen before the CheckPoint callback occurs.

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.
Callback syntax: void MyFunc(string &in asName, int alCount)
Count is 0 on the first checkpoint load!

asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file
Thanks