<?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%2FScripting%2FModules_Helper</id>
	<title>HPL3/SOMA/Scripting/Modules Helper - 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%2FScripting%2FModules_Helper"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Modules_Helper&amp;action=history"/>
	<updated>2026-10-04T04:27:59Z</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/Scripting/Modules_Helper&amp;diff=7216&amp;oldid=prev</id>
		<title>TiMan: Add a sourced SOMA guide with explanations and stock-script examples.</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Modules_Helper&amp;diff=7216&amp;oldid=prev"/>
		<updated>2026-10-02T12:09:28Z</updated>

		<summary type="html">&lt;p&gt;Add a sourced SOMA guide with explanations and stock-script examples.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{shortPageTitle}}&lt;br /&gt;
&lt;br /&gt;
The Modules helper file in SOMA is &amp;lt;code&amp;gt;script/helpers/helper_modules.hps&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Module helpers expose script-module behavior to map and entity scripts. For example, LightFlash_Add resolves the named entity and forwards its position to the Light Flash Handler; a missing named entity produces an error and returns -1.&lt;br /&gt;
&lt;br /&gt;
== Before you start ==&lt;br /&gt;
# Open the map script inside your own mod. Keep its generated includes, &amp;lt;code&amp;gt;cScrMap : iScrMap&amp;lt;/code&amp;gt; class and callback structure. See [[HPL3/SOMA/Getting Started/Add Your First Script|Add your first script]] if you have not edited a map script yet.&lt;br /&gt;
# Add the helper include shown below alongside the script’s other includes.&lt;br /&gt;
# Read the stock example before copying its calls: named entities, voice subjects, materials and callbacks must belong to the map or resources you are using.&lt;br /&gt;
&lt;br /&gt;
== Follow the stock example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;helpers/helper_modules.hps&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LightFlash_Add ===&lt;br /&gt;
Creates a flash of light at the position of an entity. Returns id of the flash.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afTime&amp;lt;/code&amp;gt; || The time that light stays at full intensity&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeInTime&amp;lt;/code&amp;gt; || How long it takes to fade in&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeOutTime&amp;lt;/code&amp;gt; || How long it takes to fade out&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asTargetEntity&amp;lt;/code&amp;gt; || Entity at which it will be created.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;aColor&amp;lt;/code&amp;gt; || The color of the light.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afRadius&amp;lt;/code&amp;gt; || The radius of the light (this will NOT be faded, it starts with this radius, and then just color fades in)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afBrightness&amp;lt;/code&amp;gt; || The brightness of the light.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;maps/chapter02/02_01_ms_curie_outside/02_01_ms_curie_outside.hps&amp;lt;/code&amp;gt;, SOMA calls &amp;lt;code&amp;gt;LightFlash_Add&amp;lt;/code&amp;gt; as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
LightFlash_Add(0.25f,0.1f,0.2f,&amp;quot;CortexChipTool&amp;quot;, cColor_White, 0.15f, 2.0f);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Value in this stock call&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afTime&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0.25f&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeInTime&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0.1f&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeOutTime&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0.2f&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asTargetEntity&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;amp;quot;CortexChipTool&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;aColor&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cColor_White&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afRadius&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0.15f&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afBrightness&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;2.0f&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is an excerpt from that stock script; its referenced names and variables belong to that script.&lt;br /&gt;
&lt;br /&gt;
=== LightFlash_Add ===&lt;br /&gt;
Creates a flash of light at the position of an entity. Returns id of the flash.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afTime&amp;lt;/code&amp;gt; || The time that light stays at full intensity&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeInTime&amp;lt;/code&amp;gt; || How long it takes to fade in&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeOutTime&amp;lt;/code&amp;gt; || How long it takes to fade out&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;avTargetPos&amp;lt;/code&amp;gt; || Position at which it will be created.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;aColor&amp;lt;/code&amp;gt; || The color of the light.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afRadius&amp;lt;/code&amp;gt; || The radius of the light (this will NOT be faded, it starts with this radius, and then just color fades in)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afBrightness&amp;lt;/code&amp;gt; || The brightness of the light.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Description_Add ===&lt;br /&gt;
Use this helper for displayed text: it forwards the language category, entry, display-time multiplier and queue flag to the Description Handler. See [[HPL3/SOMA/Scripting/Description Handler|the description example]] for text lookup, duration and queuing behavior.&lt;br /&gt;
&lt;br /&gt;
== Check your change ==&lt;br /&gt;
Save the script and restart the map in development mode with &amp;lt;code&amp;gt;F5&amp;lt;/code&amp;gt;. If the script fails, open &amp;lt;code&amp;gt;F1&amp;lt;/code&amp;gt; and use '''Show Error List''' or '''Show HPL Log'''. See [[HPL3/SOMA/Getting Started/Test Debug and Continue|the development loop]] for the launch and debugging steps.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[HPL3/SOMA/Scripting|SOMA scripting]]&lt;br /&gt;
* [[HPL3/SOMA/Scripting/Scripting Api|SOMA scripting API]]&lt;br /&gt;
&lt;br /&gt;
[[Category:English]]&lt;/div&gt;</summary>
		<author><name>TiMan</name></author>
		
	</entry>
</feed>