Home Artists Posts Import Register
Join the new SimpleX Chat Group!

Downloads

Content

PART 1

I'll try to keep it easy as much as I can. The process is not hard but can be a bit intricate. In this first part we will be focusing on getting our spell to show up in game, the next part will be about coding the actual spell effect.

For this tutorial you need:

Sims 4 Studio 

r3m Spellbook Injector 

r3m Documentation 

I'll be teaching you a regular spell that can be learned the usual way just like the Maxis ones, but there are other options and you can read the documentation to know more. We'll be making the Screaming Curse of Ancients from JA castable, under the mischief category. It's not required, but our spell will have a tome and we'll be starting by clonating the tome object, so we'll not need to merge packages later.

So, let's open Sims 4 Studio, and under OBJECT let's select "Selective Clone" and click the "Object" button:

A window will open with the game objects:

On top, we need to click on "Show dubug items" and search for tome:

Let's select the appropriate tome for our spell, that will be a rank 4 Mischief spell:

Click next, and in the new window that will open, let's leave selected only "Model", "Definition" and "Catalog"... we will not need anything else:

Let's give a name to our package and change the name of our tome:

This will create a STBL we will use later. Let's move on the Warehouse tab and, for now, we can delete all the StringTables that are not english:

Let's leave the tome be for now. The first thing we need is a snippet to tell the injector to load our spell. If you followed my tutorial on how to use the Xml Injector, this will not be new. I'm going to provide you and already coded XML you can just import or copy into your mod, but you still need to go to add, scroll down to snippet, choose a name for the snippet (use your modder name to avoid conflicts) and give it an ID. We can use the S4S hash generator, so let's go to "tools" and "hash generator"...

Choose a name to give to the snippet and get the Hexadecimal ID High Bit, don't close the hash generator yet:

Let's copy the ID and paste it into the add snippet window:

Let's also change the group to 80000000.

Now you can open up the empty snippet xml I already coded for you, or you can import it into the xml tab of you newly created snippet:

As you can see, I pointed out what you need to change. So first thing, let's change the name with the one we chosed for our snippet while generating it, and the ID ("s=......") with the corresponding decimal number to the hex number we used as instance:

This done, let's give a look at what we need to make this spell work:

We need a spell ID, a Tome ID and a spell unlock loot.

Let's start with the spell tuning, this will contain the information for the spellbook and the pusher to make the spell work, but we will use this last piece only on the second part of the tutorial. For now, let's just go on extract tuning and search for spell, we're going to copy and adjust a Maxis one. Let's chose a spell that targerts a sim, since ours is going to target a sim, and add it to our package:

You'll see that it added a spell tuning and a Sim Data file. So, first thing, we need to change the name and instance ID of the spell. Let's open up the hash generator again and chose a name for our new spell to get the ID, and change it on the newly imported spell:

Then let's move on the DATA tab of the spell to change the group and the hex ID too:

This done, we can move on the Sim Data file and change the name:

and in the DATA tab of the same Sim Data the instance ID that is the same of the tuning file. Don't change the group in the Sim Data file.

We can now grab the decimal ID of our spell and go back to the snippet, to put it where it should be. in the line where I commented "SPELL ID" paste the ID you just got, and you can change the comment with the name of your spell:

Good, let's focus on the unlock_loot next. This is the action that will unlock the spell in game. So the same way we searched for the spell, let's go in extract tuning and search for spells_learn...

Don't pick a rank 5 spell because it's a bit different.

The process now is the same as for the spell... we'll change the name and ID both in the xml tab and in the Data tab the same way, we'll also change the group. The loot will not add a SimData file.

Then back to the snippet, let's put the loot decimal ID where it belongs:

Lastly, let's make the tome we cloned, functional. So we need to go to extract tuning again and search for Book_spells_MagicTome

add the proper tuning to our package, and change name and decimal ID in the tuning, and group and hex ID in the DATA tab:

Now we need to change the name and ID also in the object definition file we imported at the beginning:

Back to our snippet, let's put this last piece in place:

The snippet is done, it knows where to find all the information it needs. The spell though, still need some work. But I'll cut this tutorial here and continue to the next part in another post.


PART 2 





Comments

Anonymous

Hi again, sorry for all questions. But about this injector documentation - there was some tDesc files and I tried to download the program that could show it from mts, but I believe I have wrong numbers on the folder, I tried a lot of numbers but couldn't get anything to show up in the program. How do one know what name a folder should have with just the files? What name did you use on folder when reading the files if you did?

zer0_Mods_

I had the same problem. I named It 1.54.105 TDESC, it reads even though it still gives an error