TUTORIAL - Loots (Actions) (Patreon)
Content
We didn't get into loots in the Constructor tutorials (yet!) but we met them when talking about buffs and commodities and, trust me on this, we're going to meet them all time in our modding career. We technically don't need them to make a simple personality trait, but at some point, we're going to need them... because loots are everywhere in Maxis tuning, they're a basic of the game mechanics, they're inside buffs, traits, interactions, commodities, other loots, objects tuning... they're everywhere.
Loots are another thing that can do a LOT of stuff:
They go from giving the sims a simple buff to start fires. When something happens in the game, that's a loot running.
There are two types of loots: regular loots and randomWeightedLoots, they're different.
Let's start by looking at a simple loot, and proceed to something more complicated:
Simple and nice loot that gives the Actor sim (the one performing an interaction) a buff. That's all this loot does.
It comes from the interaction:
View Flirty Work. It's the outcome (the result) of said interaction. When a sim goes and View a Flirty work, the result of that is this loot running, and giving the sim a flirty buff.
The action called is "buff", the action performed is "buff", the buff given is the one with tuning ID 12711 ( Buff_View_Flirty ), the reason this buff is given is that the sim is viewing art, the participant of the action is the Actor.
Let's move into something more complicated:
This loot performs two actions, it gives buffs too, but it gives two of them, one to the Actor and one to the TargetSim. This comes from the interaction:
Cozy Up at Bonfire, not as an outcome, but as a conditional_action based on time, somewhere between 20 minutes to 30 minutes after the interaction is running, this interaction is going to call the loot, that is going to give a flirty buff both to the Actor (the sim who started the interaction) and to the TargetSim (the sim who is the target of the interaction) basically both to the sim you directed (or who started the interaction autonomously) to cozy up and to the sim you targeted for that interaction.
At least one of this loots is going to run when a Romantic interaction is performed, depending to the strength that interaction has: how much is going to bring up or down the romance bar
This loot does just this: gives 10 points between the Actor and the Listeners (the target of the interaction) in the relationship track Romantic (10 points in the pink bar) IF the relationship between the two sims is less than -40, if not this action is not performed:
So maybe.... the second one in the loot will be, 6 points in the same track, if the relationship is between -40 and 0... if the sims don't meet this requisite, either:
Then maybe they will meet this one... and get 4 points if the relationship is between 0 and 20... if not, there are other tuned, and all have a value, and a condition:
run_test_first means that, before doing anything, the game need to see what conditions are meet and which one of these actions apply to the situation at hand. This loot does something more:
This is a loot that calls two other loots! Remember I told you... loots can call other loots!
The fun fact is... the loots it calls... call other loots too... randomWeightedLoots, and we'll talk about them another time. Not everything supports running randomWeightedLoots, if you put one where it is unsupported, it's going to cause an LE, this is the reason sometimes we find loots inside loots that call another randomWeightedLoot, like in this case. The logic is, in any case, that when the action changing the relationship happens, I want something else to happen.
Let's look what else loots can potentially do apart from adding and removing buffs. I cannot cover it all... they can do too many things, but I'll give you an overview of some of them:
Give Notifications:
Lock Doors:
Run Interactions:
Update Commodities:
Change the State of an Object (from a default of NotInUse to InUse here):
Add (and Remove) relationshipBits:
Add (and Remove) Traits:
Start Fires:
Give Money:
Give Objects:
Summon NPCs:
Extend a Sim lifespan:
When something happens in game, 90% of the times, a loot is the one that made it happen.