SpinoInWonderland Hatchling
Posts : 88 Reputation : 7 Join date : 2016-06-09
| Subject: Multiskinning tutorial by Eternal_Rocker_Chick Mon Aug 15, 2016 11:02 am | |
| - Eternal_Rocker_Chick wrote:
- Here it is, the multiple skinning tutorial. Please, before attempting this, make sure that you can replace skins in a tml within 5 minutes. This is complicated.
This tutorial will tell you step by step how to add another skin to a TML file.
For an example, we will take the FlamingCliffs.tml, and add another raptor skin.
You will need: ConvertCCT: http://www.geocities.com/andres_james/jpog/ConvertCCT.zip This will be used to check your TML file, after you've created it
A Hex Editor: You may use whichever one you wish, but for this tutorial and the screenshots i use this one http://www.hhdsoftware.com/Download/free-hex-editor.exe
A DDS File: This wil be the texture you wish to add to the TML.
Introduction to the TML Files
Before we begin, you will need to understand the TML files, and what the data means. Skip this is you feel confident, but i am aware that people of all ages will be reading this tutorial, so i'll try and make it as basic as i can. Lets take the original FlamingCliffs.tml as an example.
Firstly, open it up with the hex editor. We will be looking at both sections of data here. The right side are normal, decimal values. The left side are the hex values.
It we start at the beginning of the file, you will see the word 'TML1' and on the left, the hex values for it. That is, obviously the file extension, and will be at the start of every TML file you edit.
Next, on the right side, you will have a lot of dots. However, if you notice, the hex values (on the left) will not always be the same. THIS IS A MISTAKE YOU WILL MAKE IF YOU DON'T PAY ATTENTION TO WHAT YOU'RE DOING!!! A '.' in decimal could be a variety of values as a hex. The actual full stop dot on your keyboard has the hex value 2E. Remember this. Look at other TML files if you're not sure what the hex value of your dot should be. If you get it wrong anywhere, your file is ruined.
Anyway, a dot with the hex 00 is blank data. However, there is another thing which you need to know. Data for this is ALWAYS grouped in fours. TML1 is the first data set. Then you have four dots on the decimal side, and four lots of 00s on the hex side, so the second data set is blank data.
You then should notice a number on the hex side which in this case is 06. [attachment=6]Screen1.jpg[/attachment]
This is the amount of textures within the TML. However, this is recorded in hex values, so if you get a value of 0a, don't be worried. Use your computer calculator if you're unsure on your values. But hex numbers tend to go like this:
1=1 2=2 3=3 .... so on.... 9=9 0a=10 0b=11 .... so on..... 0f=15 10=16 11=17
The only letters used are ABCDEF
Anyway, the second number you see will ALWAYS be one down from the amount of textures in the file. This is because you've now started the header for the first texture file, and this number is the texture's ID number, which is then assigned to a name at the bottom of the file.
After the ID number, which in this case is 05, (remember to miss out the next 6 values as data is grouped in fours) the header data for the texture begins properly. From here to the C. data (hex value 43 00) is the header data. The DDS is the start of the texture file. [attachment=5]Screen2.jpg[/attachment]
It doesn't look like much, but again, if you get any of this wrong, the file will not work. This bit of data basically tells the computer what size the texture is, bit depth, and other stuff. I haven't been able to decode exactly what each bit of data means here, but don't fret. As there's an easy, quick way to obtain header data for any texture you want to put in. All you need to do is check what are the dimensions and size of the texture you want. Then, once you know that, search the TML's and find a texture which is the same. All you have to do then, is copy and paste
Now, before we move onto the footer of the file, i've just got to state the obvious. Each texture in the file has header data, and an id number. The id number comes straight after the texture, then the header data, then the next texture. Id numbers go down. If the first was 05, (which it is in the flamingcliffs) then the second will be 04. 00 is also a valid id number and is used in every file. [attachment=4]Screen3.jpg[/attachment]
Okay, the footer. Now, this is where my knowledge fails, which is why we must eliminate dead skins to have multiple skins. The bottom of the file is where the names for the id's are stored. You might also be able to see an id number, before the first skin name, which in this case is Galli. I've come to understand, that this id number is actually corresponding to the number of 'normal' skins within a TML. It's at 03, because there are only three proper skins. The other three are the dead skins. In any TML that you will add to in this tutorial, that number will always be the number of skins in the tml.
Anyway, I can't properly explain the current flamingcliffs footer values, so on with the tutorial!!
Tutorial
Now, in each digsite TML there are 6 skins. However, three are normal, three are 'dead' skins. These dead skins are 'linked' to their live counterparts in the footer of the tml. I don't understand how this is done. But i do know how to link each ID number to a name.
This may be hard to understand, but basically, we'll be turning the dead skin slots into live skin slots. So, that gives you three more skin slots to do what you wish with, as they'll no longer be dead skins, and you'll be able to view them on any graphical setting. For the purpose of this tutorial, i will leave these skin slots with the dead skins in, and they will be unused. I am concentrating on the 7th skin that is being added.
Anyway, first thing we need to do is sort out the dinosaur names at the bottom of the TML. In the flamingcliffs, there will be Galli Homalo Raptor, each with a line inbetween. As you should know from the last tutorial, this means the skins are ordered like this:
Raptor Dead Raptor Homalo Dead Homalo Galli Dead Galli
Now, we need to list each and everyone of those skin names. Look at the format they are wrote in, and copy it. You're basically writing the skin names in the reverse order of what i just posted from the first TML tutorial, each directly under eachother with a line of blank data (00's) between them.
NOTE: If you're using my hex editor, and trying to input new data, and it's just overwriting the original data, or vice versa, press insert on your keyboard. That switches it between overwriting data and adding new data
Once that's done, you need to add the name of the new skin
After you're finished, it should look something like this: [attachment=3]TutScreen1.jpg[/attachment]
I have named the dead skins with a -2 at the end. It doesn't matter what you name them, and you don't even need to remember the name for this tutorial. This will be the 'empty' slot skins, which you can change and add into the game when you get the hang of this.
Again, it doesn't matter what you call the new skin you're about to input, as long as you remember it, and the name isn't too long. Try to keep it short.
Now, we need to sort out the data underneath the names. This links the ID name of the skin, with the actual texture. It needs to be re-written though, as currently it's written for 3 'alive' skins and their dead counterparts. We'll be writing it so it accepts 7 'alive' skins.
Rather than explaining how this is done, as i'm not sure if i'll be able to do it so people understand what i'm on about, i'll include a screenie to show exactly how it should look [attachment=2]TutScreen2.jpg[/attachment]
The highlighted data is what you need. Double check, then triple check this. It needs to be EXACTLY like this.
UPDATE: I forgot this last time, and i'm sorry everyone. Before you continue, do this: Go to the footer, and find the ID number of the last skin. I think the hex data of it is 03. it should be something like 03 00 00 00 then the first dino name. That 03 doesn't act as an ID number. What i've gathered from it, is that it relates to the amount of skin names you've got in your tml. So change it to 07, and it should work.
Next, we'll do the easy bit. Scroll right back upto the top of the file. If you've read the introduction to the TML format above, then you'll understand what you have to do. If not, look at this screenie [attachment=1]TutScreen3.jpg[/attachment]
The red numbers on the top line are what i've changed. They were 06 and 05. They are now 07 and 05. 05 has been left alone, because this data will still be used as the header data for the raptor dead skin. We will be inserting the new skin at this point.
Alright, with that part done, we've gotta add the new skin.
When we wrote the footer data at the bottom of the file, the new skin, in my case, RaptorA was at the bottom of the list. This means it's the first skin in the file, so that's where we've got to add it.
Now, open the skin you want to put in with a hex editor. Obviously it should be in .dds format. If you don't have a clue how to do that, read the last tutorial.
Also, open a seperate FlamingCliffs.tml. We need this, as we need to copy the texture header data of the original raptor skin, and put it in our new file. Remember this. If you're putting a T-Rex skin in, get the original rex header data. If you're putting a spino skin in, get the original Spino header data, etc.
Now, to make this process quicker again, we're gonna copy the original raptor header from the original FlamingCliffs TMl file, and put it into the new skin dds file.This is to make an easier transition when inputting the new skin.
Again, we know from the last tutorial that the skins are listed in reverse order, so the normal raptor will be the second skin. If you have trouble with this, read through the last tuorial on how to find the beginning and end of each dds file in the TML.
Once you've found the start of the original raptor skin in the original TML, you need to start selecting and copying the data. Now, you need to copy from the first dot (after the y symbol) to the 'C.' just before where it says DDS. The dot should have the hex value of 04, and the C. should have the hex data 43 00
Here's a screenie if you're unsure [attachment=0]TutScreen4.jpg[/attachment]
Next, open up your new raptor skin with the hex editor, and paste the data at the beginning of the file. Make sure you're adding the data, not overwriting it. Now, copy the whole file. Go back the FlamingCliffs.tml you're editing. We need to paste this in as the first skin. Again, make sure you're adding, not overwriting data. Click the 05 value on the first line of the file and paste.Now, if you're using my hex editor, and the data goes red, you've overwritten the data, not added in. So you've just overwrote the dead raptor skin. If this is the case, you can either fix it, by obtaining the dead raptor skin from a backed up TML and pasting it in, then pressing insert on the keyboard and re-paste in your new skin, or start again. If the data moved slightly but stay black, then well done, you've nearly done it.
All you need to do now is change that 04 value on the first line of the tml. Change it to 06.
The TML should now be complete. To test, click your tml icon, and drag it onto Andres' ConvertCCT. If all seven skins come on out named and perfect, you've done it. Give yourself a big round of applause, and put the TML in your matlibs folder. If that doesn't happen, refer to the FAQ.
However, we're not done yet. The hard part is out of the way though. Now we need to commence the process of adding a new dinosaur. Firstly, access your units folder, and find the raptor files. I'm using the raptor files as we're just creating a new raptor. If you've added a different skin, you'd find their files.
Anyway, take the .ini .nwt and .inx. Make a copy of them, and rename the copy to your new dinosaurs codename. Remember the name you called it in the TML? Call it that. So my files will be called RaptorA.ini RaptorA.inx and RaptorA.nwt.
Access your new .ini. Change the name to your codename. And also change the screename. So, my screename will be $Unit_raptora;
Also, scroll down and change the model to your new dinosaurs codename.
Next, access your new .inx. Scroll down to where it says Model: Again, put your codename in there. Remember the ; at the end!!!
Make sure these three files are in your units folder.
Next, access your dinolist.ini in the data folder. Add your codename to there. Remember the , at the end.
Now, access the FslHunt.ini, also in your data folder. As we're doing a raptor in this tutorial, scroll down to the flaming cliffs section, and find where it says reqdinos = { raptor, homalo, galli }; . Add your codename in, so it should say something like reqdinos = { raptor, raptora, homalo, galli };
We now need to choose the name it will display in game for your new dinosaur. Find the Eng.txt in your Locales folder. In this case, find where it says: Unit_raptor "Velociraptor";
Underneath it, write your codename and do the same. The bit in brackets is the name which will be displayed in game. As i want my new raptor to be called velociraptor in game, mine will look like this: Unit_raptora "Velociraptor";
The last thing which you need to do now, is clone the existing model. For this case, find the four raptor TMD files. Rename them with your codename. My four will be called RaptorA_lo.tmd RaptorA_md.tmd RaptorA_hi.tmd and RaptorA.tmd.
Now, you need to edit these four files. In each of them you need to find the old skin string, and replace it with your new one, so it uses the right skin. In my case, in each of them i will need to search for raptor, and each instance i find i will need to replace it with raptora. Well, all i'll really be doing is adding an a at the end ^-^
Make sure you're overwriting data. If you see, there won't be much room for the string. This is why you needed to keep the name short. The maximum number of skin referrances in the files will be four. The lower quality models will only have about three though. Make sure you've changed all of them though.
Remember to put your model files in the model folder!
Now, load the game, cross your fingers, and hope for the best ^-^
Frequently Asked Questions (FAQ)
1. I've made the TML but when i check it using the Convert CCT it just crashes. A: This means your TML is unreadable. And if you can't fix it, it's better to start again. Trust me. There are some quick things you can check though. The first is to open the TML, and scroll right down to the bottom. Now, the data should be in fours. By this, i mean that the last line of your data should either have four values, eight values, twelve values, or the full line. It it has one value, or five values, then you've messed up somewhere, and either added data you wasn't supposed to, or deleted data you weren't supposed to. Again, i would start again.
2. I've made the TML, but when i check it with the ConvertCCT it says something about the height and width, and it doesn't match. A: This means you haven't got the right header data for your new skin. With the raptor example, it is first in the TML, so the header data is quite easy to put right. Just go back and get the original raptor header data from the original flaming cliffs tml. Copy it, and paste it in your file. Just click the 06 value on the first line and paste.
3. The TML works fine, and i've added the new dinosaur, but when i start the game it crashes. A: Firstly, re-check all the steps you took to add the new dinosaur files, and make sure they are correct. The most common culprit for this, is the missing semi-colon signs ( after your new dinosaur names. Check everywhere where you've added it, and make sure that if it should have a semi-colon, it does. _______________ deviantART: http://spinoinwonderland.deviantart.com/ Blog: http://sauropodomorphlair.blogspot.com/ | Imgur: http://spinoinwonderland.imgur.com/ Models | Skins | Mesozoic Revolution | |
|