veronapl Posted September 2, 2009 Share Posted September 2, 2009 Hi. Sorry, not speak English. I can't replace building model in MTA. In single player (add to gta3.img and ipl file) is all good. In mta is not working This is code: addCommandHandler( "ob", function( ) outputChatBox ( "test!" ) txd = engineLoadTXD( "frankiesbase.txd" ) dff = engineLoadDFF( "franksclb02.dff", 0 ) col = engineLoadCOL( "indust.col" ) engineImportTXD( txd, 17520 ) engineReplaceModel( dff, 17520 ) engineReplaceCOL( col, 17520 ) outputChatBox ( "test!" ) end ) <meta> <info author="ver" version="1.2" type="script" name="ver" /> <script src="server.lua" type="client" /> <file src="franksclb02.dff" /> <file src="frankiesbase.txd" /> <file src="indust.col" /> </meta> All 3 files in script archive. 0 errors and warning in console. This is video: http://www.youtube.com/watch?v=xp_wY4tSIa4 Old model, old texture, not collision... Why? Help Link to comment
50p Posted September 2, 2009 Share Posted September 2, 2009 Try to create that object after you replaced it. And see if the created object is the same as the old object. Link to comment
veronapl Posted September 2, 2009 Author Share Posted September 2, 2009 Sorry 50p, how? Link to comment
veronapl Posted September 2, 2009 Author Share Posted September 2, 2009 addCommandHandler( "ob", function( ) outputChatBox ( "test" ) txd = engineLoadTXD( "frankiesbase.txd" ) dff = engineLoadDFF( "franksclb02.dff", 0 ) col = engineLoadCOL( "indust.col" ) createObject ( dff, 2462.79, -1784.22, 46.545, 0, 0, 0 ) outputChatBox ( "test" ) end ) This is don't working Not created object. Link to comment
50p Posted September 2, 2009 Share Posted September 2, 2009 Read that page again... And you better check your debug window (command: /debugscript 3). Link to comment
veronapl Posted September 2, 2009 Author Share Posted September 2, 2009 addCommandHandler( "ob", function( ) outputChatBox ( "test" ) txd = engineLoadTXD( "frankiesbase.txd" ) dff = engineLoadDFF( "franksclb02.dff", 17520 ) col = engineLoadCOL( "indust.col" ) engineImportTXD( txd, 17520 ) engineReplaceModel( dff, 17520 ) engineReplaceCOL( col, 17520 ) createObject ( 17520, 2462.79, -1784.22, 46.545, 0, 0, 0 ) This code create news obejct, and replace old object Why not texture (objects is white) and not collision? Link to comment
50p Posted September 2, 2009 Share Posted September 2, 2009 You did the right thing with engineLoadDFF before. Specify 0 as the 2nd argument if you're loading any model but vehicles. So, if you're loading new vehicle model you need to specify ID of vehicle you're replacing but if you're loading new object model use 0. Engine functions are not perfect and will never be. You will sometimes see white object without texture and sometimes you'll see texture loaded properly. Restarting resource sometimes help but not always. Sometimes you'll have to restart resource even 10 times to get textured models. That happens and is normal. Link to comment
veronapl Posted September 3, 2009 Author Share Posted September 3, 2009 Ahh model is white again Restart resource not help. Model is white, old collision: addCommandHandler( "ob", function( ) outputChatBox ( "test" ) dff = engineLoadDFF( "zam.dff", 0 ) txd = engineLoadTXD( "zam.txd", 17520 ) col = engineLoadCOL( "zam.col", 17520 ) engineReplaceModel( dff, 17520 ) engineImportTXD( txd, 17520 ) engineReplaceCOL( col, 17520 ) createObject ( 17520, 2462.79, -1784.22, 46.545, 0, 0, 0 ) outputChatBox ( "test" ) end ) Link to comment
subenji99 Posted September 4, 2009 Share Posted September 4, 2009 Always replace the Model LAST. (engineReplaceModel) Replace the TXD and the COL, then replace the Model. you can load them in any order however, as long as you always replace the model last. Link to comment
veronapl Posted September 4, 2009 Author Share Posted September 4, 2009 Always replace the Model LAST. (engineReplaceModel)Replace the TXD and the COL, then replace the Model. you can load them in any order however, as long as you always replace the model last. addCommandHandler( "ob", function( ) outputChatBox ( "test" ) dff = engineLoadDFF( "zam.dff", 0 ) txd = engineLoadTXD( "zam.txd", 0 ) col = engineLoadCOL( "zam.col", 0 ) engineImportTXD( txd, 17520 ) engineReplaceCOL( col, 17520 ) engineReplaceModel( dff, 17520 ) createObject ( 17520, 2462.79, -1784.22, 46.545, 0, 0, 0 ) outputChatBox ( "test" ) end ) DFF: Visible (ON) Col: ON Texture: Not Visible (OFF, model is white) 20x restart command, restart resource, not help Link to comment
subenji99 Posted September 4, 2009 Share Posted September 4, 2009 engineLoadCOL and engineLoadTXD only take 1 argument, the file to load. Also, even though I said it doesn't matter (because as far as I remember, it didn't when i tested it ), play around with the order of the load lines. Again the model itself is always best last. I'd go as far as trying replacing the txd and col THEN loading, then replacing the model, just to see if that works out. Link to comment
veronapl Posted September 4, 2009 Author Share Posted September 4, 2009 True. My object work!!! Texture, model and col work! Very very thanks 50p and Subenji99! You did the right thing with engineLoadDFF before. Specify 0 as the 2nd argument if you're loading any model but vehicles. So, if you're loading new vehicle model you need to specify ID of vehicle you're replacing but if you're loading new object model use 0.Engine functions are not perfect and will never be. You will sometimes see white object without texture and sometimes you'll see texture loaded properly. Restarting resource sometimes help but not always. Sometimes you'll have to restart resource even 10 times to get textured models. That happens and is normal. True Press /ob - model white, press /ob - model white, press /ob - texture in model, /ob - model white, /ob - texture.... -//- .... How to fix it? This is possible? Pleas help Link to comment
50p Posted September 4, 2009 Share Posted September 4, 2009 ...True Press /ob - model white, press /ob - model white, press /ob - texture in model, /ob - model white, /ob - texture.... -//- .... How to fix it? This is possible? Pleas help No. Link to comment
veronapl Posted September 4, 2009 Author Share Posted September 4, 2009 ...True Press /ob - model white, press /ob - model white, press /ob - texture in model, /ob - model white, /ob - texture.... -//- .... How to fix it? This is possible? Pleas help No. Ahh ok, thanks for help!!! 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