TUTORIAL - XML (For The Sims 4) (Patreon)
Content
This will be a very basic tutorial, but there are a couple of mistakes I see complete beginners always do, so I think addressing this very basic thing is important.
What's this shite?
Once upon a time, the earlier versions of the Constructor used to output xmls formatted like this. Why?! Because the game actually likes this shit a lot more than this one:
This is the same xml formatted in a different way, but it's formatted like this for us... since you had the UI, you didn't need to mess with the xmls manually, and the Constructor used to build the file with the game in mind. The game likes a xml without spaces a lot more than a xml formatted like this last one; a xml with no spaces is read faster. The impact on performance is not so big, but the last formatting you see is for us, not for the game.
Much less, the game likes this:
This is yet again the same xml, but I commented it. This one not only have spaces, it also has lines I'm writing down, but telling the game to ignore. So the game has to read them, and decide to ignore. From its point of view, this is a waste of time. From my point of view, this is a way to understand what does what.
This line is commented:
I see a lot of beginners change this and think they changed something in the files... the game only cares about this value:
when I write this:
<!--
I'm telling the game: "I'm writing this for myself, you should ignore everything I'm writing inside this"
-->
The commented lines, in S4S, are in GREEN
This is an opening Tag:
This is a closing Tag:
This is the Value inside the opening tag and the closing tag:
Opening:
Closing:
Value:
Comment:
Again...
Opening:
Closing:
Now, in here... between the opening tag and the closing tag there are other tags, they're nested inside...
There is another opening:
Another closing:
And something (with another opening and another closing) inside that, too:
You get the idea...
Some Terminology:
Why am I telling you this?!
Because...
This is the naming system Maxis uses in the TDESC.
This is the name of the TunableList in question and is inside the opening tag.
This is a Tag that opens and closes in the same line.
This is a mistake, a tag is open without ever being closed. What happens: the last closing line will show the error (the red line you can see under the I )
Sims 4 Studio will tell you EXACTLY what you did and where
Hope this helps people who are approaching modding for the first time.