User Tools

Site Tools


hpl2:tutorials:scripting:checkpoints_using_scriptarea_s

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:tutorials:scripting:checkpoints_using_scriptarea_s [2012/09/16 10:29]
steve
hpl2:tutorials:scripting:checkpoints_using_scriptarea_s [2012/09/16 10:53] (current)
steve
Line 1: Line 1:
-====== Checkpoints using Script Area's ======+====== Checkpoints using ScriptArea's ======
  
  
-First of all you make a ScriptArea large enough for the player to walk through.+**1**. ​make a ScriptArea large enough for the player to walk through.
  
  
-call mine **"​ScriptArea_1"​ ** +named mine **"​ScriptArea_1"​ ** 
  
  
-{{http://i48.tinypic.com/​5tz860.jpg?​direct&​300x299}}+{{http://oi48.tinypic.com/​5tz860.jpg?​direct&​300}}
  
  
-As second thing create a PlayerStartArea this time I call mine **"​PlayerStartArea_1"​** ​+**2**. ​create a PlayerStartArea this time I name mine **"​PlayerStartArea_1"​** ​
  
  
-{{http://​i49.tinypic.com/​2qs17op.png?​direct&​300x487}}+{{http://​i49.tinypic.com/​2qs17op.jpg?​direct&​185x300}}
  
  
Line 20: Line 20:
  
  
-void OnStart()+|void OnStart() ​    \\ {      \\ AddEntityCollideCallback(“Player”,​ “ScriptArea_1”,​ “Restart”,​ true, 1);     \\ }     ​\\ ​  \\ void Restart(string &in asParent, string &in asChild, int alState) ​    \\ {     \\ CheckPoint (“FirstCheckpoint”,​ “PlayerStartArea_1”,​ “Happening”,​ “DeathCategory”,​ “Deathtext”); ​    \\ }     ​\\ ​ \\ void Happening(string &in asName, int alCount) ​    \\ {     \\ /Stuff you want to happen after you die/      \\ //}//  |
  
  
-{+//and as for the .LANG file// ​
  
  
-AddEntityCollideCallback("Player""ScriptArea_1", "​Restart",​ true, 1);+|<//​LANGUAGE> ​  // ​ \\ <//​CATEGORY Name="DeathCategory">// ​ \\ <//Entry Name="Deathtext">Text you want in the black screen after you die// <///​Entry> ​     \\  // <///​CATEGORY>​ //  \\ <///​LANGUAGE>​ //  |
  
  
-}+//Now if you walk through the ScriptArea and die, you respawn at the PlayerStartArea you created. // 
  
  
-void Restart(string &in asParent, string &in asChild, int alState)\\  +\\
-{\\  +
-CheckPoint ("​FirstCheckpoint",​ "​PlayerStartArea_1",​ "​Happening",​ "​DeathCategory",​ "​Deathtext"​);​\\  +
-+
- +
- +
-void Happening(string &in asName, int alCount)\\  +
-+
- +
- +
-/Stuff you want to happen after you die/// ​  //  +
- +
- +
-//}   //  +
- +
- +
-//and for the .LANG file//  +
- +
- +
-//// <//​LANGUAGE> ​  //  +
- +
- +
-<//​CATEGORY Name="​DeathCategory">//​  +
- +
- +
-//// <//Entry Name="​Deathtext">​Text you want in the black screen after you die// <///​Entry>​\\  +
-// <///​CATEGORY> ​   //  +
- +
- +
-<///​LANGUAGE> ​  //  +
- +
- +
-//Now if you die you respawn at the PlayerStartArea you created. //  +
- +
- +
-////  +
- +
- +
-////+
  
hpl2/tutorials/scripting/checkpoints_using_scriptarea_s.1347791351.txt.gz · Last modified: 2012/09/16 10:29 by steve