Someone requested I explain how to add interactions to traits. I figured this would be a good place to do it. This entry will be more of a tutorial explanation.
Adding Interactions to TraitsI will include code samples for different types of interactions below. Generally, at the most basic level, if you have a trait set up with a trait buff attached to it, you can add interactions to the trait buff and they will show up for the sim who has the trait, provided they pass any restrictions within the interaction itself (ex: if the interaction requires the sim to be CHILD age and the trait owner is ADULT, they won't see the interaction, even if it's added to them through a trait).
General factors to remember, to make sure an interaction shows up as intended:
1) It's added in the trait buff and the sim has the trait.
2) The situation for using it passes the requirements in the interaction itself.
3) It's applied in the right spot and you're looking for it in the right place. (More on this with reference to Types below.)
Types of InteractionsNote: I'm referring to 's' and 'hash' interchangeably. They are the same thing.
Target Self (Super Interaction): For this, you would use syntax like the following, within a buff attached to a trait.
's', or 'hash' value here
's', or 'hash' value here
's', or 'hash' value here
This type of interaction will be added to the sim who has the trait and, if I recall correctly, it will also be added to sims who you target with a sim who has the trait. That's why you need a special line in the test_globals within the interactions themselves.
That line is:
True
This means the interaction will only show up on the sim with the trait, instead of showing up on the sim who has the trait AND sims you target from a sim who has the trait.
Target Another Sim (Super Interaction): For this, you would use syntax like the following, within a buff attached to a trait. Slight syntax difference from the first one.
's', or 'hash' value here
's', or 'hash' value here
's', or 'hash' value here
And with this one, you'll want the following within the interactions themselves, in test_globals:
False
Target Terrain, aka: Target the ground (Super Interaction): This one and object are virtually the same as the last one, just with some additions.
's', or 'hash' value here
's', or 'hash' value here
's', or 'hash' value here
Target an Object (Super Interaction): This one requires a bit more explanation. First, a sample.
's', or 'hash' value here
Func_Table
Func_Chair
's', or 'hash' value here
Func_Puddle
's', or 'hash' value here
Func_DoubleBed
Func_SingleBed
Breaking down what these do... the first interaction is added to all tables and chairs. The second is added to all puddle objects. And the third is added to all beds that count as double or single (toddlers have their own tag, so they are excluded).
Adding stuff to objects is somewhat murky ground for what I've done. As far as I can tell, it'll probably add the interaction properly if you use a tag that starts with Func_ (you can find all of the game tags in the tag XML game file). In some cases, it may not work. For example, when I was switching over to mostly adding interactions through the trait for the Sorcerer mod, I couldn't find a tag that would add to Fire objects, so I did that part through a script, as before.
Target Another Sim (Social Mixer Interaction): Say you want to add an interaction like "Get to Know" or "Talk About Cooking." This one is your go to.
EDIT (9/10/17): Correction. I had assumed that multiple actor_mixers would be laid out as follows. I assumed wrong. Apparently, you can just do
and then in the 's, you can put multiple of them, i.e.
CORRECTED version:
13998
's', or 'hash' value here
's', or 'hash' value here
's', or 'hash' value here
OLD version:
13998
's', or 'hash' value here
13998
's', or 'hash' value here
13998
's', or 'hash' value here
Note that what you add here should be a SocialMixer interaction. If you put a SuperInteraction here, it will probably give you an error. Also worth noting that because it's a SocialMixer, you don't need the identity check part. The game takes care of that for you. You do need the sim_Chat thing that's appended to it though... that ensures that your sim is placed into the base conversation state sim_Chat with the targeted sim, which will enable your SocialMixer interaction to go off properly.
EDIT (9/10/17): Also, if the TDESC is any indication, actor_mixers can probably be a MixerInteraction too, though I haven't seen examples of how a regular MixerInteraction would be structured in syntax.
Trait Idle (Mixer Interaction): Sometimes you might want to create a special idle animation tied to a trait. For that, you would do:
's', or 'hash' value here
3
If you're wondering how to make a Mixer for an idle animation, that's a whole other explanation. Your easiest path there is to: 1) Copy the format of an existing idle (such as the Vampire one) and 2) Be careful about what animation you use, as some might cause stalling issues in certain scenarios, or with certain interactions.
Putting It All Together
Here's some raw sample code, showing a trait buff with an example of each one within it (this uses parts of the current Sorcerer trait buff as an example, but doesn't include all of it... it'd be a lot to look through if I included all of it, so I've cut out all but one of each variation to show them off specifically):
13998
17437340195943479714
39b2aa4a:00000000:8af8b916cf64c646
39b2aa4a:00000000:3bf33216a25546ea
1085692155939061563
3
2f7d0004:00000000:30f0846c783606f9
True
0
1
False
13207307475727282152
11269757060309766408
17565522103389469685
11743375531349896997
Func_Table
Func_Chair
If you have questions, feel free to ask and I will try to answer to the best of my ability.