Jump to content


Photo

[TUT] How to add paintjobs to a car in SA

ice effect texture cleo San Andreas tutorial Crysis

  • Please log in to reply
18 replies to this topic

#1 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 25 August 2011 - 02:34 PM

I had an idea after reading this tutorial by DexX, which explains that the use of paintjobs is controlled by texture naming.

DexX' tutorial is about modeling, but i'll show you how to enable paintjobs on probably any car,
without the need to recompile the model. You need to know a little about SA modding though..

As we know now, Thanks to DexX' tutorial, the game recognizes keywords in the model files and
automaticaly provides the option to use paintjobs in the transfender garage menu.
The magic word is remap!

We now can edit the model file with a Hex Editor (which is basically a text editor) and forcing it to use that keyword for one of its textures, by only changing some text strings inside the .DFF file..

Take a complete and ready GTA SA car model without paintjob capabilities.
It consists of two files. One .DFF file and one .TXD file.

I did this with Tirido's DeLorean which replaces the Bullet:

tut.jpg


 

Tools used:
Notepad++ (a Text Editor with HEX capabilities)
GIMP 2.6 (painting)
TXD Workshop 4.5
IMG Tool 2.0

 

  • - - - - - - - - - -

    Open Bullet.TXD.
    Find only one texture, which represents the outside surface texture of the car.

    th_tut_01.jpg

    DeLorean_Hull.dds is the name of the texture.
    Rename it to "remapean_Hull.dds"!

    th_tut_02.jpg

    DO NOT change the texture mames length!
    Just overwrite the first 5 chars with the letters r, e, m, a and p.

    th_tut_03.jpg

    Extract the texture for later editing.

    Save Bullet.TXD and close it.
     
  • - - - - - - - - - -

    Create a copy of Bullet.TXD and name it Bullet1.TXD!


    tut_04.jpg

    Open Bullet1.TXD
    Delete ALL textures inside Bullet1.TXD, exept the one you want to replace.

    th_tut_05.jpg

    Replace the only texture left in Bullet1.TXD with your edited paintjob texture.


    th_tut_06.jpg

    Save Bullet1.TXD.
     
  • - - - - - - - - - -

    Open Bullet.DFF in a HEX editor!
    Use your editors search function to find the texture name you've choosen from Bullet.TXD.

    th_tut_07.jpg

    There might be more than one search result.
    Rename all found "DeLorean_Hull.dds" strings to "remapean_Hull.dds"!

    th_tut_08.jpg

    DO NOT change the strings length!
    Just overwrite the first 5 chars with the letters r, e, m, a and p.
    Save Bullet.DFF.

    - - - - - - - - - -

    DONE!

Your model consists out of 3 files now.
Bullet.DFF, Bullet.TXD and the optional Bullet1.TXD, which will be used by the game to add a paintjob to the car.
You can create more, by naming them Bullet2.TXD, Bullet3.TXD and Bullet4.TXD.
4 is maximum.

 

 

 
 

These are semi transparent 'iced' textures for the conversion of Tirido's Crysis DeLorean.
You'll need some image editing program, which is able to handle tranparency (like GIMP) to add
this texture overlays on top of the default texture.

 

 

 

* UPDATE *

I noticed you can't just download the original images from PhotoBucket.
They will be 1024x1024 instead of 2048x2048. So get the full quality
from this DOWNLOAD.

 

 


iced_delorean_small.png

Modified CLEO code from Back to the Future SA Mini Mod for using the Cold/Iced effect:
not needed if you have my bttf edits installed
(right-klick and hit 'save as'..)
compiled (cold.s)
source (cold.txt)


Happy painting

 

http://www.youtube.com/watch?feature=player_embedded&v=koSN7qOcP-U
 


Edited by uokka, 09 August 2013 - 06:31 PM.

  • LlamaLlamiante likes this

#2 TheCoolest2

TheCoolest2

    Einstein

  • Advanced Members
  • PipPipPipPip
  • 848 posts

Posted 26 August 2011 - 03:23 AM

You should use dif pics, I believe those are your ice deloreans affects, someone can take them and release them as their own

#3 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 26 August 2011 - 08:20 AM

whats dif pics?

#4 DMC88ELB

DMC88ELB

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 116 posts

Posted 26 August 2011 - 01:28 PM

whats dif pics?

I think he means different pictures.

This is awesome! :D Will you ever release the CLEO script? Because with this, (I think) all we're doing is having the paintjob act as the frost on the DeLorean- without actually having to see the effects when you time travel. Also, why couldn't you release your mods again? :huh: I'm really keen to have the ACTUAL frost effects on the DeLorean, as well as a model-less flying DeLorean! :)

Edited by DMC88ELB, 26 August 2011 - 01:30 PM.


#5 daangelo29

daangelo29

    Time Trekker

  • Moderators
  • 1402 posts

Posted 26 August 2011 - 05:00 PM

The code for switching between paint jobs is easy, a lot easier than adding a custom paint job to be honest. If only I have my Sanny Builder currently installed, I can teach you guys how. Me hopes to get everything set up tomorrow. (good old GTA:SA, here I come)

#6 DMC88ELB

DMC88ELB

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 116 posts

Posted 26 August 2011 - 06:14 PM

So, would it work if you configure a CLEO script that says after you time travel, simply change the paint job from the normal Delorean to the iced paintjob (instantly after the Del disappears- so it's already loaded before you actually see the Del)? This sounds so basic and simple that I'm willing to try it, but then again- I don't know how to actually tell the game to find the paintjob, then load it onto the car after time travel, as well as remove it after 1 minute, 21 seconds.

#7 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 27 August 2011 - 09:23 AM

You should use dif pics, I believe those are your ice deloreans affects, someone can take them and release them as their own

As long as you guys know that i put the white paint on the delorean texture, everything is fine. Its based on Tiridos textures. And i want to give you the possibility to use it.

[...] Also, why couldn't you release your mods again? :huh: I'm really keen to have the ACTUAL frost effects on the DeLorean, as well as a model-less flying DeLorean! :)


I didnt realy tryed to contact blue, yet. I didnt asked she/him to allow me.
Thats why i dont give you hot stuff without permission. Would get deletet anyways..
I'll try to seperate my scripts from the original ones, maybe it could be an add-on, maybe.
Didnt you asked for tutorials?

Paintjobs are very coding friendly..
All paintjob textures in gta3.img are automatically loaded by the game if needed.

for 8@ = 0 TO 3

	while true

		wait 10

		0988: get_car 0@ paintjob 7@

		wait 10

		if

			001D: 8@ > 7@

		then

			06ED: set_car 0@ paintjob 8@

			break

		end

	end

	wait 100   

end

//Going through paintjob 1 to 4. making sure no paintjoby will be jumped over.
The applied paintjob sometimes shows up a few ms too late.
wait 100 ms is a little long, though.

Edited by uokka, 27 August 2011 - 09:28 AM.


#8 DMC88ELB

DMC88ELB

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 116 posts

Posted 27 August 2011 - 09:48 AM

Where can we put this? :huh: Somewhere after the Time Travel code?

#9 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 27 August 2011 - 10:49 AM

OK...
Im not quite sure, if cold.s. is of v0.1.3.2, but i put it in there.

Some explanation:

06ED: set_car 0@ paintjob 0

This would set the first paintjob on the car (0=#1).

-1 = No Paintjob
0 = Paintjob # 1
1 = Paintjob # 2
2 = Paintjob # 3
3 = Paintjob # 4


The code swithes textures until the last paintjob is applyed (3=#4).
So, after this segment of code ...


  {$CLEO .s}

  

  //-------------MAIN---------------

  03A4: name_thread 'COLD'

  0001: wait 0 ms 

  32@ = 0  

  0AB4: 24@ = var 908

  if

	  not car.Defined(0@)

  then

	  wait 100

	  0AB4: 0@ = var 8

	  if

		  not car.Defined(0@)

	  then

		  0AAD: set_audiostream 24@ perform_action 0

		  0A93: end_custom_thread

	  end

  end

  // The above code is only for reference.


We put this ...


  // Apply Icy Paintjobs..

  wait 100

  for 8@ = 0 TO 3

	  while true

		  wait 10

		  0988: get_car 0@ paintjob 7@

		  wait 0

		  if

			  001D: 8@ > 7@

		  then

			  06ED: set_car 0@ paintjob 8@

			  break

		  end

	  end

	  wait 100   

	 //wait 50

  end


Now, before every end_custom_thread, you put this


  // Remove Icy Paintjobs..

  //wait 1500 ms

  wait 2500 ms

  for 8@ = 2 DOWNTO -1

	  while true

		  wait 10

		  0988: get_car 0@ paintjob 7@

		  wait 0

		  if

			  001D: 7@ > 8@

		  then

			  06ED: set_car 0@ paintjob 8@

			  break

		  end

	  end

	  wait 100

	 //wait 50

  end

  wait 0

  wait 0

  0A93: end_custom_thread

You might wanna decrease the wait time in the loop a little.
A value of "50" looks smoother, but doesnt always work corectly for me, due to laggy loading..

The code for switching between paint jobs is easy, a lot easier than adding a custom paint job to be honest.

Yep!

Edited by uokka, 30 September 2011 - 10:35 AM.


#10 DMC88ELB

DMC88ELB

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 116 posts

Posted 27 August 2011 - 01:29 PM

Okay, I've completed making a new paintjob for the Crysis DeLorean. I have car.txd (actual car textures), car1.txd (paintjob) and the car.dff file. Where do I put them now, do I rename them to the car names, (Super GT), and add them into the gta3.img (replacing the original files)? Also, after that, I am unable to open cold.s in Sanny Builder which means I can't add in the code . I am able to, but it comes up with a whole lot of gibberish (NOT codes). Should I make a new script with the codes above? All I've got in my cleo folder is cold.s, and cold.txt.
I know I look like a complete n00b now, but I need some help with this, uokka. I'm a beginner at this.

Edited by DMC88ELB, 27 August 2011 - 01:56 PM.


#11 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 27 August 2011 - 03:09 PM

OK, right. I wasnt clearly.

CAR.DFF, CAR.TXT, CAR1.TXT etc. .. are example names, and yes, you have to rename it to the actual name of the car model you wanna replace.
I replaced the SuperGT with the DeLorean, so what I have is:
SUPERGT.DFF
SUPERGT.TXD
SUPERGT1.TXD
SUPERGT2.TXD
SUPERGT3.TXD
SUPERGT4.TXD

But in standard case, the scripts are using the car ID of Bullet to spawn the delorean and such..
BULLET.DFF
BULLET.TXD
BULLET1.TXD
BULLET2.TXD
BULLET3.TXD
BULLET4.TXD

Add/replace those to your gta3.img or bttf.img (rebuilding bttf.img is way faster!).
Make shure you dont have any file using the same name in both .IMG files
The paintjob .TXD's might need to be added to gta3.img. not sure though..
(adding them to bttf.img works as well!)

I dont know why you cannot decompile cold.s, but your cleo folder should contain something else as well! The rest of the default BttF mod..
cold.s wont run by itself (its .s, not .cs). Its been executed by another script on timetraveling.. showing some steam comming out of the vent rising up from the cars hull (DMC88ELB, might be interesting to you.. effects.fxp), and closing after some amount of time.
It seems your sanny builder installation is missing the SASCM.INI or opcodes.txt file.. maybe thats why sanny dont know those opcodes.. cold.s is a simple script. can you open other cleo scripts.
You'll need to edit cold.s. The script snippets above are not a colmpete script.

Edited by uokka, 30 September 2011 - 10:14 AM.


#12 DMC88ELB

DMC88ELB

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 116 posts

Posted 27 August 2011 - 03:25 PM

Okay, thanks for the help so far. I am away from my laptop now, but I will try again later. I was able to download LoadGamePL's "All DeLorean Mod" before he took away all the download links. It had all the BTTF DeLoreans, including the Crysis DeLorean which had replaced the Super GT. I'll rename it to that, and replace the original SUPERGT.DFF and SUPERGT.TXD, but add the SUPERGT.TXD paintjob in. Do I have to have more than one paintjob?
That's all about the .IMG stuff.
I guess I was also a bit unclear here: I do have all the other stuff in the Cleo folder needed to run the mod, I said the only "cold" things I had in the Cleo was cold.s and cold.txt, no cold.cs- but I know now that I need to replace stuff in the cold.s script. I think the cold.s script was modified by the "All DeLorean Mod", as it required me to reinstall the BTTF mod with a whole new Cleo folder which was LoadGamePL's. I'll try to open the original cold.s script with Sanny Builder soon. Thanks for the help, uokka! :)

#13 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 27 August 2011 - 03:41 PM

The game doesnt care at all, how many paintjobs you add to a car. If theres only one extra paintjob .TXD in the archive, the game will show you only this one in the transfender garage menu.

It is not possible to use more than 4 paintjobs per car.

The script expects 4 paintjobs and might crash or might not crash, if you have only one paintjob in the gta3.img. try it out, i dont know..

EDIT:
It wont crash. :)

Edited by uokka, 30 September 2011 - 10:10 AM.


#14 DMC88ELB

DMC88ELB

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 116 posts

Posted 27 August 2011 - 04:08 PM

Added the .txd's and .dff. This is what I get when I open a cold.s file:
Posted Image
Posted Image
That's right, it didn't let me copy, so I had to take a screenshot.

But this is what I get from the cold.txt file:
Posted Image
Posted Image

#15 DMC88ELB

DMC88ELB

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 116 posts

Posted 27 August 2011 - 04:24 PM

***Sorry about this Double Post***
Nevermind the above. I figured I'd compile the cold.txt into a cold.s file and use that. After making the modifications, I think the car.Defined(0@) needs to be changed to something, as it comes up with an error. I tried changing the 0@ to #SUPERGT, or 506@ (the code of the SUPERGT) but nothing seems to be working.

I'm going to call it a day...

Edited by DMC88ELB, 27 August 2011 - 04:39 PM.


#16 BttF_FAN

BttF_FAN

    Junior Time Traveler

  • Advanced Members
  • Pip
  • 23 posts

Posted 28 August 2011 - 11:06 AM

the problem is the car.defined it doesn't exsist

#17 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 28 August 2011 - 12:57 PM

{$CLEO .s}

  

  //-------------MAIN---------------

  03A4: name_thread 'COLD'

  0001: wait 0 ms

  32@ = 0  

  0AB4: 24@ = var 908

  if

	  not car.Defined(0@)

  then

	  wait 100

	  0AB4: 0@ = var 8

	  if

		  not car.Defined(0@)

	  then

		  0AAD: set_audiostream 24@ perform_action 0

		  0A93: end_custom_thread

	  end

  end
This code is only for reference. Dont use this, it should be there already.
If not, something similar..
Paste the code, which ices the DeLorean, right after that.

The variable 0@ got it's value already declared in timetravel.s, which has been shipped over to cold.s by execution parameter. Thats why the script is able to check if not car.Defined(0@). Even if you cannot see, in that script, where the value of 0@ comes from.
It contains the players car, and should not be #SUPERGT or CarID. It must be a variable.

Edited by uokka, 08 September 2011 - 03:34 PM.


#18 uokka

uokka

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 360 posts

Posted 02 September 2011 - 05:41 PM

*redundant*

Edited by uokka, 14 April 2012 - 07:22 PM.


#19 Thyncho88

Thyncho88

    Docs Assistant

  • Advanced Members
  • PipPipPip
  • 222 posts

Posted 16 May 2013 - 10:13 PM

Excellent Tutorial uokka!!  :good:







Also tagged with one or more of these keywords: ice, effect, texture, cleo, San Andreas, tutorial, Crysis