Difference between revisions of "LCS/VCS SCM"

From GTAMods Wiki
Jump to navigation Jump to search
m (moved LCS/VCS MAIN to LCS SCM)
m
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
   32 bit int                 MAIN size - 8
+
   32-bit int                   Main script size - 8
   32 bit int                 Largest mission size
+
   32-bit int                   Largest mission script size
  (02 00 06)h + 32 bit int    Jump to second segment - 8
+
  (02 00 06)h + 32-bit offset    '''GOTO''' next header chunk - 8
  byte                         Align (always 6Dh)
+
  byte                           Target game ('l' - Liberty for LCS{{ref|1}}, 'm' - Miami for VCS, unused at runtime)
   (global vars)             Space for variable saving
+
   (Global variable space)     Space for global variable storage{{ref|2}} (first global index is 2)
  (02 00 06)h + 32 bit int    Jump to third segment - 8
+
  (02 00 06)h + 32-bit offset    '''GOTO''' next header chunk - 8
  byte                         Align (always 0)
+
  byte                           Alignment (always 0, ignored)
   32 bit int                 Subsegments size
+
   32-bit int                   Number of save variables
   (data of 2 subsegments)    (1 byte value incrementing by 4 each time and 1 byte value incrementing by 1 each block) * (subsegments size * 2)
+
   (Saved variable indices)    2-byte variable index * number of save variables
   32 bit int                 Number of models
+
   32-bit int                   Number of used objects (at least 1)
   (model names)             24 byte model names * number of models (model 0 name is empty and therefore unused)
+
   (Used object array)         24-byte object name * number of used objects (first object name is empty and therefore unused)
  (02 00 06)h + 32 bit int    Jump to fourth segment - 8
+
  (02 00 06)h + 32-bit offset    '''GOTO''' main script space - 8 (third header chunk is compiled only in script multifile)
  byte                         Align (always 0)
+
  byte                           Alignment (always 0, ignored)
   32 bit int                 Unknown size
+
   16-bit int                  Number of true globals
   32 bit int                 Largest mission size
+
  16-bit int                   Most globals (higher number of global variables declared in a mission script)
   32 bit int                 Number of missions
+
   32-bit int                   Largest mission script size
   (mission addresses)       (32 bit addresses - 8) * number of missions
+
   16-bit int                  Number of mission scripts
  (MAIN code)                 MAIN section, equal to size defined earlier
+
  16-bit int                   Number of exclusive mission scripts
  (mission code)               The mission data, missions stored at offsets defined earlier
+
   (Multi script array)         (32-bit offset - 8) * number of mission scripts
 +
  (Main script space)           Space of main script (equal to size defined earlier)
 +
  (Mission scripts space)       Space of mission scripts (each one is stored at file offsets defined earlier)
 +
 
 +
{{note|1}} The script multifile of LCS v2 (PAL) on PSP platform is the only one which has been compiled in ''Liberty'' mode, the rest in ''Miami'' (likely a rough mistake);
 +
 
 +
{{note|2}} The global variable space includes true and most globals in this order.
 +
 
 +
== External links ==
 +
 
 +
* [https://pastebin.com/raw/UVEdixac GTA LCS Function Commands Implementation]
 +
 
 +
{{N|VCS|LCS}}
  
 
[[Category:Mission Script]] [[Category:File Formats]]
 
[[Category:Mission Script]] [[Category:File Formats]]

Latest revision as of 23:13, 12 January 2021

  32-bit int                   Main script size - 8
  32-bit int                   Largest mission script size
(02 00 06)h + 32-bit offset    GOTO next header chunk - 8
byte                           Target game ('l' - Liberty for LCS[1], 'm' - Miami for VCS, unused at runtime)
  (Global variable space)      Space for global variable storage[2] (first global index is 2)
(02 00 06)h + 32-bit offset    GOTO next header chunk - 8
byte                           Alignment (always 0, ignored)
  32-bit int                   Number of save variables
  (Saved variable indices)     2-byte variable index * number of save variables
  32-bit int                   Number of used objects (at least 1)
  (Used object array)          24-byte object name * number of used objects (first object name is empty and therefore unused)
(02 00 06)h + 32-bit offset    GOTO main script space - 8 (third header chunk is compiled only in script multifile)
byte                           Alignment (always 0, ignored)
  16-bit int                   Number of true globals
  16-bit int                   Most globals (higher number of global variables declared in a mission script)
  32-bit int                   Largest mission script size
  16-bit int                   Number of mission scripts
  16-bit int                   Number of exclusive mission scripts
  (Multi script array)         (32-bit offset - 8) * number of mission scripts
(Main script space)            Space of main script (equal to size defined earlier)
(Mission scripts space)        Space of mission scripts (each one is stored at file offsets defined earlier)

^ The script multifile of LCS v2 (PAL) on PSP platform is the only one which has been compiled in Liberty mode, the rest in Miami (likely a rough mistake);

^ The global variable space includes true and most globals in this order.

External links