Difference between revisions of "SA SCM"

From Grand Theft Wiki
Jump to: navigation, search
(added deleted info)
Line 1: Line 1:
 
A scm file is a binary file with certain structure. The common information about what this file is for can be found [[Mission_Scripting_(Overview)|here]]. The scm file structure looks like the following:
 
A scm file is a binary file with certain structure. The common information about what this file is for can be found [[Mission_Scripting_(Overview)|here]]. The scm file structure looks like the following:
 
+
====(02 00 01)h + 32 bit int    Jump to second segment
(02 00 01)h + 32 bit int    Jump to second segment
+
byte                        Padding
byte                        Padding
+
  (Global vars)              Space for variable saving
  (Global vars)              Space for variable saving
+
(02 00 01)h + 32 bit int    Jump to third segment
(02 00 01)h + 32 bit int    Jump to third segment
+
byte                        Segment id
byte                        Segment id
+
  32 bit int                Number of models
  32 bit int                Number of models
+
  (model names)              24 byte model names * number of models(model 0 not used)
  (model names)              24 byte model names * number of models(model 0 not used)
+
(02 00 01)h + 32 bit int    Jump to fourth segment
(02 00 01)h + 32 bit int    Jump to fourth segment
+
byte                        Segment id
byte                        Segment id
+
  32 bit int                MAIN size
  32 bit int                MAIN size
+
  32 bit int                Largest mission size
  32 bit int                Largest mission size
+
  32 bit int                Number of missions
  32 bit int                Number of missions
+
  32 bit int                Highest number of locals used in mission/exernal
  32 bit int                Highest number of locals used in mission/exernal
+
  (mission addresses)        32 bit addresses * number of missions
  (mission addresses)        32 bit addresses * number of missions
+
(02 00 01)h + 32 bit int    Jump to fifth segment
(02 00 01)h + 32 bit int    Jump to fifth segment
+
byte                        Segment id
byte                        Segment id
+
  32 bit int                Largest external size
  32 bit int                Largest external size
+
  32 bit int                Number of externals
  32 bit int                Number of externals
+
  (external data):          28 byte external data * number of externals
  (external data):          28 byte external data * number of externals
+
    20 bytes                Name of external
    20 bytes                Name of external
+
    32 bit int              Offset of external
    32 bit int              Offset of external
+
    32 bit int              Size of external
    32 bit int              Size of external
+
(02 00 01)h + 32 bit int    Jump to sixth segment
(02 00 01)h + 32 bit int    Jump to sixth segment
+
byte                        Segment id
byte                        Segment id
+
  32 bit int                (Unused)
  32 bit int                (Unused)
+
(02 00 01)h + 32 bit int    Jump to seventh segment
(02 00 01)h + 32 bit int    Jump to seventh segment
+
byte                        Segment id
byte                        Segment id
+
  32 bit int                Size of global var space
  32 bit int                Size of global var space
+
  32 bit int                (Unused)
  32 bit int                (Unused)
+
(MAIN code)                  MAIN section, equal to size defined earlier
(MAIN code)                  MAIN section, equal to size defined earlier
+
(mission code)              The mission data, missions stored at offsets defined earlier====
(mission code)              The mission data, missions stored at offsets defined earlier
+
  
 
{{stub}}
 
{{stub}}

Revision as of 02:08, 12 July 2010

A scm file is a binary file with certain structure. The common information about what this file is for can be found here. The scm file structure looks like the following: ====(02 00 01)h + 32 bit int Jump to second segment byte Padding

 (Global vars)              Space for variable saving

(02 00 01)h + 32 bit int Jump to third segment byte Segment id

 32 bit int                 Number of models
 (model names)              24 byte model names * number of models(model 0 not used)

(02 00 01)h + 32 bit int Jump to fourth segment byte Segment id

 32 bit int                 MAIN size
 32 bit int                 Largest mission size
 32 bit int                 Number of missions
 32 bit int                 Highest number of locals used in mission/exernal
 (mission addresses)        32 bit addresses * number of missions

(02 00 01)h + 32 bit int Jump to fifth segment byte Segment id

 32 bit int                 Largest external size
 32 bit int                 Number of externals
 (external data):           28 byte external data * number of externals
   20 bytes                 Name of external
   32 bit int               Offset of external
   32 bit int               Size of external

(02 00 01)h + 32 bit int Jump to sixth segment byte Segment id

 32 bit int                 (Unused)

(02 00 01)h + 32 bit int Jump to seventh segment byte Segment id

 32 bit int                 Size of global var space
 32 bit int                 (Unused)

(MAIN code) MAIN section, equal to size defined earlier (mission code) The mission data, missions stored at offsets defined earlier====

Copyrighted

This page is licensed under the GNU Free Documentation Licence. This page has a separate license to the CC-BY-SA that applies to most of Grand Theft Wiki.

The full text of the GNU FDL v1.2 is here. Click the "History" button to see the full list of authors. See Grand Theft Wiki:Copyright for more detail on our copyright policy.

GNU Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
See Grand Theft Wiki:Copyright for more information.