<?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%2FMap_Effects_Handler</id>
	<title>HPL3/SOMA/Scripting/Map Effects Handler - 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%2FMap_Effects_Handler"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Map_Effects_Handler&amp;action=history"/>
	<updated>2026-10-04T04:27:58Z</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/Map_Effects_Handler&amp;diff=7230&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/Map_Effects_Handler&amp;diff=7230&amp;oldid=prev"/>
		<updated>2026-10-02T12:12:50Z</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 Map Effects Handler fades world settings and stores named environment presets. Map_Preset_SetupFog defines the fog portion of a preset; Map_Preset_Fade applies a named preset over a fade duration.&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_map.hps&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Map_Preset_SetupFog ===&lt;br /&gt;
Setup fog for the specified preset&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 preset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abActive&amp;lt;/code&amp;gt; || If fog should be active&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afStart&amp;lt;/code&amp;gt; || Where fog starts showing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afEnd&amp;lt;/code&amp;gt; || Where fog has full effect&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFalloffExp&amp;lt;/code&amp;gt; || How fast the fog fades to full effect, lower is faster&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;aColor&amp;lt;/code&amp;gt; || Color of the fog&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afBrightness&amp;lt;/code&amp;gt; || Brightness of the fog&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abUnderwater&amp;lt;/code&amp;gt; || If underwater fog should be used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abSkybox&amp;lt;/code&amp;gt; || If fog color should be taken from skybox&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;maps/chapter02/02_03_delta/02_03_delta.hps&amp;lt;/code&amp;gt;, SOMA calls &amp;lt;code&amp;gt;Map_Preset_SetupFog&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;
Map_Preset_SetupFog(&amp;quot;Outside2.4&amp;quot;, true, 0, 25, 0.3, cColor(0.047,0.086,0.098,1), 1, true, true);&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;Outside2.4&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abActive&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afStart&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afEnd&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;25&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFalloffExp&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0.3&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(0.047,0.086,0.098,1)&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;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abUnderwater&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;abSkybox&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&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;
=== Map_Preset_Fade ===&lt;br /&gt;
Fade in the preset&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 preset&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeTime&amp;lt;/code&amp;gt; || How long it should take to fade in&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;maps/chapter03/03_01_omicron_outside/03_01_omicron_outside.hps&amp;lt;/code&amp;gt;, SOMA calls &amp;lt;code&amp;gt;Map_Preset_Fade&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;
Map_Preset_Fade(&amp;quot;Dome&amp;quot;, 0.5);&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;Dome&amp;amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afFadeTime&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;0.5&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;
=== Map_FadeFogColor ===&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;maps/chapter05/05_01_phi_inside/05_01_phi_inside.hps&amp;lt;/code&amp;gt;, SOMA calls &amp;lt;code&amp;gt;Map_FadeFogColor&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;
Map_FadeFogColor(cColor(0),8.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;aTarget&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;cColor(0)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;afTime&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;8.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;
== 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/Scripting/User Modules Overview|User modules]]&lt;br /&gt;
* [[HPL3/SOMA/Scripting/Modules Helper|SOMA module helpers]]&lt;br /&gt;
&lt;br /&gt;
[[Category:English]]&lt;/div&gt;</summary>
		<author><name>TiMan</name></author>
		
	</entry>
</feed>