Tutorial - Let's put our Interaction in Game (Patreon)
Downloads
Content
Finally! I took it so long, because to do this we're going to use the XML injector.
By the way, in order to follow this tutorial, you need to have followed the Let's Make an Interaction! and everything before it, first.
So as always, we're taking it very large.
MCCC, we all know it. When MCCC came out, it didn't have another way to configure the options than writing them in the cheat menù. We all know is a script mod, but does it need scripts? Pretty much... MCCC is ALL script. If you open the package that comes with it, you only find some buffs and trait tunings, and the XMLs for the menù to set it. All it does, it does by scripts.
Now I went on, and made a social interaction with the Mod Constructor, and it gave me my package and a script:
Does my stupid social interaction really needs a script? Let's investigate it.
Now, a ts4script is nothing more than a zip file:
And we can Unzip it:
Inside we'll find what composes the script:
and we can open the .py file too with notepad ++ and look at it:
Python is a high-level programming language meant to be read by humans. An if you compare it to other programming language is also quite easy to understand. I'm not interested in Python, the most advanced thing I did with it is have a chat with the terminal a loooong time ago, I then abandoned it and similar (C++ and Ruby) because writing that bores the hell out of me. Now, the important thing is what this does, let's investigate:
This... looks familiar...
It's a tuning ID, of the social interaction I made with the constructor... so what's this?
Another Tuning ID:
of a Maxis XML called social_Mixers_Friendly_NonTouching
All this "script" does is telling the game:
"Ehi game, I think you should load the interaction with this tuning ID inside the snippet with this tuning ID, so it will show in the friendly pie menù"
That is exactly, this:
Do I need a custom script, and most importantly, do I need 20 of them each one of them telling the game to load one or two interactions? Not really, I can save the resources they would take (and they would), and reserve them to the 15 scripts MCCC REALLY need, using one script to rule them all, and this script is:
This is one of the most brilliant and underestimated tools Scumbumbo left us, for a number of reasons. First, injecting interactions is just one of the things it can do. Second, if tomorrow Maxis decides to cast upon us another Python Update Apocalypse, this is the only script that would need updating to make all the broken mods work again. This is why I think it's a precious tool that really needs to be preseved and deserve way more love than it gets. I can replace the script the Constructor gave me with an Xml Injector snippet that will tell the game:
"Ehi game, I think you need to load this bunch of interactions into this bunch of maxis xmls, thanks!"
Now, let's go back to our Mod, I made a confident buff to add to our loot action:
And added it in there, now we need something to load the interaction in game, because right now, it will not work. We're going to add a snippet (you can read the documentation for it, I already made a tutorial HERE
We're going to add a snippet resource from the list, choose for it a name and give it an Instance ID:
And it will be EMPTY:
We don't have any Maxis XML as a reference for it, and that's the reason I wanted you to understand some terms and how things work. We'll need to write it dow, so we'll start with the standard header, we'll open an instance and give it the class, instance type and module Scumbumbo tells us to give it in the documentation:
Inside this, we'll need to open a Tunable List with name add_mixer_interactions:
and inside this a Tunable Tuple
Then another list with name mixer_snippets:
In the Tunable we'll put the tuning instance of the maxis xml where we want to put our Interaction, that is the social_Mixers_Friendly_NonTouching from before
that is nothing else than a list of all the social non touching interactions in game
and in another list called affordances we'll put the interaction we made and we want in there:
Like this:
And we're ready to save the mod and put it, the Xml Injector, and MCCC (that will tell us if we made a mistake and cast an LE) in our Mod folder, and jump in game!
Here is our interaction!
And....
OUR BUFF!
On Cassandra, the target sim.
But... I do have a problem with the buff I gave to Bella... the actor...
For some reason... it's supposet to be a confident buff but it's doing this funny thing... it's my buff though...
I also have a problem with Alexander, i can run the interaction on him...
But... he's not getting my happy buff...
On the next part, we'll do some troubleshotting. And if you know how to fix my my mod, go ahead and do it.