Home Artists Posts Import Register

Content

Last time we saw that the TDESC and the XMLs are the same thing, they also have the same structure, and can help you understand the hierarchy inside the XMLs you'll find yourself working on. So this time, we'll not be working on S4Studio and really we'll not be doing something useful, we'll just do an exercise because writing this down can help you understand how all of this comes together and when you'll need to put some lines into an XML that doesn't have them, how to find out where to put them.

So we have an empty Notepad ++ text file, and we're going to write a loot action without any other reference than the TDESC. We'll not be looking at Maxis loot action until the end to compare what we did with what they did.

So let's search in the TDESC Actions and then loot_actions:

We'll close it all and bring up our guide:

An action is an INSTANCE, so we start by opening a tag and call it I:

Then we're going to put down the usual information this INSTANCE needs in the first line:

class, module and instance type, then we know it needs two more things:

the name and the tuning ID, that we can just make up or leave empty, as we're not really going to do anything with this loot.

Right after we completed writing our first line, we're going to press enter and close the tag:

and for all the rest we're going to write, we'll move inside it:

'cause as we can see in the TDESC, all the rest we need to write is inside it, and inside we have a TunableList called loot_actions:

Let's report it into the XML we're writing:

We open the list, give it the name, and close it right on the next line, then we move inside:

inside we have a None TunableVariant we'll need to choose, let's report it in our XML leaving the t= empty untile we choose the tunable to use:

let's choose buff:

It's a TunableTuple inside the TunableVariant:

Inside this TunableTuple there is another TunableTuple called buff the same:

and inside this other TunableTuple there is a TunableVariant that can be disabled or enabled:

Let's report all of this in our XML:

So enabled is a Tunable inside this Variant:

We're not going to write anything inside (this is where the value of the buff reason would go)

Let's go back to the TDESC:

So we have another Tunable that is NOT inside the TunableVariant but just outside. Let's report this too in the XML:

and we're done, let's compare what we did with a game loot:

So hopefully at this point all that stuff is not a foreign language anymore.


Comments

Anonymous

Scumbumbo is amazing! Since he is not active for a while now there is a small risk using the XML Injector. If it breaks (again) and no one is willing or can update it all Mods that use it will break with it. The risk is probably low but still there.

Anonymous

I'm still confused by t= and n= even after all these months. I'm assuming n= always stands for name? What about t=? And why does it go first when starting the tag but sometimes not first, like for buff_reason where n= is first?

zer0_Mods_

I don't think there is an order for t= and n= ... they can change order from patch to patch in the same place and you don't even notice. n= is the name (the name field in the TDESC) t= is the tunable you're using from a list of possible tunables. example: n="buff_reason" t="enabled" OR n="buff_reason" t="disabled"... oh if you're refering to the variant that goes right after the loot_actions, the t= goes first because it doesn't have a name... the name you see after is the name of the tuple.

zer0_Mods_

< T n= " run_test_first " >

zer0_Mods_

It didn't want to post it, it goes outside the list after the < /L >