User Tools

Site Tools


hpl2:tutorials:script:adding_messages_to_locked_doors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/03/15 11:09]
claypigeon [The message]
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/04/01 16:48]
claypigeon [The door]
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.
  
-====== The script ====== 
  
 +I'll call it "​EXAMPLE_DOOR"​.
  
-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: 
  
 +{{http://​oi43.tinypic.com/​656cs3.jpg?​nolink&​}}
  
-void DoorLockedPlayer(string &in entity)+====== The script ======
  
  
-+Open up your mapname.hps that is on your AmnesiaFolder/​redist/​custom_stories/​yourstory/​mapswith notepad++ or whatever editor that fits for youand now write this under the last '​}'​ you see on the text:
- +
- +
-SetMessage("​Messages"​"​msgname"​0);+
  
  
 +<code c++>
 + 
 +void DoorLockedPlayer(string &in entity)
 + 
 + 
 +{
 +    if(GetSwingDoorLocked("​EXAMPLE_DOOR"​) == true)
 +    {
 + 
 +        SetMessage("​Messages",​ "​msgname",​ 0);
 + 
 +    }
 } }
 +</​code>​
  
  
Line 71: Line 81:
  
 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!) 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!
  
  
hpl2/tutorials/script/adding_messages_to_locked_doors.txt · Last modified: 2014/07/04 11:21 by romulator