Jump to content

WorldObject isn't replaced with custom .dff


SoniX

Recommended Posts

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

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

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

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

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

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

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

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

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

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 :o

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

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