<?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%2FAreas_Helper</id>
	<title>HPL3/SOMA/Scripting/Areas 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%2FAreas_Helper"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Areas_Helper&amp;action=history"/>
	<updated>2026-10-04T04:30:19Z</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/Areas_Helper&amp;diff=7214&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/Areas_Helper&amp;diff=7214&amp;oldid=prev"/>
		<updated>2026-10-02T12:09:16Z</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 Areas helper file in SOMA is &amp;lt;code&amp;gt;script/helpers/helper_areas.hps&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Area helpers move areas and operate on specialized area behavior such as doorway groups, liquids, sticky attachments and camera-animation nodes. Ordinary area movement excludes liquid areas, which have their own movement helper.&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_areas.hps&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Area_MoveLinearTo ===&lt;br /&gt;
Moves the specified area to the current position of the target entity.&lt;br /&gt;
!Does not work on Liquid Areas, instead use LiquidArea_MoveLinearTo!&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;asName&amp;lt;/code&amp;gt; || name of the area to move, wildcard(s) * are supported.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asTargetEntity&amp;lt;/code&amp;gt; || name of the entity to move the area to.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afAcceleration&amp;lt;/code&amp;gt; || acceleration .in m/s^2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afMaxSpeed&amp;lt;/code&amp;gt; || the maximum speed of movement.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afSlowDownDist&amp;lt;/code&amp;gt; || the distance at which movement slows down.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abResetSpeed&amp;lt;/code&amp;gt; || if all static movement for the area should be stopped before starting this movement.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asCallback&amp;lt;/code&amp;gt; || callback when movement is done: void asCallback(const tString&amp;amp; in asAreaName)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;maps/_e3/_e3_01_01/_e3_01_01.hps&amp;lt;/code&amp;gt;, SOMA calls &amp;lt;code&amp;gt;Area_MoveLinearTo&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;
Area_MoveLinearTo(&amp;quot;RunningSoundSource&amp;quot;,&amp;quot;RunningSoundSource_Target&amp;quot;,2.2f,5.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;asName&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;amp;quot;RunningSoundSource&amp;amp;quot;&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;RunningSoundSource_Target&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afAcceleration&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;2.2f&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afMaxSpeed&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;5.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;
=== LiquidArea_MoveLinearTo ===&lt;br /&gt;
Moves the specified liquid area to the current position of the target entity.&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;asName&amp;lt;/code&amp;gt; || name of the liquid area to move, wildcard(s) * are supported.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asTargetEntity&amp;lt;/code&amp;gt; || name of the entity to move the liquid area to.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afAcceleration&amp;lt;/code&amp;gt; || acceleration .in m/s^2&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afMaxSpeed&amp;lt;/code&amp;gt; || the maximum speed of movement.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afSlowDownDist&amp;lt;/code&amp;gt; || the distance at which movement slows down.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abResetSpeed&amp;lt;/code&amp;gt; || if all static movement for the liquid area should be stopped before starting this movement.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asCallback&amp;lt;/code&amp;gt; || callback when movement is done: void asCallback(const tString&amp;amp; in asAreaName)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;maps/chapter02/02_04_theta_outside/02_04_theta_outside.hps&amp;lt;/code&amp;gt;, SOMA calls &amp;lt;code&amp;gt;LiquidArea_MoveLinearTo&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;
LiquidArea_MoveLinearTo(&amp;quot;LiquidArea_1&amp;quot;, &amp;quot;LiquidArea_1_Target&amp;quot;, 1, 1, 0.25);&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;asName&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;amp;quot;LiquidArea_1&amp;amp;quot;&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;LiquidArea_1_Target&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afAcceleration&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afMaxSpeed&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afSlowDownDist&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0.25&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;
=== StickyArea_AttachEntity ===&lt;br /&gt;
Attaches an entity to a sticky area. The entity must have a physics body.&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;asArea&amp;lt;/code&amp;gt; || name of sticky area.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asEntity&amp;lt;/code&amp;gt; || name of entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;asBody&amp;lt;/code&amp;gt; || name of specific body on entity, if left as an emtpy string, the main body will be used.&lt;br /&gt;
|}&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>