Change Outfit Globals
and Clothing Templates
Notes on the globals 0x029B "Clothes - Change Outfit - External Guid" and 0x039A "Clothes - Change Outfit - External Guid - Stack Object ID", and the related clothing templates.
Change Outfit Globals
Global 0x039A "Clothes - Change Outfit - External Guid - Stack Object ID" changes the outfit for the Sim whose OID is in the Stack Object to the clothing template of the GUID specified.
Global 0x029B "Clothes - Change Outfit - External Guid" is a simple wrapper for global 0x039A and places My Object ID into the Stack Object before the call to 0x039A
Both of these globals take FOUR parameters
Param0 is the outfit category (taken from global BCON 0x012A) that the clothing template replaces, for example, Casual 1, Swimwear, Underwear, etc. Should the clothing template fail to apply, the Sim will change into their default outfit for that category.
Param1 indicates if the Sim should NOT perform the spin animation - 0=do spin, 1=don't spin
Param2 is the lo-word of the GUID of the clothing template
Param3 is the hi-word of the GUID of the clothing template
For example, a clothing template with a GUID of 0x0089AD80, Param2 will be 0xAD80 and Param3 will be 0x0089
Clothing Templates
Clothing templates are simple objects of type "Outfit" (value 0x000E, OBJD entry 0x0009) - with a single OBJD/OBJf pair and a single Init BHAV. Just about any Maxis example - school uniform, career outfit, etc - can be used to obtain those three resources. There is also an empty template here
Clothing templates REQUIRE a unique GUID, so don't forget to change it.
In addition to the three basic resources, a clothing template has one or more paired AGED/3IDR resources. These resources MUST be in the same group as the OBJD resource, and they are paired by having the same instance numbers as each other.
You can have as many AGED/3IDR pairs as you require, for school uniforms you would typically have four (CF/CM/TF/TM) while for bath towels you may have ten (CF/CM/TF/TM/YAF/YAM/AF/AM/EF/EM) or for a sority uniform only one (YAF).
Each AGED/3IDR pair references one (or more) GZPS property sets. In addition to getting everything hooked up correctly as a scenegraph chain, there are other values that MUST agree - some more obvious than others.
AGED:age MUST include the ages allowed in the referenced GZPS:age - so Adult (0x08) can reference YA/Adult (0x48) but not Teen (0x04) - see here for values
AGED:gender MUST include the genders allowed in the referenced GZPS:gender - so Female (0x01) can reference Unisex (0x03) but not Male (0x02) - see here for values
LK values (eg lk0) are the non-obvious ones. These are stored as a string but are actually numbers. (Why Maxis, why?) What's more, while they are stored as decimal numbers, they are actually 8-digit hex numbers holding two distinct values! (What were you smoking that day Maxoid?) So the "string" 33554440 is the hex number 0x02000008 (MS-Calculator in Programmer mode is your friend here) which represents the two values 0x0200 (hi-word) and 0x0008 (lo-word)
The lo-word (0x0008) indicates which part of the Sim the referenced GZPS is applied to - body, top, bottom, hair, etc - see here for details
The hi-word (0x0200) is the clothing category (see here for details) that this reference applies to. It must include the outfit type in the referenced GZPS:category.
Example 1: The outfit in the GZPS is "formal" (0x0020). The lo-word of the LK value must also be 0x0020, and then the "formal" category value (0x0004) can be passed as Param0 to either of the change outfit globals.
Example 2: The outfit in the GZPS is for both "underwear" and "sleepwear" (0x0050). If the lo-word of the LK value is also 0x0050, then either the "underwear" category value (0x000B) or the "Pajamas" category value (0x0005)can be passed as Param0 to either of the change outfit globals. However, if the LK value is 0x0040, then ONLY the underwear category value (0x000B) can be passed in Param0. If the "pajamas" value is passed, the Sim will change into their default PJs and NOT the clothing item referenced via the AGED resource.
Trouble Shooting
If the Sim flatly refuses to change into the outfit make sure that the category being passed as Param0 is given in the associated AGED resource's LK value lo-word AND that the linked GZPS resource includes that category. Note that some ages do not normally have certain outfit types (eg children do not have sportswear), so if trying to change a child into a specific sportswear item, make sure the GZPS resource has been categorized as 0x0207 - "Activewear" and "Everyday".
Credits
Hope these notes are of use to someone. Enjoy!