Jump to content

[Help]Custom object confusion


Xierra

Recommended Posts

Hi guys!

I just now downloaded Shanghai International Speedway and I found things inside the .img

There is around 4 dff items, but only one txd.

Can you tell me how to properly import these?

Script:

function replaceDFF()
dff=engineLoadDFF("hjp03.txd")
engineImportDFF(dff, 3914)
dff1=engineLoadDFF("hjp04a.dff")
engineImportDFF(dff1, 3911)
dff2=engineLoadDFF("hjp04b.dff")
engineImportDFF(dff2, 3910)
dff3=engineLoadDFF("hjp04c.dff")
engineImportDFF(dff3, 3906)
 
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceDFF)
 
function replaceTXD() 
 
txd = engineLoadTXD("chinaspeed.txd")
engineImportTXD(txd, 9482)
 
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceTXD)

Link to comment
model_id: The model id that should be associated with the dff, when loading a vehicle. Always specify 0 if you are replacing something else than a vehicle.

Where did you find engineImportDFF? Such function doesn't exist unless you created it in your script.

If you have only one txd that probably means it's a shared texture and can be used with all of the .dffs you have. Load texture once and import it for different models. Like so:

dff = engineLoadDFF( "hjp03.dff", 0);
engineReplaceModel( dff, 3914 );
dff = engineLoadDFF( "hjp04a.dff", 0 );
engineReplaceModel( dff, 3911 );
dff = engineLoadDFF( "hjp04b.dff", 0 );
engineReplaceModel( dff, 3910 );
dff = engineLoadDFF( "hjp04c.dff", 0 );
engineReplaceModel( dff, 3906 );
 
txd = engineLoadTXD( "chinaspeed.txd" );
engineImportTXD( txd, 3906 );
engineImportTXD( txd, 3910 );
engineImportTXD( txd, 3911 );
engineImportTXD( txd, 3914 );

Link to comment

LOD can't be greater than 500. If it's lower than that and you want it to be 500, you can set it with engineSetModelLODDistance.

If textures aren't loaded, load them again. It's been said many time on this forum... You can make a function to load textures and players can call it when textures need to be reloaded (can be onClientResourceStart or command or both).

Link to comment
I already know about the white textures, but I already tried to restart it many times, but still white... why?

(oh yeah, I loaded it on Map Editor. Added col)

No idea. It happens to everyone, even after restarting client or reconnecting. You have to keep trying.

Also, make sure your .txd has a texture that model asks for. You can use TXD Workshop to do that.

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