User Tools

Site Tools


hpl2:tutorials:script:adding_messages_to_locked_doors

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/03/15 11:08]
claypigeon [The message]
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/04/01 16:44]
claypigeon [The script]
Line 29: Line 29:
  
  
-The door+====== ​The door ======
  
  
Line 47: Line 47:
  
  
-{{http://i.minus.com/​jpUd9nK0ok06o.png?​direct&​}}+Under General tab, name the door to whatever you want.
  
  
-{{http://imageupload.org/getfile.php?​id=200699&​a=d5244704ce59744641824ae7dd2b5b6d&​t=4f61cdf2&​o=AC0BF90318D823A4C9DFEAD5F753784D3DE049B004B62458A1BFA2DFF210D8CF55B117E40304&​n=wiki.png&i=1?​direct&​}}+I'll call it "​EXAMPLE_DOOR"​. 
 + 
 + 
 +[[{{http://i.minus.com/jpUd9nK0ok06o.png?​direct&​}}]]
  
 ====== The script ====== ====== The script ======
Line 58: Line 61:
  
  
 +<code c++>
 + 
 void DoorLockedPlayer(string &in entity) void DoorLockedPlayer(string &in entity)
- +  
 + 
 { {
 +    if(GetSwingDoorLocked("​EXAMPLE_DOOR"​) == true)
 +    {
 + 
 +        SetMessage("​Messages",​ "​msgname",​ 0);
 + 
 +    }
 +}
 +</​code>​
  
  
-SetMessage("​Messages",​ "​msgname",​ 0);+Now step by step:
  
  
-+void DoorLockedPlayer - this is the function that is called when the player interacts with the door (the one you've set in your level editor!)
- +
- +
-Now step by step:+
  
  
-void DoorLockedPlayer ​this is the function that is called when the player interacts ​with the door+GetSwingDoorLocked ​We are checking wheter ​the doors is locked or not, so we won't get the message even when it's unlocked and interacted ​with. "​EXAMPLE_DOOR"​ is the name of the door that we have given it earlier!
  
  
hpl2/tutorials/script/adding_messages_to_locked_doors.txt · Last modified: 2014/07/04 11:21 by romulator