SoniX Posted January 23, 2013 Share Posted January 23, 2013 Hello dear community, I have a problem with replacing one of the world models with my custom model which I've edited in 3dsMax. I wanted to start making a mall but then I noticed that my custom model isn't replaced with the existing world model. When I start my resource to replace it the object blurs out for a sec and fades back to it's normal state. There are no errors, nothing. http://i.imgur.com/6984rRR.jpg Then I accidently copied the object and on it there was my custom model! http://i.imgur.com/MfOAS2g.jpg As you can see the copied object has my model but the object which is in the GTA World as a standard object is unmodelled. How can I solve it ? I've tried to remove the world model and add the modeled one as a .map but this didn't work as well .. (the object itself wasn't even removed..) That's my code : malldff = engineLoadDFF("vgnshopnmall02.dff", 0) engineReplaceModel(malldff, 6944) -meta- <file src="vgnshopnmall02.dff" /> May you help me please? Link to comment
-stolka- Posted January 23, 2013 Share Posted January 23, 2013 1) you should spcify in the meta.xml the type="client" 2)on the first line that '0' must be repalaced with the ID malldff = engineLoadDFF("vgnshopnmall02.dff", 6944) engineReplaceModel(malldff, 6944) Link to comment
SoniX Posted January 24, 2013 Author Share Posted January 24, 2013 I've tried but had no success.. That's my code function dfftxd () engineReplaceModel(engineLoadDFF("vgnshopnmall02.dff", 6944), 6944) engineImportTXD(engineLoadTXD ("vgnshopnmall.txd"), 6944) engineReplaceCOL(engineLoadCOL ("vgnshopnmall.col"), 6944 ) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), dfftxd ) -meta- <meta> <info author="Sonix" type="script" name="TestScript" description="banana" /> <script src="server.lua" type="server" /> <script src="client.lua" type="client" /> <file src="vgnshopnmall02.dff"/> <file src="vgnshopnmall.txd" /> <file src="vgnshopnmall.col" /> </meta> Link to comment
-stolka- Posted January 24, 2013 Share Posted January 24, 2013 try this function dfftxd() txd = engineLoadTXD("vgnshopnmall02.txd", 6944 ) engineImportTXD(txd, 6944) dff = engineLoadDFF("vgnshopnmall02.dff", 6944 ) engineReplaceModel(dff, 6944) col = (engineLoadCOL ("vgnshopnmall.col") engineReplaceCOL(col , 6944 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), dfftxd) Link to comment
SoniX Posted January 24, 2013 Author Share Posted January 24, 2013 That's the same what I've done but not that compact as mine.. Eventhough I've tried it , it doesn't work. Link to comment
DiSaMe Posted January 24, 2013 Share Posted January 24, 2013 Everything is fine with your primary script. Model replacement only has effect when at least one MTA element with that model is streamed in. Probably the simplest way to do what you want would be creating an object with the same model in the same place where the world model is and making it invisible and non-solid using these functions: createObject setElementAlpha setElementCollisionsEnabled When you do this, the object itself won't interact with the world, but because it is streamed in when you approach it, it will cause the model replacement to be visible and in result, the world object will change. Link to comment
SoniX Posted January 25, 2013 Author Share Posted January 25, 2013 Crystal, when i try your method then both of the objects are streamed in and visible .. the main building is also off setted and the whole thing is weirdly placed.. Are there also more possibilities to solve the replacement ? By "weirdly placed" i mean this : As long as you are at a specific distance it streams allright http://i.imgur.com/r39PlhN.jpg But after you approached it some more the building of the gta world moves itself away.. http://i.imgur.com/MJqUgbc.jpg Dafuq is MTA doing ??? Link to comment
DiSaMe Posted January 25, 2013 Share Posted January 25, 2013 When you are far from the object, it's invisible. Its low LOD counterpart is shown instead. When you approach the object, it becomes visible. As long as the object which you created is in the exact same position as the world object and alpha/collisions are set to 0/false, there should be no problems - the only effect should be model replacement for the world object. I can't think of anything else to change. Link to comment
SoniX Posted January 25, 2013 Author Share Posted January 25, 2013 The object I've created doesn't have the same coordinates as the GTA World object itself .. I've adjusted my object as close as I could to the original object.. I've tried several ways to get the created object streamed in .. the model replaces .. but as you see on the second screen the main object moves back .. Is there something I could do wrong ? I guess not .. Link to comment
DiSaMe Posted January 25, 2013 Share Posted January 25, 2013 Well, then you could try another way. Remove the original object with the function: removeWorldModel And then just create the object in the same place. Link to comment
SoniX Posted January 25, 2013 Author Share Posted January 25, 2013 I've tried.. removeWorldModel (6944, 1000, 2834.6896972656, 2502.234375, 15.611503601074, 0) but well... the object isn't even deleted when I try this... Link to comment
DiSaMe Posted January 25, 2013 Share Posted January 25, 2013 Did you only remove the main object or its low LOD object as well? Link to comment
SoniX Posted January 25, 2013 Author Share Posted January 25, 2013 As you see I've only removed the object.. (at least tried it..) I don't even know if it has a LOD.. Link to comment
DiSaMe Posted January 26, 2013 Share Posted January 26, 2013 From the image which you posted (http://i.imgur.com/r39PlhN.jpg) I can see it does because resolution of the object texture is very low in that image. If you see the same low LOD model when you approach the object, that means the high-detail object has been removed successfully and you just need to do the same with lod LOD object. But if the main object is still present, I have no idea what the problem could be. Link to comment
SoniX Posted January 26, 2013 Author Share Posted January 26, 2013 Ye the LOD is removed and there is the main high detailed object .. but well as you see it "moves" away and is wrong palced .. else it would work .. Could you try to remove it with a script ? Maybe I did something wrong .. Just remove it so there is a hole in the world at this spot. If you have time ofc. Link to comment
DiSaMe Posted January 26, 2013 Share Posted January 26, 2013 How did you edit the model? The world object cannot just move when replacing the model. Maybe you edited it in such way that its all vertices are moved, resulting in movement of its geometric center while the object position remains the same? Link to comment
SoniX Posted January 26, 2013 Author Share Posted January 26, 2013 I've imported it in 3dsMax and then edited as always . The vertices are on the right places .. I've tried to import the unmodded object and it was exacly on the same position (with all the vertices and stuff) .. //EDIT Ok it is the model .. but I don't understand how the model could be fucked up so hard and moved to another place ?? now should I really adjust the model to fit it in the right place ? this might take hours //Edit 2 Okay it was definetly a modeling failure... I've attached the whole thing to a pillar and not the pillar to the main ... Thats why the center moved .. you were right thx. I'm stupid :3 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