Jump to content

Custom Paintjobs & Mods


Buffalo

Recommended Posts

Hi,

As title says, is it possible? I'm pretty sure it is, but forgot how exactly its done. Snipet would be perfect.

EDIT: Is it possible to add mods aswell?

BTW, anyone having trouble connecting to mta irc channel?

Edited by Guest
Link to comment

I'll give you an example of what I've got to do custom paintjobs though.

Client sided -

local shaderPJ = dxCreateShader ( "texture.fx" ) 
local shaderPJ2 = dxCreateShader ( "texture.fx" ) 
local shaderPJ3 = dxCreateShader ( "texture.fx" ) 
  
--Elegy paintjob 1 
function elegyPaintjob1( ) 
        local elegyPaintjob1 = dxCreateTexture ( "paintjobs/pj1.png") 
        dxSetShaderValue ( shaderPJ, "gTexture", elegyPaintjob1 ) 
        engineApplyShaderToWorldTexture ( shaderPJ, "elegy1body256" )    
    end 
addEventHandler ( "onClientResourceStart", resourceRoot, elegyPaintjob1)     
--Elegy paintjob 2 
function elegyPaintjob2( ) 
        local elegyPaintjob2 = dxCreateTexture ( "paintjobs/pj2.png") 
        dxSetShaderValue ( shaderPJ2, "gTexture", elegyPaintjob2 ) 
        engineApplyShaderToWorldTexture ( shaderPJ2, "elegy2body256" )   
    end 
addEventHandler ( "onClientResourceStart", resourceRoot, elegyPaintjob2)     
--Elegy paintjob 3 
function elegyPaintjob3( ) 
        local elegyPaintjob3 = dxCreateTexture ( "paintjobs/pj3.png") 
        dxSetShaderValue ( shaderPJ3, "gTexture", elegyPaintjob3 ) 
        engineApplyShaderToWorldTexture ( shaderPJ3, "elegy3body256" )   
    end 
addEventHandler ( "onClientResourceStart", resourceRoot, elegyPaintjob3) 
  
 

You see elegy1body256? Ofcourse you do, that is the name of the first paintjob.

You can find those Id's in the .txd files, use txdworkshop to find em. elegy.txd or savanna.txd etc.

 

texture.fx:

texture gTexture;

technique TexReplace
{
    pass P0
    {
        Texture[0] = gTexture;
    }
}

 

Link to comment

Not with this method, no. You can change it (using shader tech) for all the models at once, but whats the point of modding then, right?

At this point we have this: paintjobs can be changed for default vehicles, that accepts paintjobs, and also sometimes on modded cars.

Is it possible to add other modifications to vehicle?

Link to comment
@NL_Jelle : how you get this name "elegy1body256" ?
You can use shader_tex_names (thanks ccw) to find texture names to use with engineApplyShaderToWorldTexture.

You can download it from the wiki.

source: posting.php?mode=quote&f=91&p=370146

Your source = posting in this topic. Please check your links before posting a reply...

Oh my... that was stupid. Well here is the real source;

viewtopic.php?f=91&t=35778

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...