Resource Keys
Unique References
Section titled “Unique References”Resource keys are comprised of 3 numbers, type, group, and instance.
Type- Acts like a file type.Group- Depends on resource, often unused and set to 0.Instance- A unique ID
When combined, these three fields are known as a Resource Key and act as a unique identifier for a resource. When writing a key, it is written using hex in the format Type:Group:Instance.
0x00B2D882:0x00000000:0x0AD03055DAB19FC70x015A1849:0x00852CE1:0xC813FB9262F7D81D
Override vs New Instance Important
Section titled “Override vs New Instance ”Resources Keys determine if a resource will override an existing resource, or create a completely new resource. You override resources by reusing an existing resource key. Let’s look at an example using an image.
Sims 4 icons are DDS images, which use type 0x00B2D882. Icons always use group 0. The Ambitious trait uses instance 0xE9210ACE5B40E587. Thus, adding a DDS image to a package with resource key 0x00B2D882:0x00000000:0xE9210ACE5B40E587 will override the Ambitious trait icon.
This mod overrides the Ambition trait icon.
Likewise, adding a DDS image with with a new instance will create a new resource that can be referenced by modded content. Unique instances are generated using FNV hashing, which will be discussed later.