TUTORIAL - r3m Spellbook Injector
Added 2019-10-16 05:46:46 +0000 UTCPART 2 ( Part 1 HERE )
In the first part, we did the snippet and not much more, in this part, we will adjust the Spell, the Loot and the Tome to make our spell work in game, and in the end we will test if:
- it shows in game;
- it can be unlocked.
In the last part (or parts) we will code the actual spell to have some effect.
There are a couple of things we need to change in the files we imported in the first part, so let's start with the spell tuning file:

Here we mostly need to change the strings that will show up in game and the icon for the moment. To change the strings we need to create them, so let's find our STBL Sims 4 Studio created when we changed the Tome's name, and let's start by writing a text and getting the FNV32 ID for the string:

Then we can go on Modify Elements and click Add:


Let's past our text and FNV32 key, then grab the key and change it in the Spell tuning file, after the 0x:

Do the same for all the strings. Now the icon, we need to import a new icon we want to use, to do this, we need to create a DSTImage resource, so let's click on add and scroll down to DSTImage Resource, leave the group to all 0 and get an instance for it the same old way:



Now let's just import the image we want to use:

Grab the Hex instance you used for the resource and go back to the spell tuning:

we can delete all this part. We only need to change the very last part of the black writing:

this will be the Hex instance of the image we imported:

This is it, for the spell part, for now:

Let's look what we need to change in the loot tuning:
We need to change the icon in here too:

as before, we can delete all the p="...." part, and replace the full line with the same line we put in the spell tuning:

Now scroll down until you find the unlock_spell line, and change the ID with the one of our spell:

That's it for the loot.
Lastly, we need to adjust the tome to unlock our spell, so let's find the Object tuning for it and scroll it... there are multiple lines we need to change:

The loot_list where it calls the original spell loot, we need to change it with ours. And the unlock_spell lines where it calls for the original spell, too.... there are a couple of them for both the loot and the spell, so just scroll it and replace them where needed:

This done, we can finally save the package and test it in game. The new spell should show up in the spellbook locked:

You can also test if the spell can be unlocked, and if the tome actually works (bb.showhiddenobjects and search for tome in build mode) if everything works, then we can move on to coding the spell to actually do something more than just sitting in the book.
I'll put for download the reference file for what we did until now, this is not a functional mod.
Comments
hey, if you post the package I can give it a look.
Zero_
2019-11-13 13:28:02 +0000 UTC