<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=Hpl2%3ATutorials%3Ascript%3Aadding_messages_to_locked_doors</id>
	<title>Hpl2:Tutorials:script:adding messages to locked doors - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=Hpl2%3ATutorials%3Ascript%3Aadding_messages_to_locked_doors"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:adding_messages_to_locked_doors&amp;action=history"/>
	<updated>2026-05-04T10:25:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:adding_messages_to_locked_doors&amp;diff=1979&amp;oldid=prev</id>
		<title>Darkfire: Clean up note</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:adding_messages_to_locked_doors&amp;diff=1979&amp;oldid=prev"/>
		<updated>2020-07-26T21:46:30Z</updated>

		<summary type="html">&lt;p&gt;Clean up note&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:46, 26 July 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{cleanup|Broken formatting and personal language}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Adding messages to a locked door =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Adding messages to a locked door =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff::1.12:old-845:rev-1979 --&gt;
&lt;/table&gt;</summary>
		<author><name>Darkfire</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:adding_messages_to_locked_doors&amp;diff=845&amp;oldid=prev</id>
		<title>Maintenance script: Upload from wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:adding_messages_to_locked_doors&amp;diff=845&amp;oldid=prev"/>
		<updated>2020-07-09T13:48:46Z</updated>

		<summary type="html">&lt;p&gt;Upload from wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Adding messages to a locked door =&lt;br /&gt;
&lt;br /&gt;
Hey, in this tutorial me, ClayPigeon, will teach you how to add a message to a locked door.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= The message =&lt;br /&gt;
&lt;br /&gt;
First of all, open up your extra_english.lang file, and add this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CATEGORY Name=&amp;quot;Messages&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Entry Name =&amp;quot;msgname&amp;quot;&amp;gt;TYPE MESSAGE HERE&amp;lt;/Entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/CATEGORY&amp;gt;&lt;br /&gt;
&lt;br /&gt;
msgname - The name that will be called via the script and present the message TYPE MESSAGE HERE.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= The door =&lt;br /&gt;
&lt;br /&gt;
Open up your map with your level editor, and add a door wherever you want.&lt;br /&gt;
&lt;br /&gt;
Select the door using the Select tool(1), and go to the Entity tab. (Next to general).&lt;br /&gt;
&lt;br /&gt;
Tick the 'Locked' box to make the door locked, and on the PlayerInteractCallback write whatever name of function you want.&lt;br /&gt;
&lt;br /&gt;
I'll call it DoorLockedPlayer.&lt;br /&gt;
&lt;br /&gt;
If you want the message to show only once, tick the PlayerInteractCallbackAutoRemove box.&lt;br /&gt;
&lt;br /&gt;
Under General tab, name the door to whatever you want.&lt;br /&gt;
&lt;br /&gt;
I'll call it “EXAMPLE_DOOR”.&lt;br /&gt;
&lt;br /&gt;
[http://oi43.tinypic.com/656cs3.jpg?nolink&amp;amp;]&lt;br /&gt;
&lt;br /&gt;
= The script =&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;void DoorLockedPlayer(string &amp;amp;in entity)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    if(GetSwingDoorLocked(&amp;quot;EXAMPLE_DOOR&amp;quot;) == true)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        SetMessage(&amp;quot;Messages&amp;quot;, &amp;quot;msgname&amp;quot;, 0);&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now step by step:&lt;br /&gt;
&lt;br /&gt;
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!)&lt;br /&gt;
&lt;br /&gt;
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. &amp;quot;EXAMPLE_DOOR&amp;quot; is the name of the door that we have given it earlier!&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Messages&amp;quot; - that is the &amp;lt;CATEGORY&amp;gt; name in your extra_english.lang file, DO NOT change this!&lt;br /&gt;
&lt;br /&gt;
&amp;quot;msgname&amp;quot; - this is the name of the message we've set earlier, remember?&lt;br /&gt;
&lt;br /&gt;
Now the message will display when the player is trying to open the door!&lt;br /&gt;
&lt;br /&gt;
PM me for any help, my forum account: ClayPigeon.&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>