Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Repeatable script
tklamka Offline
Junior Member

Posts: 11
Threads: 5
Joined: Dec 2010
Reputation: 0
#1
Repeatable script

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.
01-05-2012, 11:46 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Repeatable script

(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/amn...ons#player




01-05-2012, 11:55 AM
Find




Users browsing this thread: 1 Guest(s)