<?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=HPL3%2FSOMA%2FGetting_Started%2FAdd_Your_First_Script</id>
	<title>HPL3/SOMA/Getting Started/Add Your First Script - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=HPL3%2FSOMA%2FGetting_Started%2FAdd_Your_First_Script"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Getting_Started/Add_Your_First_Script&amp;action=history"/>
	<updated>2026-08-04T06:06:17Z</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=HPL3/SOMA/Getting_Started/Add_Your_First_Script&amp;diff=7118&amp;oldid=prev</id>
		<title>TiMan: Created page with &quot;{{Hpl3SomaGettingStarted|step=5}}  Every map can have a map script. For the sample map, it is &lt;code&gt;sample_map.hps&lt;/code&gt; beside &lt;code&gt;sample_map.hpm&lt;/code&gt;.  == Add a visible...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Getting_Started/Add_Your_First_Script&amp;diff=7118&amp;oldid=prev"/>
		<updated>2026-07-30T10:49:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Hpl3SomaGettingStarted|step=5}}  Every map can have a map script. For the sample map, it is &amp;lt;code&amp;gt;sample_map.hps&amp;lt;/code&amp;gt; beside &amp;lt;code&amp;gt;sample_map.hpm&amp;lt;/code&amp;gt;.  == Add a visible...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Hpl3SomaGettingStarted|step=5}}&lt;br /&gt;
&lt;br /&gt;
Every map can have a map script. For the sample map, it is &amp;lt;code&amp;gt;sample_map.hps&amp;lt;/code&amp;gt; beside &amp;lt;code&amp;gt;sample_map.hpm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Add a visible script change ==&lt;br /&gt;
&lt;br /&gt;
# Open &amp;lt;code&amp;gt;MyFirstMod/maps/sample_map/sample_map.hps&amp;lt;/code&amp;gt; in your text editor.&lt;br /&gt;
# Find &amp;lt;code&amp;gt;void OnStart()&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;cScrMap&amp;lt;/code&amp;gt; class.&lt;br /&gt;
# Add the debug-message call between its braces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void OnStart()&lt;br /&gt;
{&lt;br /&gt;
    cLux_AddDebugMessage(&amp;quot;Hello World!&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Save the script.&lt;br /&gt;
# Launch the mod. If the map was already running in development mode, press &amp;lt;code&amp;gt;F5&amp;lt;/code&amp;gt; to reload it.&lt;br /&gt;
&lt;br /&gt;
The text &amp;lt;code&amp;gt;Hello World!&amp;lt;/code&amp;gt; should appear at the lower-left of the screen when the map starts.&lt;br /&gt;
&lt;br /&gt;
{{note|Keep the generated includes, the &amp;lt;code&amp;gt;cScrMap : iScrMap&amp;lt;/code&amp;gt; declaration, and the surrounding callback structure. This tutorial changes only the body of &amp;lt;code&amp;gt;OnStart()&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
== Checkpoint ==&lt;br /&gt;
&lt;br /&gt;
Continue when the message appears in-game after a fresh map start.&lt;br /&gt;
&lt;br /&gt;
== If it does not work ==&lt;br /&gt;
&lt;br /&gt;
* Confirm the script has the same base name and folder as the map: &amp;lt;code&amp;gt;sample_map.hpm&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;sample_map.hps&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Confirm the line ends with a semicolon and uses straight quotation marks.&lt;br /&gt;
* Confirm you edited the script inside your copied mod.&lt;br /&gt;
* Press &amp;lt;code&amp;gt;F1&amp;lt;/code&amp;gt; in development mode, then use '''Show Error List''' or '''Show HPL Log'''.&lt;br /&gt;
&lt;br /&gt;
Read [[HPL3/Scripting/Scripting Guide/Scripting Workflow and Structure|Scripting Workflow and Structure]] for the generated map-script layout and [[HPL3/Scripting/Scripting Guide/Hello World|Hello World]] for the focused scripting lesson.&lt;/div&gt;</summary>
		<author><name>TiMan</name></author>
		
	</entry>
</feed>