https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:howtomakenotes&feed=atom&action=historyHpl2:Tutorials:script:howtomakenotes - Revision history2024-03-29T15:03:06ZRevision history for this page on the wikiMediaWiki 1.34.2https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:howtomakenotes&diff=1728&oldid=prevDarkfire: Syntax highlightin fix2020-07-22T19:32:51Z<p>Syntax highlightin fix</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 19:32, 22 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>=Setting Up=</div></td><td class='diff-marker'> </td><td style="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;"><div>=Setting Up=</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Before you actually begin adding notes or any text that is seen within the game, you must create an extra_xx.lang file (xx being whichever language you plan on using for your story). [[amnesia:custom_story|This]] tutorial covers how to create extra_xx.lang in your custom story's main folder.</div></td><td class='diff-marker'>+</td><td style="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;"><div>Before you actually begin adding notes or any text that is seen within the game, you must create an <ins class="diffchange diffchange-inline">'''</ins>extra_xx.lang<ins class="diffchange diffchange-inline">''' </ins>file (xx being whichever language you plan on using for your story). [[amnesia:custom_story|This]] tutorial covers how to create <ins class="diffchange diffchange-inline">'''</ins>extra_xx.lang<ins class="diffchange diffchange-inline">''' file </ins>in your custom story's main folder.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"></td><td class='diff-marker'> </td><td style="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;"></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>=The Basics On Tags=</div></td><td class='diff-marker'> </td><td style="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;"><div>=The Basics On Tags=</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Now that you have that setup you can move onto actually adding journal entries. Extra_xx.lang uses XML and is used by your custom story to store on screen text, item descriptions, and most importantly for this tutorial, notes and journal entries picked up by the player. The file is separated into sections that start and end with a tag. <LANGUAGE>, the main tag, is found at the beginning of the file whereas it's ending, </LANGUAGE> is found at the end. Nested inside of the language tag are category tags.</div></td><td class='diff-marker'>+</td><td style="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;"><div>Now that you have that setup you can move onto actually adding journal entries. <ins class="diffchange diffchange-inline">'''</ins>Extra_xx.lang<ins class="diffchange diffchange-inline">''' </ins>uses XML and is used by your custom story to store on screen text, item descriptions, and most importantly for this tutorial, notes and journal entries picked up by the player. The file is separated into sections that start and end with a tag. <ins class="diffchange diffchange-inline"><code></ins><LANGUAGE<ins class="diffchange diffchange-inline">></code</ins>>, the main tag, is found at the beginning of the file whereas it's ending, <ins class="diffchange diffchange-inline"><code></ins></LANGUAGE<ins class="diffchange diffchange-inline">></code</ins>> is found at the end. Nested inside of the language tag are category tags.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><br /><br />This is what your file should look like if you followed the setup tutorial found above. Notice how category's end tag is placed before language's.</div></td><td class='diff-marker'> </td><td style="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;"><div><br /><br />This is what your file should look like if you followed the setup tutorial found above. Notice how category's end tag is placed before language's.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang=""></div></td><td class='diff-marker'>+</td><td style="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;"><div><syntaxhighlight lang="<ins class="diffchange diffchange-inline">xml</ins>"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><LANGUAGE></div></td><td class='diff-marker'> </td><td style="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;"><div><LANGUAGE></div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><CATEGORY Name="CustomStoryMain"></div></td><td class='diff-marker'> </td><td style="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;"><div><CATEGORY Name="CustomStoryMain"></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l12" >Line 12:</td>
<td colspan="2" class="diff-lineno">Line 12:</td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div></LANGUAGE></div></td><td class='diff-marker'> </td><td style="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;"><div></LANGUAGE></div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div></syntaxhighlight></div></td><td class='diff-marker'> </td><td style="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;"><div></syntaxhighlight></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>As you can see the category tag has an extra part to it the language tag doesn't have. Name="" is XML's way of identifying the tag, and is the way we specify whether the category tag will be a journal category or an item description category and so on. Both journal and note category tags will be explained in this tutorial.</div></td><td class='diff-marker'>+</td><td style="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;"><div>As you can see the category tag has an extra part to it the language tag doesn't have. <ins class="diffchange diffchange-inline"><code></ins>Name=""<ins class="diffchange diffchange-inline"></code> </ins>is XML's way of identifying the tag, and is the way we specify whether the category tag will be a journal category or an item description category and so on. Both journal and note category tags will be explained in this tutorial.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"></td><td class='diff-marker'> </td><td style="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;"></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>=Adding The Journal Category=</div></td><td class='diff-marker'> </td><td style="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;"><div>=Adding The Journal Category=</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>After </CATEGORY>, add a new category tag with the name Journal, which should look like <Category Name="Journal">. After that add an ending category tag, </CATEGORY>. In between these two tags is where you place your journal entries.</div></td><td class='diff-marker'>+</td><td style="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;"><div>After <ins class="diffchange diffchange-inline"><code></ins></CATEGORY<ins class="diffchange diffchange-inline">></code</ins>>, add a new category tag with the name Journal, which should look like <ins class="diffchange diffchange-inline"><code></ins><Category Name="Journal"<ins class="diffchange diffchange-inline">></code</ins>>. After that add an ending category tag, <ins class="diffchange diffchange-inline"><code></ins></CATEGORY<ins class="diffchange diffchange-inline">></code</ins>>. In between these two tags is where you place your journal entries.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><br /><br />This is what it should look like when you're done.</div></td><td class='diff-marker'>+</td><td style="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;"><div><br/><br/>This is what it should look like when you're done.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang=""></div></td><td class='diff-marker'>+</td><td style="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;"><div><syntaxhighlight lang="<ins class="diffchange diffchange-inline">xml</ins>"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><LANGUAGE></div></td><td class='diff-marker'> </td><td style="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;"><div><LANGUAGE></div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><CATEGORY Name="CustomStoryMain"></div></td><td class='diff-marker'> </td><td style="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;"><div><CATEGORY Name="CustomStoryMain"></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l37" >Line 37:</td>
<td colspan="2" class="diff-lineno">Line 37:</td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>Start by adding an entry tag in the journal category tag and give it the name Note_Test01_Name. In this tag, put whatever you want the name of your note to be. Make sure to add an end tag entry after this. Next, add a tag and name it Note_Test01_Text and then place whatever text you want the note to have. Again, make sure to place an end tag after this.</div></td><td class='diff-marker'> </td><td style="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;"><div>Start by adding an entry tag in the journal category tag and give it the name Note_Test01_Name. In this tag, put whatever you want the name of your note to be. Make sure to add an end tag entry after this. Next, add a tag and name it Note_Test01_Text and then place whatever text you want the note to have. Again, make sure to place an end tag after this.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><br /><br />You should have something like this.</div></td><td class='diff-marker'> </td><td style="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;"><div><br /><br />You should have something like this.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><syntaxhighlight lang=""></div></td><td class='diff-marker'>+</td><td style="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;"><div><syntaxhighlight lang="<ins class="diffchange diffchange-inline">xml</ins>"></div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><LANGUAGE></div></td><td class='diff-marker'> </td><td style="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;"><div><LANGUAGE></div></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div><CATEGORY Name="CustomStoryMain"></div></td><td class='diff-marker'> </td><td style="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;"><div><CATEGORY Name="CustomStoryMain"></div></td></tr>
</table>Darkfirehttps://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:script:howtomakenotes&diff=850&oldid=prevMaintenance script: Upload from wiki2020-07-09T13:48:48Z<p>Upload from wiki</p>
<p><b>New page</b></p><div>=Setting Up=<br />
Before you actually begin adding notes or any text that is seen within the game, you must create an extra_xx.lang file (xx being whichever language you plan on using for your story). [[amnesia:custom_story|This]] tutorial covers how to create extra_xx.lang in your custom story's main folder.<br />
<br />
=The Basics On Tags=<br />
Now that you have that setup you can move onto actually adding journal entries. Extra_xx.lang uses XML and is used by your custom story to store on screen text, item descriptions, and most importantly for this tutorial, notes and journal entries picked up by the player. The file is separated into sections that start and end with a tag. <LANGUAGE>, the main tag, is found at the beginning of the file whereas it's ending, </LANGUAGE> is found at the end. Nested inside of the language tag are category tags.<br />
<br /><br />This is what your file should look like if you followed the setup tutorial found above. Notice how category's end tag is placed before language's.<br />
<syntaxhighlight lang=""><br />
<LANGUAGE><br />
<CATEGORY Name="CustomStoryMain"><br />
<Entry Name="Description">A test description.</Entry><br />
</CATEGORY><br />
</LANGUAGE><br />
</syntaxhighlight><br />
As you can see the category tag has an extra part to it the language tag doesn't have. Name="" is XML's way of identifying the tag, and is the way we specify whether the category tag will be a journal category or an item description category and so on. Both journal and note category tags will be explained in this tutorial.<br />
<br />
=Adding The Journal Category=<br />
After </CATEGORY>, add a new category tag with the name Journal, which should look like <Category Name="Journal">. After that add an ending category tag, </CATEGORY>. In between these two tags is where you place your journal entries.<br />
<br /><br />This is what it should look like when you're done.<br />
<syntaxhighlight lang=""><br />
<LANGUAGE><br />
<CATEGORY Name="CustomStoryMain"><br />
<Entry Name="Description">Just a description.</Entry><br />
</CATEGORY><br />
<br />
<CATEGORY Name="Journal"><br />
JOURNAL ENTRIES GO HERE<br />
</CATEGORY><br />
<br />
</LANGUAGE><br />
</syntaxhighlight><br />
<br />
=Adding Journal Entries=<br />
If you notice above, in the CustomStoryMain category tag there's another tag called Entry. It functions basically the same as category except it has one more addition. Instead of placing tags in between it like with category and language, you place text which you want to display in game.<br />
<br />
There are two types of entry tags that you will need. One tag specifying the name of the note and another that contains the body of text the player reads.<br />
<br />
Start by adding an entry tag in the journal category tag and give it the name Note_Test01_Name. In this tag, put whatever you want the name of your note to be. Make sure to add an end tag entry after this. Next, add a tag and name it Note_Test01_Text and then place whatever text you want the note to have. Again, make sure to place an end tag after this.<br />
<br /><br />You should have something like this.<br />
<syntaxhighlight lang=""><br />
<LANGUAGE><br />
<CATEGORY Name="CustomStoryMain"><br />
<Entry Name="Description">Just a description.</Entry><br />
</CATEGORY><br />
<br />
<CATEGORY Name="Journal"><br />
<Entry Name="Note_Test01_Name">Test Note</Entry><br />
<Entry Name="Note_Test01_Text">This note is a test.</Entry><br />
</CATEGORY><br />
<br />
</LANGUAGE><br />
</syntaxhighlight><br />
<br />
And that's pretty much it for the extra_xx.lang file. Now there's just one more step to get it into your map.<br />
<br />
=Adding the Note to your Map=<br />
In the level editor, click the entity button and select items from the drop down list. Choose one of these entities note_generic, note_letter, note_manual, note_paper01 or note_scroll and place it in your map. Select it, and from the entity tab go down to the NoteText entry. This is where you specify what journal entry you want to use, Test01 in this case. Save your map and load it in game to see the results.</div>Maintenance script