Difference between revisions of "HPL3/Amnesia: Rebirth/Tutorials/Tablets"

From Frictional Wiki
Jump to navigation Jump to search
(Created)
 
(More info)
Line 1: Line 1:
 
This tutorial will detail how to make a custom Dark World tablet. They are the dark-grey tablets that have hieroglyphic text on them which gets translated after a moment. The tutorial assumes you can set up your mod and have basic skills in scripting etc.
 
This tutorial will detail how to make a custom Dark World tablet. They are the dark-grey tablets that have hieroglyphic text on them which gets translated after a moment. The tutorial assumes you can set up your mod and have basic skills in scripting etc.
 +
 +
==Tutorial==
  
 
To get a custom readable tablet in Rebirth:
 
To get a custom readable tablet in Rebirth:
# Set up a new category for your map in <code>readables.cfg</code>
+
# Set up a new category for your map in <code>readables.cfg</code>.
# Set the note ID and FrontEntry to whatever you want the note to be called
+
# Set the note ID and FrontEntry to whatever you want the note to be called. They don't have to be the same.
# Place a category of the same name in english.lang, and then set up an entry with the same name as the ID previously set in readables.cfg
+
# Place a category in <code>english.lang</code> with the same name as the ID in <code>readables.cfg</code>
 +
# In that category, set up an entry with the same name as the FrontEntry name previously set for the tablet in <code>readables.cfg</code>
 
# Place the <code>dw_tablet_readable.ent</code> entity somewhere in a level
 
# Place the <code>dw_tablet_readable.ent</code> entity somewhere in a level
# Name your tablet in game as <code>Readable_<ID HERE></code>
+
# Set the Readable/ID parameter of the entity to the ID from <code>readables.cfg</code>
# Set the GUI func to <code>OnGuiDWNote</code> and set text side as wanted
+
# Set the GUI func to <code>OnGuiDWNote</code> and set text scale as wanted
# Place this script somewhere in your map script:
+
# Add this to your include list in your map script: <code>#include "helpers/custom/helper_props_custom.hps"</code>
 +
# Place this function somewhere in your script:
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
void OnGuiDWNote(const tString&in asEntityName, float afTimeStep)
 
void OnGuiDWNote(const tString&in asEntityName, float afTimeStep)
Line 16: Line 20:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
If you want to make a tablet unreadable, you just make the entity name something that isnt in <code>readables.cfg</code>.
+
If you want to make a tablet unreadable, leave the Readable/ID parameter of the tablet empty. This means that it doesn't need lang and readables entries.
Frictional named all their unreadable tablets like this: <code>Readable_DWNote_MiscXX</code>
+
 
 +
Optional steps:
 +
* Set up the note so it appears in the sketchbook properly:
 +
** Add an entry called <code><FrontEntry Name>_Name</code> in the same map category in <code>english.lang</code>
 +
** In <code>english.lang</code>, add a category called "Levels" and inside add an entry which is called the same as the "Name" parameter in the <code>readables.cfg</code> category
 +
* Name your tablet in game as <code>Readable_<ID HERE></code> (good practice)
 +
* If the tablet isn't going to be readable, name the entity like this: <code>Readable_DWNote_MiscXX</code>, where XX are numbers (good practice)
 +
 
 +
== Config file examples ==
 +
'''English.lang''':
 +
<syntaxhighlight lang="xml">
 +
<LANGUAGE>
 +
  <CATEGORY Name="sample_map">
 +
<Entry Name="TestTablet_FrontEntry">My first tablet bla bla bla bla bla</Entry>
 +
<Entry Name="TestTablet_FrontEntry_Name">This is the entry name in the sketchbook</Entry>
 +
  </CATEGORY>
 +
 
 +
  <CATEGORY Name="Levels">
 +
<Entry Name="sample_map_sketchbook_category">This is the category name in the sketchbook</Entry>
 +
  </CATEGORY>
 +
 
 +
</LANGUAGE>
 +
</syntaxhighlight>
 +
'''Readables.cfg''':
 +
<syntaxhighlight lang="xml">
 +
<Readables>
 +
<Categories>
 +
 +
<Category ID="sample_map" Name="sample_map_sketchbook_category">
 +
<Notes>
 +
<Note ID="TestTablet" VoiceSubject="" FrontEntry="TestTablet_FrontEntry" BackEntry="" ImageEntry="" />
 +
</Notes>
 +
</Category>
 +
 +
</Categories>
 +
</Readables>
 +
</syntaxhighlight>
 +
 
 +
[[File:Sketchbook example.jpg |thumb|Results|left]]

Revision as of 01:09, 10 November 2020

This tutorial will detail how to make a custom Dark World tablet. They are the dark-grey tablets that have hieroglyphic text on them which gets translated after a moment. The tutorial assumes you can set up your mod and have basic skills in scripting etc.

Tutorial

To get a custom readable tablet in Rebirth:

  1. Set up a new category for your map in readables.cfg.
  2. Set the note ID and FrontEntry to whatever you want the note to be called. They don't have to be the same.
  3. Place a category in english.lang with the same name as the ID in readables.cfg
  4. In that category, set up an entry with the same name as the FrontEntry name previously set for the tablet in readables.cfg
  5. Place the dw_tablet_readable.ent entity somewhere in a level
  6. Set the Readable/ID parameter of the entity to the ID from readables.cfg
  7. Set the GUI func to OnGuiDWNote and set text scale as wanted
  8. Add this to your include list in your map script: #include "helpers/custom/helper_props_custom.hps"
  9. Place this function somewhere in your script:
void OnGuiDWNote(const tString&in asEntityName, float afTimeStep)
{
    DWNote_RenderGUI(asEntityName, afTimeStep);
}

If you want to make a tablet unreadable, leave the Readable/ID parameter of the tablet empty. This means that it doesn't need lang and readables entries.

Optional steps:

  • Set up the note so it appears in the sketchbook properly:
    • Add an entry called <FrontEntry Name>_Name in the same map category in english.lang
    • In english.lang, add a category called "Levels" and inside add an entry which is called the same as the "Name" parameter in the readables.cfg category
  • Name your tablet in game as Readable_<ID HERE> (good practice)
  • If the tablet isn't going to be readable, name the entity like this: Readable_DWNote_MiscXX, where XX are numbers (good practice)

Config file examples

English.lang:

<LANGUAGE>
  <CATEGORY Name="sample_map">
		<Entry Name="TestTablet_FrontEntry">My first tablet bla bla bla bla bla</Entry>
		<Entry Name="TestTablet_FrontEntry_Name">This is the entry name in the sketchbook</Entry>
  </CATEGORY>
  
   <CATEGORY Name="Levels">
		<Entry Name="sample_map_sketchbook_category">This is the category name in the sketchbook</Entry>
  </CATEGORY>
  
</LANGUAGE>

Readables.cfg:

<Readables>
	<Categories>
	
		<Category ID="sample_map" Name="sample_map_sketchbook_category">
			<Notes>
				<Note ID="TestTablet" VoiceSubject="" FrontEntry="TestTablet_FrontEntry" BackEntry="" ImageEntry="" />
			</Notes>
		</Category>
				
	</Categories>
</Readables>
Results