User Data PLG (RW Section)

From GTAMods Wiki
Jump to navigation Jump to search
User Data PLG
RenderWare Stream Section
Vendor Criterion Games
Module Toolkit
Module ID 0x000001
Identifier 0x1F
Chunk ID 0x0000011F
Versions All
Atomic (Extension), Material (Extension), Reflection Material (Extension), Specular Material (Extension), UV Animation PLG (Extension), Texture (Extension), Geometry List (Extension)
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 is identified by 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