TUTORIAL - HOW TO.... (Patreon)
Downloads
Content
USE THE XML INJECTOR TO ADD A SOCIAL INTERACTION TO THE GAME
This will be a very simple, very basic tutorial.
What you need:
Scumbumbo's XML Injector this is a FANTASTIC tool that lets you add into the game, without having to add on top of it another script. It's ONE script multiple mods can share.
Snaitf's FNV Generator another incredibly useful tool
An online Hex to Decimal converter like THIS
So... let's say we have a fantastic idea for a new friendly interaction to add into the game... we want our Sims to be able to complain about Maxis...
Let's open Sims 4 Studio, and for the purpose of this tutorial, let's search for the "Complain about Problems" interaction in the tuning extractor
We are just going to copy this, change the name, make some adjustment and be done for this round... so let's add it into our package, an change the name in the first line (include your name to avoid conflicts)
at this point, we can go on and duplicate it, a pop-up will appear, asking for a group and an Instance. You can leave the group as it is, but we need a new unique instance for our interaction... let's then run the FNV generator and past the name of our new interaction into it
We want the FNV-64 hex number, so let's copy it and paste it into our interaction instance
You can delete the original imported interaction at this point
Now we need to change the number in the s= value, and this number is the Decimal equivalent of the instance number you gave to the new interaction, so let's go to our converter, paste our new instance, and get the decimal equivalent for it:
replace it in the interaction
and we can look at what we need to change in the tuning, like the display name:
Now this interaction has 2 display names... one is the usual, one is the override during a surprise holiday. We will put the same name into both in this tutorial, we could actually remove all the name override part, but that's not the purpose of this tutorial... to change the display name we need a new STBL (StringTable) so let's click on Add, scroll down to String Table... and we need another instance, so let's get it the same way we did before...
that done, we need to add an entry in our STBL for the new interaction
Let's open this up, choose a display name (this is what the game will show) paste our name into the FNV generator, and get the FNV32 key for our display name
this done, we can go back to the xml, and replace the key for the display name with our key (after the 0x )
Now we can look more at the tuning, because this interaction is emotion based, but we want it to always show, so we need to remove a couple of things:
Especially the test.
Now we have the interaction... how do we get it into the game?!
You need to go and read Scumbumbo documentation, it's really easy to follow... I will help you with the first part. We need to add a snippet, so the same way we added a STBL, let's click on add and scroll down to snippet, it will ask you for a new instance, so let's choose a name for the snippet, and go again to the FNV generator
Aaaand.... we have a problem. Scumbumbo says in the first part of the documentation that:
You should choose an "n" (name) for the snippet and use an FNV-64 hash with the high-bit set for the "s" (instance ID) value
Now if you know nothing about this stuff, is not so hard how it seems. It means that the first number of the decimal value in the "s" needs to be one. If I paste the Hex I got in the converter, you will see that it's not:
How do we get it?! Well.... if the first value in the Hex is less or equal to 7, you need to add to it 8 (be ware that this is an Hexadecimal value, so when you go past 9, you don't get 10 but A
So, in my case I got 0, addig 8 will result in 8
The new hex number is the one I will use as instance
the decimal one is the one I will use in the snippet
To code the snippet, you can easily follow Scumbumbo instruction from here, and look at my file for reference. For this tutorial in particular, you need to follow the ones to add a mixer interaction... but once done this tutorial and following Scumbumbo PDF you will be able to add to everything supported by the injector.
When you're done, we can place the package in our folder and see if it works...
Our Sims can now Complain about Maxis!
Yup, totally putting this file for download