DLC Support
The Problem
GTA V identifies clothing items by a global drawable index (e.g., drawable = 15 for component 3). When Rockstar adds new DLC clothing packs, these global indices can shift, causing saved outfits to point to different items than what was originally saved.
The Solution
illenium-appearance stores DLC collection data alongside the global drawable index. When loading a saved outfit, it resolves the collection + local index back to the correct global index, regardless of what DLCs have been added since.
How It Works
Saving (Reading from Ped)
When reading a ped’s appearance, the resource captures:
- Global drawable index - The standard
drawablefield (always saved for backward compatibility) - DLC collection hash - Identifies which clothing pack the item belongs to
- DLC local index - The item’s position within that specific collection
-- Stored in each component/prop/hair entry:
{
drawable = 15, -- Global index (may shift with DLC updates)
dlc_collection = 0xABCDEF12, -- Collection hash (stable)
dlc_localIndex = 5, -- Index within collection (stable)
}Loading (Applying to Ped)
When applying saved outfits, the resource uses two different code paths:
- Collection-based (
SetPedCollectionComponentVariation) - Used whendlc_collectionanddlc_localIndexare present. This resolves to the correct current global index. - Global index fallback (
SetPedComponentVariation) - Used for legacy saves without collection data, or base-game items.
NUI Live Preview
When the player scrolls through items in the customization menu, the NUI always sends global drawable indices. Single-item setters (setPedComponent, setPedProp, setPedHair) always use SetPedComponentVariation with global indices. This ensures smooth live preview.
Collection-based setting is only used when loading from saved data (bulk setters: setPedComponents, setPedProps, setPedHairFromSaved).
Backward Compatibility
| Scenario | Behavior |
|---|---|
| Old save, new code | Missing dlc_collection fields - falls back to global drawable index |
| New save, old code | Extra dlc_collection fields are ignored - only drawable/texture read |
| Gradual migration | Outfits get collection data when re-saved by players |
Natives Used
| Native | Purpose |
|---|---|
GetPedDrawableVariationCollectionName | Read collection hash from current ped state |
GetPedDrawableVariationCollectionLocalIndex | Read local index within collection |
SetPedCollectionComponentVariation | Set component by collection + local index |
GetPedPropCollectionName | Read prop collection hash |
GetPedPropCollectionLocalIndex | Read prop local index |
SetPedCollectionPropIndex | Set prop by collection + local index |