SCAN (Metroid Prime 2)

From Retro Modding Wiki
Revision as of 06:17, 31 December 2015 by >Aruki (→‎ScanInfoSecondaryModel)
Jump to navigation Jump to search

This article is for the SCAN format from Metroid Prime 2 and 3. For other revisions of this format, see SCAN (File Format).

The SCAN file format describes scannable objects. The format's been updated since Prime 1; the data is now embedded into a script object, using the scriptable layers format. There was also some additional data added to the format to set up the model that displays in the logbook.


This file format is almost completely documented
There's a couple remaining unknown parameters.


Format

The SCAN format sets up a small script layer that contains a single ScannableObjectInfo instance.

Header

Offset Size Description
0x0 4 Magic; always SCAN
0x4 4 Unknown; always 2
0x8 1 Unknown
0x9 4 Instance count; always 1

ScannableObjectInfo

This section of the file embeds a ScannableObjectInfo script object.

Offset Size Description
0x0 4 Object type; always SNFO
0x4 2 Instance size
0x6 4 Instance ID; always 0
0xA 2 Connection count; always 0
0xC 4 Base property ID; always 0xFFFFFFFF
0x10 2 Base property size
0x12 2 Property count; 0x14 for Prime 2, 0x16 for Prime 3

Properties (Echoes)

These are all the properties a ScannableObjectInfo instance contains:

ID Type Name
0x2F5B6423 STRG Scan Text
0xC308A322 long Scan Speed (0 for fast, 1 for slow)
0x7B714814 bool Is Important? (0 for blue, 1 for red)
0x1733B1EC bool Use Logbook Model After Scan?
0x53336141 TXTR Post-Scan Override Texture
0x3DE0BA64 float Logbook Default X Rotation
0x2ADD6628 float Logbook Default Z Rotation
0xD0C15066 float Logbook Scale
0xB7ADC418 CMDL Logbook Model
0x15694EE1 AnimationParameters Logbook AnimSet
0x58F9FE99 AnimationParameters Unknown
0x1C5B4A3A ScanInfoSecondaryModel Secondary Model 1
0x8728A0EE ScanInfoSecondaryModel Secondary Model 2
0xF1CD99D3 ScanInfoSecondaryModel Secondary Model 3
0x6ABE7307 ScanInfoSecondaryModel Secondary Model 4
0x1C07EBA9 ScanInfoSecondaryModel Secondary Model 5
0x8774017D ScanInfoSecondaryModel Secondary Model 6
0xF1913840 ScanInfoSecondaryModel Secondary Model 7
0x6AE2D294 ScanInfoSecondaryModel Secondary Model 8
0x1CE2091C ScanInfoSecondaryModel Secondary Model 9

ScanInfoSecondaryModel

This struct is used to embed a resource that can be attached to the model in the logbook. The mesh can be either a model or an animset.

ID Type Name
0x1F7921BC CMDL Model
0xCDD202D1 AnimationParameters AnimSet
0x3EA2BED8 string Target Bone Name

Dependencies

After the ScannableObjectInfo instance, there's a list of the scan's dependencies present. The list follows the same format as the DGRP format.