Guest Posted January 13, 2008 Share Posted January 13, 2008 Can someone give me piece of code for importing in custom map object? Few months ago i saw that you guys got "de_aztec" from CSS in MTA, i want to get in my .dff, .txd and .col into MTA, but im seeing only scripts for custom vehicle models. I hope you can help me. Link to comment
50p Posted January 13, 2008 Share Posted January 13, 2008 I guess it's same for objects. Try it yourself and see. Link to comment
MitchPS Posted January 13, 2008 Share Posted January 13, 2008 txd_floors = engineLoadTXD ( "models/office_floors.txd" ) engineImportTXD ( txd_floors, 3781 ) col_floors = engineLoadCOL ( "models/office_floors.col" ) dff_floors = engineLoadDFF ( "models/office_floors.dff", 0 ) engineImportCOL ( col_floors, 3781 ) engineReplaceModel ( dff_floors, 3781 ) But I do not know where the IDs of the objects can find Link to comment
50p Posted January 13, 2008 Share Posted January 13, 2008 You can always use MEd, built-in map editor in MTA:Race or wait until MTA:DM will have fully working map editor. Link to comment
Guest Posted January 14, 2008 Share Posted January 14, 2008 Probably im doing something wrong, but here's my code: (i used that riot_shield from seatlh gamemode) function customObj () txd_customObj = engineLoadTXD("riot_shield.txd") engineImportTXD(txd_customObj,1337) col_customObj = engineLoadCOL("riot_shield.col") dff_customObj = engineLoadDFF("riot_shield.dff", 0 ) engineReplaceCOL(col_customObj,1337) engineReplaceModel(dff_customObj,1337) end addEventHandler ( "onResourceStart", getRootElement(), customObj ) function mapLoad ( name ) -- create an object at a specified position with a specified rotation createObject ( 1337, 100, 100, 2, 90, 0, 0 ) end addEventHandler ( "onResourceStart", getRootElement(), mapLoad ) Console gives me error: ERROR: ..server/mods/deatchmatch/resources/mapload/mapload.lua:2: attemt to call global "engineLoadTXD" <a nil value> (In-game i just see object with ID 1337, not riot_shield). Link to comment
CJGrove Posted January 16, 2008 Share Posted January 16, 2008 Don't know if this works but you can try Rember! This is a CLIENT SIDE function so you need to use this in your meta file! function customObj () txd_obj = engineLoadTXD ( "riot_shield.txd" ) engineImportTXD ( txd_obj, 1337 ) col_obj = engineLoadCOL ( "riot_shield.col" ) engineImportCOL ( col_obj, 1337 ) dff_obj = engineLoadDFF ( "riot_shield.dff", 1337 ) engineReplaceModel ( dff_obj, 1337 ) end addEventHandler ( "onResourceStart", getRootElement(), customObj ) Link to comment
Guest Posted January 19, 2008 Share Posted January 19, 2008 Then i can't see anything. Maybe any developer can help me? I know you know how to do this. Link to comment
CJGrove Posted January 19, 2008 Share Posted January 19, 2008 Damn offcourse you cant see anything becose you didn't create the object? Link to comment
Guest Posted January 19, 2008 Share Posted January 19, 2008 Wrong. I did it, look at my code: function customObj () txd_obj = engineLoadTXD ( "riot_shield.txd" ) engineImportTXD ( txd_obj, 1337 ) col_obj = engineLoadCOL ( "riot_shield.col" ) engineImportCOL ( col_obj, 1337 ) dff_obj = engineLoadDFF ( "riot_shield.dff", 1337 ) engineReplaceModel ( dff_obj, 1337 ) end addEventHandler ( "onResourceStart", getRootElement(), customObj ) function mapLoad ( name ) -- create an object createObject ( 1337, 100, 100, 5, 90, 0, 0 ) end addEventHandler ( "onResourceStart", getRootElement(), mapLoad ) meta.xml: <meta> <info name="mapload" description="..." author="<Arvis>"/> <script src="mapload.lua" type="client" /> <file src="riot_shield.dff" /> <file src="riot_shield.txd" /> <file src="riot_shield.col" /> </meta> All files are in the same folder. Link to comment
CJGrove Posted January 19, 2008 Share Posted January 19, 2008 Did you used the good coordinates? Link to comment
50p Posted January 19, 2008 Share Posted January 19, 2008 Try to create the object after a few seconds, or using command. Link to comment
XetaQuake Posted January 19, 2008 Share Posted January 19, 2008 hi, i have a question first, look at these pictures http://www.mtasa.com/potd/15/mta-screen0042.png http://www.mtasa.com/potd/15/1mta-screen0022.png Now my questions: [1] whats called the full script to create new objects (not cars!)? [2] it is possibly to create the new models with a own ID like 9999999 ? because i dont want to replace a object in san andreas [3] can i have the southpark models or the race track? Link to comment
Guest Posted January 21, 2008 Share Posted January 21, 2008 hi, i have a question first, look at these pictures http://www.mtasa.com/potd/15/mta-screen0042.png http://www.mtasa.com/potd/15/1mta-screen0022.png Now my questions: [1] whats called the full script to create new objects (not cars!)? [2] it is possibly to create the new models with a own ID like 9999999 ? because i dont want to replace a object in san andreas [3] can i have the southpark models or the race track? Put up this script somewhere! upload plz ------------------------------ I do not speak in English! Link to comment
50p Posted January 21, 2008 Share Posted January 21, 2008 hi, i have a question first, look at these pictures http://www.mtasa.com/potd/15/mta-screen0042.png http://www.mtasa.com/potd/15/1mta-screen0022.png Now my questions: [1] whats called the full script to create new objects (not cars!)? [2] it is possibly to create the new models with a own ID like 9999999 ? because i dont want to replace a object in san andreas [3] can i have the southpark models or the race track? Put up this script somewhere! upload plz ------------------------------ I do not speak in English! He's asking questions not showing a script. 1. Can't remember this one. 2. As far as I know; no, it is not possible to add new object to game with its own ID. In SP it was quite possible. 3. If you show us your screenshots I guess you have them. BTW, I can't get texture to be loaded, don't know what may be wrong. Here are my screenshot and rendered object how it should look like: http://img88.imageshack.us/img88/1824/m ... 001xb4.png http://img182.imageshack.us/img182/5512/renderfc3.png Link to comment
XetaQuake Posted January 21, 2008 Share Posted January 21, 2008 3. If you show us your screenshots I guess you have them. lol this is not a model from me its from the Picture of the Day on MTASA.com BTW, I can't get texture to be loaded, don't know what may be wrong. Here are my screenshot and rendered object how it should look like: http://img88.imageshack.us/img88/1824/m ... 001xb4.png http://img182.imageshack.us/img182/5512/renderfc3.png 50p can you pleas tell me waht script you used to load this models? Link to comment
50p Posted January 21, 2008 Share Posted January 21, 2008 3. If you show us your screenshots I guess you have them. lol this is not a model from me its from the Picture of the Day on MTASA.com pwned, forgot about them! There ware so many screenshots that I can't remember them all, lol. BTW, I can't get texture to be loaded, don't know what may be wrong. Here are my screenshot and rendered object how it should look like: http://img88.imageshack.us/img88/1824/m ... 001xb4.png http://img182.imageshack.us/img182/5512/renderfc3.png 50p can you pleas tell me waht script you used to load this models? I used my own simple script. Placed it in a function and added to event: onClientResourceStart (obviously it is client-sided script) dff = engineLoadDFF( "map/box.dff", 2918 ) engineReplaceModel( dff, 2918 ) txd = engineLoadTXD( "map/box.txd", 2918 ) engineImportTXD( txd, 2918 ) Then just used command to create object '2918' (I can't remember which resource has that command). Col file is not required in my objects, because I attach it to the object itself. Link to comment
XetaQuake Posted January 21, 2008 Share Posted January 21, 2008 hmm but this is not the full script, can you give me it? and it is possibly to load the objekts when the server starts? not with a command Link to comment
50p Posted January 22, 2008 Share Posted January 22, 2008 Try this: function replaceTheObjs() dff = engineLoadDFF( "map/box.dff", 2918 ) engineReplaceModel( dff, 2918 ) txd = engineLoadTXD( "map/box.txd", 2918 ) engineImportTXD( txd, 2918 ) createObject( 2918, 0,0,3 ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), replaceTheObjs ) It is client-sided script. It should replace the object 2918 and load its texture, then create the object at given co-ords (when resource starts). You can do it in onPlayerConnect, but don't create object then, since you'd create lots of objects at the same place, causing slowing down all connected PCs. Link to comment
XetaQuake Posted January 22, 2008 Share Posted January 22, 2008 createObject( 2918, 0,0,3 ) 2918= ID 0= Coordinate 0= Coordinate 3= Coordinate Right? //EDIT: ok that is right, i have tried it. Thx 50p for all but i have the same problem: the object have no textur, it is white Link to comment
XetaQuake Posted January 23, 2008 Share Posted January 23, 2008 nobody knows why the objekts are white like http://img88.imageshack.us/img88/1824/m ... 001xb4.png ? Link to comment
50p Posted January 23, 2008 Share Posted January 23, 2008 I guess nobody. Similarly with vehicles, but I've had vehicles textured. Link to comment
XetaQuake Posted January 23, 2008 Share Posted January 23, 2008 Similarly with vehicles, but I've had vehicles textured. me too, vehicles are working perfectly But pleas help us to make a new object textured! i will starting modifi the world nobody knows why the objekts are white like http://img88.imageshack.us/img88/1824/m ... 001xb4.png ? Link to comment
Guest Posted January 24, 2008 Share Posted January 24, 2008 Well, i got some info and code, but i won't post it atm, it's long and bug-full, hopefully bugs will be fixed in future releases. (Please don't ask me for that piece of code via pm or in any other way, we should wait for next release). Link to comment
XetaQuake Posted January 24, 2008 Share Posted January 24, 2008 ok pleas post its when its bug free (For example when dp3 is released) Link to comment
XetaQuake Posted January 26, 2008 Share Posted January 26, 2008 any news? i want to have textures 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