Jump to content

txd replacing problem..


DakiLLa

Recommended Posts

hi. i've added new objects on map and i want to replace a texture of 2 object models..

I thought that i've made it correctly, but i still have stock textures on this objects..

I have placed two txd's in my .zip resource, written meta and lua script..Resource works withouat ANY errors, but nothing happens..

I've checked names of txds that i've placed into resource, they have the same names as in meta.

Ok, here is a code from meta and lua files:

meta:

<file src="blbr1.txd" /> 
<file src="blbr2.txd" /> 

client:

gResRoot = getResourceRootElement ( getThisResource () ) 
  
addEventHandler ( "onClientResourceStart", gResRoot, 
    function () 
        --Lets relplace them! 
         
        blbrd1 = engineLoadTXD ( "blbr1.txd" ) 
        blbrd2 = engineLoadTXD ( "blbr2.txd" ) 
         
        engineImportTXD ( blbrd1, 4730 ) 
        engineImportTXD ( blbrd2, 9191 ) 
         
    end 
) 

can anybody help me solve this problem?

Link to comment

It should stay as

It reloads the old texture when resource stops and it should replace it when resource starts (at least in your case).

- Is the script added in meta.xml as client-side script?

- Add some outputChatBox/DebugString to find out if the event is triggered.

Link to comment

Well, the type of the script is 'client' as should be.

I've placed debug lines and loaded Dff, but still nothing...

addEventHandler ( "onClientResourceStart", gResRoot, 
    function () 
        --Lets relplace them! 
         
        dff = engineLoadDFF ( "billbrdlan2_03.dff", 0 ) 
        outputDebugString ( "Dff loaded" ) 
        txd = engineLoadTXD ( "billbrd01_lan2.txd" ) 
        outputDebugString ( "Txd loaded" ) 
        engineImportTXD ( txd, 4730 ) 
        outputDebugString ( "Txd replaced" ) 
         
        dffTwo = engineLoadDFF ( "vgeastbillbrd03.dff", 0 ) 
        outputDebugString ( "Dff2 loaded" ) 
        txdTwo = engineLoadTXD ( "vgebillboards.txd" ) 
        outputDebugString ( "Txd2 loaded" ) 
        engineImportTXD ( txdTwo, 9191 ) 
        outputDebugString ( "Txd2 replaced" ) 
         
    end 
) 

i see all debug lines, so, script isnt breaking anywhere..

May be it's a lag of dp-s so i dont need to test it on dp, and may be i should to wait for 1.0.. idk.

Link to comment
  • 2 weeks later...

To save posting a new thread ima just reply here

       txd = engineLoadTXD ( "data/banshee.txd" ) 
    engineImportTXD ( txd, 429 ) 
    dff = engineLoadDFF ( "data/banshee.dff", 429 ) 
    engineReplaceModel ( dff, 429 ) 
         
     end 

Can anyone help me it sais its a nil value when i try to run it, ty

Link to comment
  • 2 weeks later...
You just enter the object ID which you want to place.

For instance, I want to replace 1337 (garbage bin) with a much 1337er garbage bin, I'd need to use 1337. ;)

Or did you mean something else?

mmmm got the idea.

What I want to do is replace all the advertisements are in the game, try what you told me ....

Thanks :P

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