This is an old revision of the document!
Hey, in this tutorial me, ClayPigeon, will teach you how to add a message to a locked door.
What does this means? That means that when a player tries to open a locked door, it will show a message on the screen telling him it's locked, or will give the player a hint on where the key is.
First of all, open up your extra_english.lang file, and add this:
<Entry Name =“msgname”>TYPE MESSAGE HERE</Entry>
msgname - The name that will be called via the script and present the message TYPE MESSAGE HERE.
TYPE MESSAGE HERE - The actual text that will be presented. It can be anything, for example: The door is locked, and the key is behind the cabinet.
Open up your map with your level editor, and add a door wherever you want.
Select the door using the Select tool(1), and go to the Entity tab. (Next to general).
Tick the 'Locked' box to make the door locked, and on the PlayerInteractCallback write whatever name of function you want.
I'll call it DoorLockedPlayer.
If you want the message to show only once, tick the PlayerInteractCallbackAutoRemove box.
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:
void DoorLockedPlayer(string &in entity)
SetMessage(“Messages”, “msgname”, 0);
Now step by step:
void DoorLockedPlayer - this is the function that is called when the player interacts with the door
“Messages” - that is the <CATEGORY> name in your extra_english.lang file, DO NOT change this!
“msgname” - this is the name of the message we've set earlier, remember?
Now the message will display when the player is trying to open the door!
PM me for any help, my forum account: ClayPigeon.