User Tools

Site Tools


hpl2:tutorials:script:adding_messages_to_locked_doors

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/03/15 11:03]
claypigeon created
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/04/01 16:43]
claypigeon [The script]
Line 17: Line 17:
  
  
-<Entry Name ="​msgname">​TYPE MESSAGE HERE</​Entry> ​                        ​+<Entry Name ="​msgname">​TYPE MESSAGE HERE</​Entry>​
  
  
Line 29: Line 29:
  
  
-The door+====== ​The door ======
  
  
Line 46: Line 46:
 If you want the message to show only once, tick the PlayerInteractCallbackAutoRemove box. If you want the message to show only once, tick the PlayerInteractCallbackAutoRemove box.
  
 +
 +Under General tab, name the door to whatever you want.
 +
 +
 +I'll call it "​EXAMPLE_DOOR"​.
 +
 +
 +[[{{http://​i.minus.com/​jpUd9nK0ok06o.png?​direct&​}}]]
  
 ====== The script ====== ====== The script ======
Line 51: Line 59:
  
 Open up your mapname.hps that is on your AmnesiaFolder/​redist/​custom_stories/​yourstory/​maps,​ with notepad++ or whatever editor that fits for you, and now write this under the last '​}'​ you see on the text: Open up your mapname.hps that is on your AmnesiaFolder/​redist/​custom_stories/​yourstory/​maps,​ with notepad++ or whatever editor that fits for you, and now write this under the last '​}'​ you see on the text:
 +
 +
 +<code c++>
  
  
Line 59: Line 70:
  
  
-SetMessage("​Messages",​ "​msgname",​ 0);+    if(GetSwingDoorLocked("​EXAMPLE_DOOR"​) == true) 
 + 
 + 
 +    { 
 + 
 + 
 +        ​SetMessage("​Messages",​ "​msgname",​ 0); 
 + 
 + 
 +    }
  
  
 } }
 +</​code>​
  
  
Line 68: Line 89:
  
  
-void DoorLockedPlayer - this is the function that is called when the player interacts with the door+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!) 
 + 
 + 
 +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!
  
  
Line 74: Line 98:
  
  
-"​msgname"​ - this is the name of the message we've set earlier, remember? ​+"​msgname"​ - this is the name of the message we've set earlier, remember?
  
  
Line 81: Line 105:
  
 PM me for any help, my forum account: ClayPigeon. PM me for any help, my forum account: ClayPigeon.
- 
- 
-{{http://​imageupload.org/​en/​file/​200699/​wiki.png.html}} 
  
hpl2/tutorials/script/adding_messages_to_locked_doors.txt · Last modified: 2014/07/04 11:21 by romulator