Andirz.com

1. What a trait actually does

At its simplest, a trait is a persistent or semi-persistent marker attached to a Sim. Other systems can check whether that marker is present and react accordingly. Traits are used for much more than CAS personality: preferences, lifestyles, fears, hidden gameplay flags, rewards, degrees, phone customization and many feature-specific states are all represented through Trait tuning.

Depending on the subsystem, the same Trait resource can serve several roles at once:

  • classify a Sim inside a particular gameplay system;
  • attach ongoing effects through one or more buffs;
  • participate in statistics, commodities, modifiers or event-driven actions;
  • act as a durable marker that tests can query later.

A trait therefore does not have to do something continuously. Sometimes the most important thing about it is simply that it exists on the Sim.

Use the live reference table.
The Traits Overview is generated from the site's current game data and lets you filter traits by type, full tuning name and ID.

2. Trait types

The trait_type field classifies a trait for game systems and UI. The list below is generated from the current extracted game data.

Trait typeWhat it is used for
AGENT Career-agency membership markers used by acting and freelancer systems to remember which agency or service branch a Sim belongs to.
ASPIRATION Aspiration bonus and reward traits granted by aspiration tracks and then used as permanent capabilities, modifiers or achievement markers.
BATUU_ALIEN Journey to Batuu alien/archetype markers used for Batuu species presentation, outfits and feature-specific checks.
CHILD_REWARD Reward traits earned through childhood systems and retained as longer-term bonuses or progression markers.
CURSE Realm of Magic curse traits. Each one represents a specific magical curse that can be tested, removed or used to drive related effects.
DISLIKE Negative preference traits, including dislikes and turn-offs. The preference system interprets these as things a Sim avoids, dislikes or finds unattractive.
FEAR Fear-system traits representing a specific fear. Wants, reactions, tests and fear-resolution logic can query them.
GAMEPLAY General gameplay or reward traits used for capabilities, rewards and feature state when no narrower trait category is required.
GAMEPLAY_GENERIC Feature-level state markers used by systems such as infant and toddler gameplay to record concrete behaviors, quirks or developmental elements.
GAMEPLAY_OBJECT_PREFERENCE Object/food preference traits used by gameplay systems to remember how a Sim responds to a particular object or food choice, such as infant food preferences.
GENDER_OPTIONS Gender and sexual-orientation option traits used to store attraction or WooHoo-interest configuration that other systems can query.
GHOST Ghost/death-state traits used to identify a ghost's death-related state or special ghost origin and to drive ghost-specific behavior.
HIDDEN Internal saved-state flags not intended as ordinary player-facing traits. They often remember that an event happened, a role applies or a branch of content has been reached.
HIGH_SCHOOL High School Years education-status traits recording outcomes such as graduation, early graduation, dropout or related school progression states.
HORSE_ACCOLADE Horse competition accolade traits recording placements and achievements from equestrian competitions.
INFANT_CARRIER Infant carrier preference traits used to remember a preferred carrier style/color for infant-carrying gameplay.
INFECTION StrangerVille infection-state traits used by the infection system to mark Sims affected by the Mother Plant storyline.
LIFESTYLE Snowy Escape Lifestyle traits representing an established lifestyle and connecting that lifestyle to its reactions, autonomy and effects.
LIKE Positive preference traits, including likes and turn-ons. The preference system interprets these as things a Sim enjoys or finds attractive.
MASTERY_PERK Mastery-perk traits granted by dedicated progression systems to record that a specific perk or advanced capability has been unlocked.
PACK_FRIEND Werewolf pack relationship-status traits representing Sims who are recognized as friends/allies of a particular pack without being full members.
PACK_MEMBER Werewolf pack membership traits identifying which pack a werewolf belongs to and enabling pack-specific rules and progression.
PERSONALITY Standard personality/CAS-style traits describing relatively stable aspects of a Sim and intended for normal player-facing trait UI.
PHASE Temporary developmental or feature phases, such as childhood phases, where a trait marks the Sim's current phase until it changes or expires.
PROFESSOR University professor-role traits used to assign and identify NPC professors for particular courses or subject areas.
ROBOT Servo/robot identity traits that mark a Sim as a humanoid robot and connect it to robot-specific gameplay.
ROBOT_MODULE Active Servo behavior-module traits representing modules currently installed or enabled on a robot.
ROBOT_MODULE_LOCKED Servo module unlock-state traits used to mark behavior modules that are still locked or to gate their later availability.
ROOMMATE Discover University roommate quirk/role traits used to give roommate NPCs persistent behavioral tendencies and special reactions.
SIM_PHONE Phone customization traits recording the selected phone color, pattern or design.
TAILSTYLE Tail-style traits used by species/occult presentation systems to store which tail pose or style variant is currently selected.
TEMPERAMENT Werewolf temperament traits representing persistent temperament tendencies that influence fury, behavior and werewolf-specific reactions.
UNIVERSITY_DEGREE University degree and honors-status traits recording which degree qualification a Sim has earned.
WALKSTYLE Walkstyle traits that select or unlock a specific locomotion style for a Sim.
Best practiceDo not choose a trait type because its name merely sounds appropriate. Find an EA trait from the same subsystem and compare its complete tuning.

3. Fields shared by Trait resources

Trait is the base tuning class. Personality traits, hidden markers, degree traits and many other trait families reuse its core fields, although each resource only includes the fields it actually needs.

agesLimits the trait to selected age groups.
trait_typeClassifies the trait for the relevant game system and UI.
display_nameLocalized STBL reference for the player-facing trait name.
display_name_gender_neutralOptional separate localized display-name string used by traits that provide a gender-neutral name.
trait_descriptionLocalized STBL reference for the trait description.
trait_origin_descriptionOptional localized text explaining how the trait was acquired.
iconResource reference to the UI icon.
buffsBuffs attached while the trait is present. These often carry the trait's continuous gameplay effects.
buffs_add_on_spawn_onlyControls whether attached trait buffs are added only when the Sim is spawned. Not every trait uses this field.
buff_replacementsReplaces an incoming buff while the trait is present.
conflicting_traitsLists traits that cannot coexist with this trait.
actor_mixersAdds mixer interactions through an existing interaction key.
provided_mixersProvides mixer interactions through a separate trait mechanism.
super_affordancesAdds top-level interactions while the trait is present.
target_super_affordancesAdds affordances that can be offered when this Sim is used as a target.
tagsTags used by UI and gameplay systems to group and identify the trait.
cas_trait_asm_paramCAS animation-state-machine parameter used by some CAS-visible traits.
min_lod_valueMinimum Sim LOD at which the trait should remain active or available.
speciesSpecies restrictions when the trait is not universally valid.
whim_setOptional reference connecting the trait to a whim/want set.
loot_on_trait_addRuns loot actions when the trait is added.

Not every Trait resource should contain every base field. A hidden marker can be extremely small, while a personality or degree trait may be much richer. Compare against an EA trait from the same subsystem instead of filling fields merely because they exist on the base class.

4. Core buffs and other behavior

Many traits attach one or more buffs for as long as the trait is equipped. Modders commonly call these core buffs or trait buffs.

Trait present
  → attached/core buff active
  → modifiers, interactions and other ongoing effects become active

Traits can also change gameplay through buff replacements, interaction provisioning, statistics/commodities, event-driven loot, or simply by existing as markers that tests can check.

Follow the references.
If a trait obviously changes gameplay but its XML looks sparse, inspect its referenced buffs and interactions before assuming the behavior lives in Python. See Buffs, Moodlets & Moods and Actions, Loot & Outcomes.

5. Preferences are a specialized trait family

Preference is a subclass of Trait. It inherits the base trait fields described above and adds fields used specifically by the preferences system. A preference tuning therefore uses c="Preference" i="trait", not the ordinary c="Trait" class.

preference_itemLinks the preference trait to its corresponding PreferenceItem tuning.
persistableControls whether the preference state is saved. This field belongs to the specialized Preference class and should not be presented as a general Trait field.
bb_filter_tagsConnects relevant object or décor preferences to Build/Buy filter tags.
Do not copy Preference-only fields into a normal trait.
Start with an EA resource that uses the same class and subsystem: Trait for ordinary traits, Preference for likes, dislikes, turn-ons and turn-offs.

Like / Dislike

trait_SimPreference_Likes_Decor_Cute
trait_SimPreference_Dislikes_Decor_Cute

Turn On / Turn Off

trait_Attraction_Characteristics_Funny_TurnOn
trait_Attraction_Characteristics_Funny_TurnOff

In both pairs, the subject stays the same and only the positive/negative state changes. Preference logic can therefore use familiar trait operations: add, remove, or test for the relevant trait.

Cross-reference
Use the Preferences Overview to inspect preference, attraction and attribute entries and their exact IDs.

6. Marker-only traits

A trait does not need a name, description, buff or visible UI. Marker-only traits store internal state that other tuning can test later.

State/event happens
  → hidden trait is present
Later test
  → checks that trait
  → different behavior becomes available

7. Trait IDs and SimData

Custom traits should use a 32-bit FNV hash (FNV32) for the tuning ID / Instance rather than FNV64. Their matching SimData must use the same Instance.

The XML root stores the tuning ID as a decimal number in s="...", while package/resource views generally show the Instance in hexadecimal. These are two representations of the same integer.

For the complete explanation of who creates the ID, how to generate it in Sims 4 Studio, and where decimal vs hexadecimal are used, see What Is Tuning? → IDs, comments and references.

Trait Tuning Instance  = 00000000:A1B2C3D4
Trait SimData Instance = 00000000:A1B2C3D4
                          └── same Instance
Trait creation rule
Keep the Trait tuning and its matching SimData together. If you change the Trait Instance, update the SimData Instance to match.

8. Real Trait XML example

The following shortened example uses EA’s trait_Unflirty resource. It keeps the real values needed to demonstrate the structure while omitting unrelated fields.

<I c="Trait" i="trait" m="traits.traits" n="trait_Unflirty" s="132589">
  <L n="actor_mixers">
    <U>
      <T n="key">13998<!--sim_Chat--></T>
      <L n="value">
        <T>132632<!--mixer_social_UnflirtyTrait_GiveColdShoulder_Targeted_Mean_AlwaysOn--></T>
        <T>132633<!--mixer_social_UnflirtyTrait_ReprimandPublicIntimacy_Targeted_Mean_AlwaysOn--></T>
      </L>
    </U>
  </L>
  <L n="ages">
    <E>TEEN</E>
    <E>ADULT</E>
    <E>ELDER</E>
    <E>YOUNGADULT</E>
  </L>
  <L n="buffs">
    <U>
      <T n="buff_type">132584<!--Buff_Trait_Unflirty--></T>
    </U>
  </L>
  <T n="cas_trait_asm_param">Unflirty</T>
  <L n="conflicting_traits">
    <T>27454<!--Trait_Romantic--></T>
    <T>361564<!--trait_RomanticallyReserved--></T>
    <T>362090<!--trait_LoveStruck--></T>
  </L>
  <T n="display_name">0x9A0E446B<!--Unflirty--></T>
  <T n="display_name_gender_neutral">0xD38C8E01<!--Unflirty--></T>
  <T n="icon" p="InEP03\UI\Icons\Traits\trait_Unflirty.png">2f7d0004:00000000:42e4e5e4fd94f29d</T>
  <E n="min_lod_value">MINIMUM</E>
  <L n="tags">
    <E>TraitPersonality</E>
    <E>TraitGroup_Emotional</E>
  </L>
  <T n="trait_description">0x2BE2E216<!--These Sims get Tense around Flirty Sims and seldom get Flirty themselves. It's difficult for them to be Romantic in public.--></T>
  <E n="trait_type">PERSONALITY</E>
  <V n="whim_set" t="enabled">
    <T n="enabled">132586<!--whimset_HasTraitUnflirty--></T>
  </V>
</I>

This one real trait demonstrates several important layers at once:

  • s="132589" is the tuning ID in decimal form;
  • ages limits eligibility;
  • buffs attaches a core buff;
  • conflicting_traits prevents incompatible personality traits;
  • display_name, display_name_gender_neutral and trait_description point to STBL strings;
  • icon references the UI image;
  • actor_mixers gives the trait its own social mixer interactions;
  • tags identifies the trait as a personality/emotional trait for related systems;
  • whim_set connects the trait to a want/whim set;
  • trait_type classifies it as PERSONALITY.
Related reading
If I, E, L, U, V and T are unfamiliar, see What Is Tuning?. For localized strings, see STBL & Localization.

Quick reference

Trait feature Why it matters
Trait type Connects the trait to the correct game subsystem
FNV32 Instance Custom traits should use a 32-bit tuning ID
SimData Companion resource whose Instance must match the Trait tuning
Display name / description Player-facing localized text
Core buff(s) Continuous gameplay effects while the trait is present
Conflicting traits Prevents incompatible trait combinations
Mixers / affordances Adds interactions through the trait
Buff replacements Substitutes one buff for another while the trait is present
Loot on add Runs actions when the trait is granted
Marker-only use Stores state for later tests
Preferences Specialized Trait resources for likes, dislikes and attraction systems