<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.metroid2002.com/retromodding/index.php?action=history&amp;feed=atom&amp;title=Scriptable_Layers_%28Metroid_Prime%29</id>
		<title>Scriptable Layers (Metroid Prime) - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.metroid2002.com/retromodding/index.php?action=history&amp;feed=atom&amp;title=Scriptable_Layers_%28Metroid_Prime%29"/>
		<link rel="alternate" type="text/html" href="http://www.metroid2002.com/retromodding/index.php?title=Scriptable_Layers_(Metroid_Prime)&amp;action=history"/>
		<updated>2026-04-30T06:36:57Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://www.metroid2002.com/retromodding/index.php?title=Scriptable_Layers_(Metroid_Prime)&amp;diff=1178&amp;oldid=prev</id>
		<title>Aruki: Created page with &quot;''This article is for the scriptable layers format from Metroid Prime. See Scriptable Layers (File Format) for other revisions of this format.''  '''Scriptable layers''' a...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.metroid2002.com/retromodding/index.php?title=Scriptable_Layers_(Metroid_Prime)&amp;diff=1178&amp;oldid=prev"/>
				<updated>2015-07-21T02:48:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;This article is for the scriptable layers format from Metroid Prime. See &lt;a href=&quot;/retromodding/wiki/Scriptable_Layers_(File_Format)&quot; title=&quot;Scriptable Layers (File Format)&quot;&gt;Scriptable Layers (File Format)&lt;/a&gt; for other revisions of this format.&amp;#039;&amp;#039;  &amp;#039;&amp;#039;&amp;#039;Scriptable layers&amp;#039;&amp;#039;&amp;#039; a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;''This article is for the scriptable layers format from Metroid Prime. See [[Scriptable Layers (File Format)]] for other revisions of this format.''&lt;br /&gt;
&lt;br /&gt;
'''Scriptable layers''' are a data section found in the MREA format, denoted by the fourCC identifier &amp;lt;code&amp;gt;SCLY&amp;lt;/code&amp;gt;. It contains script object instances which are used to set the object layout of each room. Rooms can contain multiple layers, with each being able to be toggled on and off independently, allowing for the layout of a room to be updated after significant ingame events, which is done using a SpecialFunction object. Each instance has a large number of parameters that can be toggled to customize the appearance and behavior of that instance, and they're capable of sending messages to other objects, allowing for fairly complex interactions between objects to be scripted.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| char[4]&lt;br /&gt;
| 4&lt;br /&gt;
| '''Magic'''; always &amp;lt;code&amp;gt;SCLY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| long&lt;br /&gt;
| 4&lt;br /&gt;
| {{unknown|'''Unknown'''}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| long&lt;br /&gt;
| 4&lt;br /&gt;
| '''Layer count (LC)'''&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| long[LC]&lt;br /&gt;
| 4 &amp;amp;times; LC&lt;br /&gt;
| Layer sizes array (sizes are always a multiple of 32)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Script Layers ===&lt;br /&gt;
&lt;br /&gt;
The size of each layer is always a multiple of 32; the end of the layer is 0-padded. Note that the layers don't actually ''start'' on a multiple of 32, so they're not 32-byte-aligned within the file; they're just aligned relative to the start of the layer data.&lt;br /&gt;
&lt;br /&gt;
An important note is that every layer also has a name and a default &amp;quot;active&amp;quot; flag that determines whether or not the layer is enabled on a new file, but this data is stored in a completely different resource, in the [[MLVL (Metroid Prime)|MLVL]] format.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| char&lt;br /&gt;
| 1&lt;br /&gt;
| {{unknown|'''Unknown'''}}&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| long&lt;br /&gt;
| 4&lt;br /&gt;
| '''Object count'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Script Object Instances ===&lt;br /&gt;
&lt;br /&gt;
Object instances share a common header, followed by a big binary blob of property data that varies depending on the object type. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| char&lt;br /&gt;
| 1&lt;br /&gt;
| [[List of Script Objects (Metroid Prime)|'''Object type''']]&lt;br /&gt;
|-&lt;br /&gt;
| long&lt;br /&gt;
| 4&lt;br /&gt;
| '''Instance size''' (relative to after size value)&lt;br /&gt;
|-&lt;br /&gt;
| long&lt;br /&gt;
| 4&lt;br /&gt;
| '''Instance ID'''&lt;br /&gt;
|-&lt;br /&gt;
| long&lt;br /&gt;
| 4&lt;br /&gt;
| '''Connection count''' (CC)&lt;br /&gt;
|-&lt;br /&gt;
| [[#Connections|Connections]][CC]&lt;br /&gt;
| 0xC &amp;amp;times; CC&lt;br /&gt;
| '''Connections'''&lt;br /&gt;
|-&lt;br /&gt;
| long&lt;br /&gt;
| 4&lt;br /&gt;
| '''Property count'''&lt;br /&gt;
|-&lt;br /&gt;
| char[]&lt;br /&gt;
| -&lt;br /&gt;
| '''Property data'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Connections ====&lt;br /&gt;
&lt;br /&gt;
The connections part allows for inter-object scripting to be set up. Objects can enter a wide variety of different states, and they can be scripted to send messages to other objects when these states are activated. The actual struct for each connection simply sets a state, a message type, and a target object.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| long&lt;br /&gt;
| '''State'''&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| long&lt;br /&gt;
| '''Message'''&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| long&lt;br /&gt;
| '''Target Object ID'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also  ==&lt;br /&gt;
&lt;br /&gt;
* For a list of all script objects and their parameters, or a list of state/message types, see: [[List of Script Objects (Metroid Prime)]]&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Metroid Prime]]&lt;/div&gt;</summary>
		<author><name>Aruki</name></author>	</entry>

	</feed>