Difference between revisions of "User Data PLG (RW Section)"

From GTAMods Wiki
Jump to navigation Jump to search
(User data needs to have documentation, so adding a page.)
 
Line 1: Line 1:
 
{{RW Section|User Data PLG|0x011F}}
 
{{RW Section|User Data PLG|0x011F}}
Custom data through the User Data extension (part of the Toolkit extensions) can be used to attach certain effects such as custom renderstates, morph data or other effects read by a function implemented into any of the GTA games..
 
  
== Structure ==
+
Custom data through the User Data extension (part of the Toolkit extensions) can be used to attach certain effects such as custom render states, morph data or other effects read by a function implemented into any of the GTA games. User data is organized as a dictionary, where a unique name maps to an array of objects.
  struct RpUserDataFormat
+
 
  {
+
== Binary Layout ==
     uint32 NumberOfSections;
+
 
     uint32 StringLength;
+
The first four bytes of the sections' content store the number of entries of the dictionary.
    string DataName;
+
 
    uint32 Format;
+
4b - DWORD    - Number of dictionary entries
    uint32 NumberofElements;
+
 
     void* Parameters;
+
This value is then followed by a set of structures, where each one stores one entry of the dictionary.
  };
+
 
 +
  Xb - TString  - Entry name (see [[#String Layout|below]] for a description of the binary string format)
 +
4b - DWORD     - User data type
 +
4b - DWORD     - Number of objects
 +
 
 +
This entry description is then followed by the actual array of elements stored under the entry name. Each array has a base data type.
 +
 
 +
=== User Data Types ===
 +
 
 +
The data type identifies one of the following values:
 +
 
 +
0x01 - Integer (signed 32 bit integer)
 +
0x02 - Float (32 bit single precision floating point value)
 +
0x03 - String (see below)
 +
 
 +
==== String Layout ====
 +
 
 +
Strings are not (null-)terminated, but rather stored with a length value, followed by the actual string:
 +
 
 +
4b - DWORD     - String length (X)
 +
  Xb - CHAR[X]  - String character field
  
 
== See also ==
 
== See also ==

Revision as of 11:10, 7 September 2020

{{{NAME}}}
RenderWare Stream Section
Vendor {{{VENDORNAME}}}
Module {{{MODULENAME}}}
Module ID 0x{{{MODULEID}}}
Identifier 0x{{{IDENTIFIER}}}
Chunk ID 0x{{{MODULEID}}}{{{IDENTIFIER}}}
Versions All
Hierarchy
Parents:
None
Children:
None
Extensions:
None
File Format

Custom data through the User Data extension (part of the Toolkit extensions) can be used to attach certain effects such as custom render states, morph data or other effects read by a function implemented into any of the GTA games. User data is organized as a dictionary, where a unique name maps to an array of objects.

Binary Layout

The first four bytes of the sections' content store the number of entries of the dictionary.

4b  - DWORD    - Number of dictionary entries

This value is then followed by a set of structures, where each one stores one entry of the dictionary.

Xb - TString   - Entry name (see below for a description of the binary string format)
4b - DWORD     - User data type
4b - DWORD     - Number of objects

This entry description is then followed by the actual array of elements stored under the entry name. Each array has a base data type.

User Data Types

The data type identifies one of the following values:

0x01 - Integer (signed 32 bit integer)
0x02 - Float (32 bit single precision floating point value)
0x03 - String (see below)

String Layout

Strings are not (null-)terminated, but rather stored with a length value, followed by the actual string:

4b - DWORD     - String length (X)
Xb - CHAR[X]   - String character field

See also