Repeatable script - 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: Repeatable script (/thread-12369.html) |
Repeatable script - tklamka - 01-05-2012 Can anyone tell me the command which i use when i want to make a script repeatable ? Eg. a player runs into a trap and it kills him, and i want the trap script to reset upon the respawn of the player, so everytime he touches it, everytime he dies, even after respawning. RE: Repeatable script - flamez3 - 01-05-2012 (01-05-2012, 11:46 AM)tklamka Wrote: Can anyone tell me the command which i use when i want to make a script repeatable ? Eg. a player runs into a trap and it kills him, and i want the trap script to reset upon the respawn of the player, so everytime he touches it, everytime he dies, even after respawning.You have to make a checkpoint. CheckPoint ("internal_name", string& asStartPos, "respawnfunc", string& asDeathHintCat, string& asDeathHintEntry); void respawnfunc(string &in asName, int alCount) { //These use the callbacks that you use in void OnStart(), for ex AddEntityCollideCallback("Player", "ScriptArea_1", "random", true, 1); } Put any callbacks you want to be redone there. For the string& asDeathHintCat, string& asDeathHintEntry parts, you don't have to do those, you can leave them like this: "", "". That's the text you see when you die and respawn, if you do want to change that, look here: 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 Posted from http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#player |