DakiLLa Posted March 24, 2009 Share Posted March 24, 2009 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
50p Posted March 24, 2009 Share Posted March 24, 2009 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
Lordy Posted March 24, 2009 Share Posted March 24, 2009 Wiki tells about engineImportTXD: This function imports a RenderWare Texture Dictionary into the model identified by the model id. This is necessary in order for the DFF loader to find any new textures. This does however not replace the original textures of the model. That means you need to load DFF too. See the wiki example on euros http://development.mtasa.com/index.php? ... ineLoadDFF Link to comment
DakiLLa Posted March 24, 2009 Author Share Posted March 24, 2009 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
Lordy Posted March 24, 2009 Share Posted March 24, 2009 It would be great if you actually read the full article at wiki about engineLoadDFF not just the syntax part. http://development.mtasa.com/index.php? ... ineLoadDFF, third line And if you actually heeded my advice of seeing the wiki example you would have seen the need of engineReplaceModel too Link to comment
DakiLLa Posted March 25, 2009 Author Share Posted March 25, 2009 great, ty man, works perfect. next time i will read wiki more carefully Link to comment
Guest Posted April 3, 2009 Share Posted April 3, 2009 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
Lordy Posted April 3, 2009 Share Posted April 3, 2009 What is a nil value? Do you have client or server side? (just making sure) Link to comment
zorrigas Posted April 4, 2009 Share Posted April 4, 2009 How do I get the ids of textures? I have several textures that replace eg billbox.txd, billbrd01_lan.txd, etc. Link to comment
Gamesnert Posted April 4, 2009 Share Posted April 4, 2009 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? Link to comment
zorrigas Posted April 13, 2009 Share Posted April 13, 2009 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 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now