Page 1 of 3

Tutorial - Using Decals

Posted: Sun Oct 31, 2010 12:41 pm
by attacker5
Ok so, I have noticed that there are not many tutorials out there that show how to get decals in game, yet there are a lot of people asking how to do so, and yes, one of them was me, not to long ago. I decided to make a tutorial about it since i now know how. This is my first tutorial, so please bare with me. :D

The first thing you will need is notepad++ You can get this from here.
You should use this because it stores code information better and is easier to use along with it being able to save as more file types.

You may have noticed that there is no decals file in your track folder if you are using the old default blank track folder. If not, and you are using a new blank folder like the one DJ made then it will probably be there. Either way edit it or make a new notepad++ document in your track folder called decals, with no file extension.

Now in this file you will insert the line of code that will tell the editor where to put all your decals, don't worry, you only have to put one line of the first decal of every type. Once the decal is in the editor you can copy it and move it really easily.

Now the decal part. The code for each decal in the editor should look like this:

Code: Select all

[100.000000 100.000000] 0.000000 15.000000 1.000000 @bradlyarenacross2010/textures/ground.png
So starting from the left, the first two numbers that are in brackets are the x,y co-ordinates of the decal relative to the mx simulator map. Now the 0,0 spot is the top left corner of the map. So with 100 and 100 it will be 100 units right from the left edge of the map and 100 units down from the top of the map. The number after the co-ordinates, in this case, 0.000000, is the rotation of the decal, usually 0 is good because it is straight up and then you can later modify it in game. The 15.000000 is the scale of the decal. You can make the decal bigger by increasing this number. The 1.000000 is the aspect ratio.

Now for the location of the decal. I usually make a folder called textures inside my track folder which i use for all my decals. Now bare in mind that the root folder in your personal folder, so this is where the editor automatically starts looking. We then use this last line of code to tell it where to go from there. So the code i have below.

@bradlyarenacross2010/textures/ground.png

Will mean that from the root folder. It will enter bradlyarenacross2010 and the it will go into textures and then use the .png file called ground. If you have your decals just in your track folder, the code should look like this. Of course remember to replace bradlyarenacross2010 with the name of your track folder.

@bradlyarenacross2010/ground.png

Now you might have noticed that some decals on downloaded tracks are just like so.

@ground.png

This means that the editor will look for the ground.png file straight from the root folder. You might notice that there is no .png called whatever the decal is referring to, this is because the .png file might be .saf ed.

Once you have written all this code it should look like this. Always remember to have one empty line at the end of your code.

Code: Select all

[100.000000 100.000000] 0.000000 15.000000 1.000000 @"trackname"/"decalname".png
Save this document as a file file with no extension. Go to your editor and click decals, your decal should be in the top left corner, 100 units down and 100 units across.

Hope this helps, if you have any questions, please feel free to ask.
:D Attacker5

Re: Tutorial - Using Decals

Posted: Sun Oct 31, 2010 12:45 pm
by attacker5
Sorry forgot to add the notepad++ link, here ya go.

http://notepad-plus-plus.org/download

Re: Tutorial - Using Decals

Posted: Mon Jan 03, 2011 2:07 pm
by rainey06au
Thanks and nice tutorial. I have a question though. How can I place a decal underneath another decal (without removing the original decal)?

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 2:36 am
by mace-x
rainey06au wrote:Thanks and nice tutorial. I have a question though. How can I place a decal underneath another decal (without removing the original decal)?
yes, the decal that you add last is the decal that it will be on top.

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 11:12 am
by rainey06au
I noticed that, I was hoping there was a way you could 'send backwards' like a layer in photoshop, because I've just drawn out a track using decals and wanted to put sand underneath it... I guess I need to start again and do the sand first! What a bugger!

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 11:27 am
by rainey06au
Another question... How do you delete a decal after you have placed it?

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 1:04 pm
by eXL'Mo0seY
You can't. Actually, you can save it, go into your decal file and delete the last line. That will delete the last decal you placed.

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 1:29 pm
by attacker5
Sorry dont have much time, will explain later, just hit "x" when your mose hovers over teh center dot of teh decal to delete it. for adding under layers simply add a line in teh decals file.

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 6:08 pm
by Garasaki
rainey06au wrote:I noticed that, I was hoping there was a way you could 'send backwards' like a layer in photoshop, because I've just drawn out a track using decals and wanted to put sand underneath it... I guess I need to start again and do the sand first! What a bugger!
Copy and paste the lines in notepad++

I actually set up separate decal files to do exactly what you are describing. For instance:
  • Load up your offtrack decal
    Go into the game, place offtrack decals, save
    Copy resulting "decals" file, rename to "offtrack decals"
    Delete all lines in "decals" file, place a new line for your ontrack decal
    Go into game, place ontrack decals, save
    Copy resulting "decals" file, rename to "ontrack decals"
    Delete all lines in "decals" file, place a new line for your ruts decal
    Go into the game, place rut decals, save
    Copy resulting "decals" file, rename to "rut decals"
    Open up "decals", "offtrack decals", "ontrack decals", "rut decals" in notepad++
    Copy the offtrack decals line and paste into "decals"
    Copy the ontrack decals lines and paste into "decals"
    Copy the rut decals lines and paste into "decals"
    Save decals
    Go into game and then you have compiled all your decals and should have a "finished" product
Whats the point of such an approach? It allows you to backup your decal files, and allows you to easy edit different features. Ruts, for instance, are nearly impossible to deal with because of all the other decals (and therefore other little arrows). You also never have to worry about accidentally placing the wrong decal (if you only have 1 decal at a time).

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 7:39 pm
by VMX_SKYmx99
Garasaki,

That is the first time anyone has ever explained decals that actually made sense. Now I just need to get my ass in gear and make a track. 8)

Re: Tutorial - Using Decals

Posted: Tue Jan 04, 2011 11:01 pm
by Motoboss
rainey06au wrote:I noticed that, I was hoping there was a way you could 'send backwards' like a layer in photoshop, because I've just drawn out a track using decals and wanted to put sand underneath it... I guess I need to start again and do the sand first! What a bugger!
If im understanding your question right ...Instead of going through all that rigmarow ...all you have to do is place the decals and save... Then go into decal file and copy and paste the decals you just placed above the decals that were already there ..If that makes sense...

Re: Tutorial - Using Decals

Posted: Wed Jan 05, 2011 5:37 am
by jlv
Another advantage of the way Garasaki described is the decals will be sorted that way which will give better performance. Switching textures is expensive so you want to keep all your textures in order to avoid unnecessary switching.

Re: Tutorial - Using Decals

Posted: Wed Jan 05, 2011 12:40 pm
by rainey06au
Wow thank you very much guys, I'm going to use Garasaki's suggestion from now on. You know how dumb I am... I'd not checked my decals file since I established my first set of decals, and did not realise that it actually populates the coordinates of each individual decal on a new line as you place them in the editor! Duh! Makes sense to just switch the order of appearance in here to re-establish the 'layer' order.

Re: Tutorial - Using Decals

Posted: Wed Jan 05, 2011 3:49 pm
by Garasaki
It sounds like a lot of work to do it the way I suggested, but you really only need to compile all the decals once at the end. Offtrack decals you only have to mess with once. So 99% of the time I'm working on a track, I only have the ontrack decals on. Then a session or two placing different rut or other visual enhancement decals. I also use decals to do my tree shading so that's another set of decals I usually have saved.

The biggest problem I have is forgetting to save some work back after I've done it an losing it or writting over it.

Re: Tutorial - Using Decals

Posted: Wed Jan 05, 2011 10:00 pm
by rainey06au
Your method will be ideal for me because the way I'm making my track is by using a low definition (1024x1024) decal to cover the whole area, and then using this as my guide for placing the regular decals. So I can essentially have a different decal file for my sand, another for dirt, another for road etc. and just keep the low def template in each of these files to trace from. Once done, I can simply merge them into one. Sounds perfect to me!