Frictional Games Forum (read-only)
Player death event - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Player death event (/thread-54396.html)



Player death event - User01 - 04-01-2018

Is there a way to run an event when the player dies? All I could find is setting up death hints.


RE: Player death event - Romulator - 04-02-2018

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



RE: Player death event - User01 - 04-02-2018

Thanks