Scriptable Layers (Metroid Prime 2): Difference between revisions

>Aruki
(Created page with "''This article is for the scriptable layers format from Metroid Prime 2, 3, and Donkey Kong Country Returns. See Scriptable Layers (File Format) for other revisions of thi...")
 
>Aruki
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
''This article is for the scriptable layers format from Metroid Prime 2, 3, and Donkey Kong Country Returns. See [[Scriptable Layers (File Format)]] for other revisions of this format.''
''This article is for the scriptable layers format from Metroid Prime 2, 3, and Donkey Kong Country Returns. See [[Scriptable Layers (File Format)]] for other revisions of this format.''


'''Scriptable layers''' are a data section found in the MREA format, denoted by the fourCC identifier <code>SCLY</code>. 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.
'''Scriptable layers''' are a data section found in the MREA format, denoted by the fourCC identifier <code>SCLY</code>. 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 ScriptLayerController 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.


In Echoes, the SCLY format was overhauled. The most notable change is that all properties now have a 32-bit ID and a size value listed, allowing the game to match properties in the file with data members by ID rather than by their position in the file; this was presumably done to avoid breaking cooked data when objects were modified during development, since this change meant the file could still be read correctly if properties were added or removed from an object and the script data hadn't been recooked. Another change is that there's now a separate layer for generated objects (ie objects that are spawned using a Generator or a PickupGenerator), which uses the fourCC <code>SCGN</code>. Aside from minor changes in the header, the <code>SCGN</code> layer is identical to <code>SCLY</code> layers.
In Echoes, the SCLY format was overhauled. The most notable change is that all properties now have a 32-bit ID and a size value listed, allowing the game to match properties in the file with data members by ID rather than by their position in the file; this was presumably done to avoid breaking cooked data when objects were modified during development, since this change meant the file could still be read correctly if properties were added or removed from an object and the script data hadn't been recooked. Another change is that there's now a separate layer for generated objects (ie objects that are spawned using a Generator or a PickupGenerator), which uses the fourCC <code>SCGN</code>. Aside from minor changes in the header, the <code>SCGN</code> layer is identical to <code>SCLY</code> layers.
Line 209: Line 209:
| colspan=5 {{unknown|End of property}}
| colspan=5 {{unknown|End of property}}
|}
|}
== Generated Objects ==
Generated objects are stored on a separate layer, denoted with <code>SCGN</code>. The SCGN layer isn't a real layer; it doesn't store a self-index and instances on the layer still contain the index of their original SCLY script layer in their instance ID. These are the stipulations that cause an instance to be written to SCGN:
* Any instance that receives a Generate/Activate message (MP2) or a Generate/Attach, Generate0/Attach, or Generate1/Attach message (MP3, DKCR) is written to SCGN instead of SCLY.
* In DKCR, all GenericCreature instances are written to both SCLY and SCGN. (The generated one is spawned if you scroll the creature offscreen and come back.)


[[Category:File Formats]]
[[Category:File Formats]]
Anonymous user