Tutorial 101: Immediate Interactions with Mod Constructor
Added 2021-05-16 10:55:01 +0000 UTCHi guys! So, today the weather is nice and my joints are more bearable, so I decided to sit on the computer and write another quick tutorial. Today we will learn how to create immediate interactions (you know when you press on an object or a sim and have some options). For this tutorial I decided to create a simple interaction that removes the clumsy trait from a sim that has it, so let's get started!
We will open the Mod Constructor, go on add element and under the advance category you will see Immediate Interaction.

On the bottom where it says element name you can rename it, something like the name of the interaction so it will be easy for you to keep a track to your interactions and know what is what. I named mine remove trait.
After we add it, we open add component and start adding what we need. In my case as you can see below I added everything from the general menu. Due to the type of interaction we make, we need global test, however the tooltip is optional. i personally like to add them on immediate interactions for extra clarification for the players. Then we go on outcomes you're gonna see only one option there - single outcome, you need to add it as well. And then we move to accessibility.

Now, if you are like me, the first thing that might cross your mind is: "Hmm .. Active Sim, this should be what I need, so the interaction will show up on my Sim when I press on them." Well, yes, but no .. You actually need add to objects, it took me a little time to figure it out.

So after you add this, you are all set to start crafting your immediate interaction. Once you close the add components section, you should see this.

On the bottom it will be your add to objects, it looks like this (see below), you don't need to write anything there, the ID number is the one of your Sim. Now let's get back to the top and open the global test condition value.

Since we want to remove the clumsy trait, our test condition will be this trait. We go to add component -> trait test. Then for participant we add the actor, since this is who we test, and then in the whitelist we will add our trait. Reference type -> Game Reference Instance ID -> Personality Traits -> Clumsy Trait

That's it, our test is all set, now back to the interaction. We add the name of the interaction, the tooltip text (if we have), we choose a pie menu (I left mine Actions) and we add image.

Now we are almost done, just we need to add the actual function and we are all set. We go on outcome under loot we add a new one. Then we open the value element.

We go on add compinents -> Trait Actions -> Remove Trait.

For remove trait since we use a refenrece from the game, we chose game reference and add the trait we want to remove, now if you have a custom trait in this project and you want to remove it, you need to choose instead existing element.

You see we also have a test condition set here, but we leave it like this, we don't add anything here (I'm gonna return on this later to explain). So, we are all set, now we can save our interaction and test it in game.
For the puropse of testing I created a new sim.

And as you can see below, we have the interaction and once exectuted the trait is removed.


Now since our Sim doesn't have the trait anymore, when you press on them you won't see the Action menu anymore (at least in my case). If you have custom content that adds interactions to the Action menu you will still see it, but if you open it, our interaction will be gone. Why? Because we have a global test condition. The test we added earlier was for the interaction as a whole.

Now let's return and remove the global test, and instead add exactly the same test, but in the outcome option.

So what's the difference? Once we open the game we will see the interaction, we can execute it, and once it's gone the trait we will see this.

Basically, you will still see the interaction, even if you don't need to use it, since your Sim doesn't have the trait. This test condition tests only the outcome, therefore you will have an outcome (remove the trait) only if you have it. While in the first case, not only you will remove the trait only if you have it, but also, you won't see the interaction, if your Sim doesn't have the trait.
It's important to know the difference because in some situations you will need to use different test conditions, in our case we had to use the global test because without the clumsy trait the interaction is pointless and will add unnecessary clutter to your menus. And btw i am not saying you need to choose, because depending on how complicated your mod is in a lot of cases you will end up using a global test and another tests on your outcomes, especially if you have multiple outcomes.
Okay, so i hope this tutorial was useful, as always feel free to hit me up if you are confused and have questions, and also i added a zip file with the tutorial examples, if you want to look at them and the photos on bigger screen.
Have a nice day!
Mirai M ~