ExcludePartFlags Information
Sept 1, 2017 21:28:55 GMT -5
orangemittens, jwofles, and 12 more like this
Post by brujah on Sept 1, 2017 21:28:55 GMT -5
This is an attempt to shed some light on how to figure out what parts are being excluded by what value with the ExcludePartFlags instance.
SimGuruModSquad gave this definition at thesims.com (see the full comment HERE)
Enum and Flag are programming terms. Click the words to learn more about them.
My attempt here is to drill down the exact values to use for this field. I hope I don't confuse anyone, but if I do, please comment on this thread and I will attempt to clarify.
ONWARD!
There are 16 binary sets of 4 bits (total of 64 bits) that correspond to a hexadecimal value (See Table 2) and 72 current parts that can be excluded (list updated and changed since that post was made). Each bit refers to a single part type. There is a second ExcludePartFlags field that is for the additional bits not able to fit in the first set. This field is used for the occult, teens, and future expansion exclusions.
On to the examples!
Example 1: the base game mascot outfit the ExcludePartFlags instance is 03FFFFFFFFFFFDCE. This excludes everything except the sim's head, hair and teeth... even the eyebrows and makeup get excluded with this one!
Table 1: Instance With Binary Positions
Example 2: the base game fisherman's outfit the ExcludePartFlags instance is 0000000000001100. This excludes the shoes and necklace.
You can see on these screenshots how the numbers work together (the leading zeros were dropped by the calculator)
Are you confused yet? Lets see if I can clear it up. In the comment by SimGuruModSquad they say "HAT is 1<<1, HAIR is 1<<2, HEAD is 1<<3, etc." this means shift the binary bit to the left, one, two, and three places respectively. Start at 0 which is at the far bottom right in the screenshots above. Since there is a zero value for NONE the next place to go is the second bit, 0010.
To explain this further, look at table 3 below to see the ENUM for the shoes, its 8.
Following the above bit shifting, this means to shift the binary bit 8 places to the left = 0001 0000 0000.
The ENUM for the necklace is 12, so shift 12 places = 0001 0000 0000 0000.
When you combine these two numbers it comes out to 0001 0001 0000 0000.
OMG I'M ADDING IN BINARY?!? Yes you are!
Binary Adding With an Example:
When adding in binary it isn't like "normal" math where 1+1=2, it's more like this: 1+1=0, 1+0=1, 0+1=1, and 0+0=0. Its either a 1 or a 0, no other number value.
For our purposes we will never have a 1+1 because, as I stated earlier, each bit is a separate part type.
Example: Take the hat, binary value of 0010, and add the hair (0100), head (1000), and teeth (0001 0000). (See Table 3 for the binary values)
0000 0010 HAT
0000 0100 HAIR
0000 1000 HEAD
+0001 0000 TEETH
0001 1110
Now convert that value to Hex: 0001 1110 = 1E (See Table 2 for the conversions)
Based on this conversion, the final instance to put in the ExcludePartFlags field is 000000000000001E (leading zeros are not required since studio will add them for you) to exclude the Hat, Head, Hair, and Teeth
You want more? OK!
Let's throw EARRINGS and FACIAL HAIR into the mix!
0000 0000 0000 0000 0000 0000 0000 0010 HAT
0000 0000 0000 0000 0000 0000 0000 0100 HAIR
0000 0000 0000 0000 0000 0000 0000 1000 HEAD
0000 0000 0000 0000 0000 0000 0001 0000 TEETH
0000 0000 0000 0000 0000 0100 0000 0000 EARRINGS
+0001 0000 0000 0000 0000 0000 0000 0000 FACIAL HAIR
0001 0000 0000 0000 0000 0100 0001 1110
Now convert that value to Hex: 0001 0000 0000 0000 0000 0100 0001 1110 = 1000041E
Now the final instance to put in the ExcludePartFlags field is 000000001000041E to exclude the Hat, Head, Hair, Teeth, Earrings, and Facial Hair
One More Example!
Let's do SHOES, SOCKS and TIGHTS this time.
0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 SHOES
0000 0000 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 SOCKS
+0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 TIGHTS
0100 0000 0010 0000 0000 0000 0000 0000 0000 0001 0000 0000
Now convert that value to Hex: 0100 0000 0010 0000 0000 0000 0000 0000 0000 0001 0000 0000 = 402000000100
Now the final instance to put in the ExcludePartFlags field is 0000402000000100 to exclude the Shoes, Socks and Tights
Screenshots for proof:
Starting Sim
Hat, Head, Hair, Teeth
Hat, Head, Hair, Teeth, Earrings, Facial Hair
Table 2: Hexadecimal/Binary Conversion
Table 3: Parts List and Enum/Binary Values (Yes, it's a really loooong list )
SimGuruModSquad gave this definition at thesims.com (see the full comment HERE)
... the exclude flags don't use these exactly as is. Since that particular field is a bit field, it converts the enum to flags that can be combined together by shifting by the enum value. i.e. HAT is 1<<1, HAIR is 1<<2, HEAD is 1<<3, etc.
Enum and Flag are programming terms. Click the words to learn more about them.
My attempt here is to drill down the exact values to use for this field. I hope I don't confuse anyone, but if I do, please comment on this thread and I will attempt to clarify.
ONWARD!
There are 16 binary sets of 4 bits (total of 64 bits) that correspond to a hexadecimal value (See Table 2) and 72 current parts that can be excluded (list updated and changed since that post was made). Each bit refers to a single part type. There is a second ExcludePartFlags field that is for the additional bits not able to fit in the first set. This field is used for the occult, teens, and future expansion exclusions.
On to the examples!
Example 1: the base game mascot outfit the ExcludePartFlags instance is 03FFFFFFFFFFFDCE. This excludes everything except the sim's head, hair and teeth... even the eyebrows and makeup get excluded with this one!
Table 1: Instance With Binary Positions
Instance broken down into 16 positions | 0 | 3 | F | F | F | F | F | F | F | F | F | F | F | D | C | E |
Binary broken down into 16 4 bit positions | 0000 | 0011 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1101 | 1100 | 1110 |
Example 2: the base game fisherman's outfit the ExcludePartFlags instance is 0000000000001100. This excludes the shoes and necklace.
You can see on these screenshots how the numbers work together (the leading zeros were dropped by the calculator)
Are you confused yet? Lets see if I can clear it up. In the comment by SimGuruModSquad they say "HAT is 1<<1, HAIR is 1<<2, HEAD is 1<<3, etc." this means shift the binary bit to the left, one, two, and three places respectively. Start at 0 which is at the far bottom right in the screenshots above. Since there is a zero value for NONE the next place to go is the second bit, 0010.
To explain this further, look at table 3 below to see the ENUM for the shoes, its 8.
Following the above bit shifting, this means to shift the binary bit 8 places to the left = 0001 0000 0000.
The ENUM for the necklace is 12, so shift 12 places = 0001 0000 0000 0000.
When you combine these two numbers it comes out to 0001 0001 0000 0000.
OMG I'M ADDING IN BINARY?!? Yes you are!
Binary Adding With an Example:
When adding in binary it isn't like "normal" math where 1+1=2, it's more like this: 1+1=0, 1+0=1, 0+1=1, and 0+0=0. Its either a 1 or a 0, no other number value.
For our purposes we will never have a 1+1 because, as I stated earlier, each bit is a separate part type.
Example: Take the hat, binary value of 0010, and add the hair (0100), head (1000), and teeth (0001 0000). (See Table 3 for the binary values)
0000 0010 HAT
0000 0100 HAIR
0000 1000 HEAD
+0001 0000 TEETH
0001 1110
Now convert that value to Hex: 0001 1110 = 1E (See Table 2 for the conversions)
Based on this conversion, the final instance to put in the ExcludePartFlags field is 000000000000001E (leading zeros are not required since studio will add them for you) to exclude the Hat, Head, Hair, and Teeth
You want more? OK!
Let's throw EARRINGS and FACIAL HAIR into the mix!
0000 0000 0000 0000 0000 0000 0000 0010 HAT
0000 0000 0000 0000 0000 0000 0000 0100 HAIR
0000 0000 0000 0000 0000 0000 0000 1000 HEAD
0000 0000 0000 0000 0000 0000 0001 0000 TEETH
0000 0000 0000 0000 0000 0100 0000 0000 EARRINGS
+0001 0000 0000 0000 0000 0000 0000 0000 FACIAL HAIR
0001 0000 0000 0000 0000 0100 0001 1110
Now convert that value to Hex: 0001 0000 0000 0000 0000 0100 0001 1110 = 1000041E
Now the final instance to put in the ExcludePartFlags field is 000000001000041E to exclude the Hat, Head, Hair, Teeth, Earrings, and Facial Hair
One More Example!
Let's do SHOES, SOCKS and TIGHTS this time.
0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 SHOES
0000 0000 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 SOCKS
+0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 TIGHTS
0100 0000 0010 0000 0000 0000 0000 0000 0000 0001 0000 0000
Now convert that value to Hex: 0100 0000 0010 0000 0000 0000 0000 0000 0000 0001 0000 0000 = 402000000100
Now the final instance to put in the ExcludePartFlags field is 0000402000000100 to exclude the Shoes, Socks and Tights
Screenshots for proof:
Starting Sim
Hat, Head, Hair, Teeth
Hat, Head, Hair, Teeth, Earrings, Facial Hair
Table 2: Hexadecimal/Binary Conversion
Hex Value | Binary 4 Bit Set |
0 | 0000 |
1 | 0001 |
2 | 0010 |
3 | 0011 |
4 | 0100 |
5 | 0101 |
6 | 0110 |
7 | 0111 |
8 | 1000 |
9 | 1001 |
A | 1010 |
B | 1011 |
C | 1100 |
D | 1101 |
E | 1110 |
F | 1111 |
Table 3: Parts List and Enum/Binary Values (Yes, it's a really loooong list )
Part to Exclude | Enum Value | Binary Value |
NONE | 0 | 0000 |
HAT | 1 | 0010 |
HAIR | 2 | 0100 |
HEAD | 3 | 1000 |
TEETH | 4 | 0001 0000 |
FULL_BODY | 5 | 0010 0000 |
UPPER_BODY | 6 | 0100 0000 |
LOWER_BODY | 7 | 1000 0000 |
SHOES | 8 | 0001 0000 0000 |
CUMMERBUND | 9 | 0010 0000 0000 |
EARRINGS | 10 | 0100 0000 0000 |
GLASSES | 11 | 1000 0000 0000 |
NECKLACE | 12 | 0001 0000 0000 0000 |
GLOVES | 13 | 0010 0000 0000 0000 |
WRIST_LEFT | 14 | 0100 0000 0000 0000 |
WRIST_RIGHT | 15 | 1000 0000 0000 0000 |
LIP_RING_LEFT | 16 | 0001 0000 0000 0000 0000 |
LIP_RING_RIGHT | 17 | 0010 0000 0000 0000 0000 |
NOSE_RING_LEFT | 18 | 0100 0000 0000 0000 0000 |
NOSE_RING_RIGHT | 19 | 1000 0000 0000 0000 0000 |
BROW_RING_LEFT | 20 | 0001 0000 0000 0000 0000 0000 |
BROW_RING_RIGHT | 21 | 0010 0000 0000 0000 0000 0000 |
INDEX_FINGER_LEFT | 22 | 0100 0000 0000 0000 0000 0000 |
INDEX_FINGER_RIGHT | 23 | 1000 0000 0000 0000 0000 0000 |
RING_FINGER_LEFT | 24 | 0001 0000 0000 0000 0000 0000 0000 |
RING_FINGER_RIGHT | 25 | 0010 0000 0000 0000 0000 0000 0000 |
MIDDLE_FINGER_LEFT | 26 | 0100 0000 0000 0000 0000 0000 0000 |
MIDDLE_FINGER_RIGHT | 27 | 1000 0000 0000 0000 0000 0000 0000 |
FACIAL_HAIR | 28 | 0001 0000 0000 0000 0000 0000 0000 0000 |
LIPS_TICK | 29 | 0010 0000 0000 0000 0000 0000 0000 0000 |
EYE_SHADOW | 30 | 0100 0000 0000 0000 0000 0000 0000 0000 |
EYE_LINER | 31 | 1000 0000 0000 0000 0000 0000 0000 0000 |
BLUSH | 32 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 |
FACEPAINT | 33 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 |
EYEBROWS | 34 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 |
EYECOLOR | 35 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 |
SOCKS | 36 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
MASCARA | 37 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_CREASE_FOREHEAD | 38 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_FRECKLES | 39 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_DIMPLE_LEFT | 40 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_DIMPLE_RIGHT | 41 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TIGHTS | 42 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_MOLE_LIP_LEFT | 43 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_MOLE_LIP_RIGHT | 44 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_ARM_LOWER_LEFT | 45 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_ARM_UPPER_LEFT | 46 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_ARM_LOWER_RIGHT | 47 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_ARM_UPPER_RIGHT | 48 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_LEG_LEFT | 49 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_LEG_RIGHT | 50 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_TORSO_BACK_LOWER | 51 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_TORSO_BACK_UPPER | 52 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_TORSO_FRONT_LOWER | 53 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TATTOO_TORSO_FRONT_UPPER | 54 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_MOLE_CHEEK_LEFT | 55 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_MOLE_CHEEK_RIGHT | 56 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKINDETAIL_CREASE_MOUTH | 57 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
SKIN_OVERLAY | 58 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
FUR_BODY | 59 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
EARS | 60 | 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
TAIL | 61 | 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
FUR_EARS | 62 | 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
FUR_TAIL | 63 | 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
ANYTHING AFTER THIS LINE WILL NOT FIT IN THE FIRST INSTANCE YOU START OVER WITH INSTANCING IN THE ExcludePartFlags2 FIELD | ||
OCCULT_BROW | 64 | 0001 |
OCCULT_EYE_SOCKET | 65 | 0010 |
OCCULT_EYE_LID | 66 | 0100 |
OCCULT_MOUTH | 67 | 1000 |
OCCULT_LEFT_CHEEK | 68 | 0001 0000 |
OCCULT_RIGHT_CHEEK | 69 | 0010 0000 |
OCCULT_NECK_SCAR | 70 | 0100 0000 |
FOREARM_SCAR | 71 | 1000 0000 |
ACNE | 72 | 0001 0000 0000 |