Jump to content

Help with custom hydra texture replacer


Threule

Recommended Posts

Hello, I have a custom Hydra (actually is a Tomcat) and I want to add the paintjobs to it, and i dont know why my scripts dont work.

meta.xml

            "Bla" version="Bla" type="script" name="" description="" showInResourceBrowser="false" /> 
            

script.lua

    addEventHandler( "onClientResourceStart", resourceRoot, 
        function() 
        
            texture = dxCreateTexture ( "/hydra/remaphydrabody.png" ) 
            shader, tec = dxCreateShader( "texturereplaceshader.fx" ) 
            
            --bit of sanity checking 
            if not shader then 
                outputConsole( "Could not create shader. Please use debugscript 3" ) 
                destroyElement( texture ) 
                return 
            elseif not texture then 
                outputConsole( "loading texture failed" ) 
                destroyElement ( shader ) 
                tec = nil 
                return 
            else 
                engineApplyShaderToWorldTexture ( shader, "hydra1body256" ) 
                dxSetShaderValue ( shader, "gTexture", texture ) 
            end 
            
        end 
    ) 

texturereplaceshader.fx

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

And yes, the tomcat technically supports custom paintjobs.

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...