<?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%2FLevel_Streaming</id>
	<title>HPL3/SOMA/Scripting/Level Streaming - 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%2FLevel_Streaming"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Level_Streaming&amp;action=history"/>
	<updated>2026-10-04T03:47:24Z</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/Level_Streaming&amp;diff=7259&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/Level_Streaming&amp;diff=7259&amp;oldid=prev"/>
		<updated>2026-10-02T12:21:40Z</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;
Map streaming loads the next map’s assets before the transition. SOMA’s Curie Outside script shows how preloading, transfer-area preservation and a readiness check fit together.&lt;br /&gt;
&lt;br /&gt;
== Follow the Curie transition ==&lt;br /&gt;
# Include &amp;lt;code&amp;gt;helpers/helper_map.hps&amp;lt;/code&amp;gt; in the map script. The following are excerpts from &amp;lt;code&amp;gt;maps/chapter02/02_01_ms_curie_outside/02_01_ms_curie_outside.hps&amp;lt;/code&amp;gt;, rather than a complete transition script.&lt;br /&gt;
# Begin preloading the destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Map_Preload(&amp;quot;02_02_ms_curie_inside.hpm&amp;quot;, eWorldStreamPriority_Low);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The inspected helper declares a priority argument, but only forwards the map name to &amp;lt;code&amp;gt;cLux_PreloadMap&amp;lt;/code&amp;gt;. To change the priority, the stock script calls the separate helper:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Map_SetPreloadPriority(eWorldStreamPriority_Normal);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Before changing maps, the stock transition calls:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Map_Deload(&amp;quot;Transfer2122&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The helper’s source comment describes the named transfer area as preserving objects inside it from deloading. &amp;lt;code&amp;gt;Transfer2122&amp;lt;/code&amp;gt; belongs to this stock transition; it is not a universal area name.&lt;br /&gt;
&lt;br /&gt;
# The timer callback waits for readiness before changing maps. If loading is incomplete, it schedules another check after 0.55 seconds:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
if(Map_IsPreloadCompleted())&lt;br /&gt;
{&lt;br /&gt;
    // Other stock transition cleanup occurs here.&lt;br /&gt;
    Map_ChangeMap(&amp;quot;02_02_ms_curie_inside.hpm&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;Transfer2122&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
else Map_AddTimer(&amp;quot;ChangeMap&amp;quot;, 0.55f, &amp;quot;PreloadTimer&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This excerpt abbreviates the entity cleanup preceding &amp;lt;code&amp;gt;Map_ChangeMap&amp;lt;/code&amp;gt;. The full stock script also copies global settings, fades an environment preset and changes the preload priority through its timer events.&lt;br /&gt;
&lt;br /&gt;
== Understand the change-map arguments ==&lt;br /&gt;
The five-argument overload takes the destination map, player-start name, transfer-area name, start sound and end sound. The four-argument overload leaves out the transfer-area argument and supplies an empty name internally. Both stop the grab state before forwarding the transition to the native function.&lt;br /&gt;
&lt;br /&gt;
== Adapt the pattern ==&lt;br /&gt;
Use destination, player-start and transfer-area names that exist in your own map setup. Keep the readiness check and its timer callback together; copying the timer call alone does not define &amp;lt;code&amp;gt;PreloadTimer&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[HPL3/SOMA/Scripting/Map Helper|Map timers and helpers]]&lt;br /&gt;
* [[HPL3/SOMA/Areas/MapTransfer Area|MapTransfer areas]]&lt;br /&gt;
&lt;br /&gt;
[[Category:English]]&lt;/div&gt;</summary>
		<author><name>TiMan</name></author>
		
	</entry>
</feed>