Jump to content
  • 0

[ENGINE] DFF Replace Fails


Simple0x47

Question

Hello.

I'm writing this post because I'm facing problems with the function  engineReplaceModel . The thing is that I'm using DFF files that are loading correctly because the return value of engineLoadDFF is a DFF element but when I use it in the function nominated before, the function throws out a warning: "Bad usage of @ 'replace' [Model ID replace failed]". I'd really like to know the reason of this failed execution. Thanks.

Edited by Simple01
Link to comment

5 answers to this question

Recommended Posts

  • 0
-- ASSET OBJECTS STRUCTURE: { model=7047, model_file="3D8Ball", txd_file="3d8ball", coll_file="3D8Ball", lod=60 },

for i = 1, #assets do
  local asset = assets[ i ]

  if ( asset ) then
    local COL = EngineCOL( streamer_config[ 'map_data' ] .. "coll/" .. asset.coll_file .. ".col" )
    local TXD

    if not ( cache[ asset.txd_file ] ) then
      TXD = EngineTXD( streamer_config[ 'map_data' ] .. "textures/" .. asset.txd_file .. ".txd" )

      cache[ asset.txd_file ] = TXD
    else
      TXD = cache[ asset.txd_file ]
    end

    local DFF = EngineDFF( streamer_config[ 'map_data' ] .. "models/" .. asset.model_file .. ".dff" )

    COL:replace( tonumber( asset.model ) )

    if ( TXD ) then
      TXD:import( tonumber( asset.model ), true )
    end

    DFF:replace( tonumber( asset.model ) )

    Engine.setModelLODDistance( asset.model, asset.lod )
  end
end

The code is being executed at the start of the resource, so it's into a function that's handles the event "onClientResourceStart", and about the DFF's. They're all DFF's from the original GTA III converted to SA by using convdff,  here's a DFF that I'm using: http://www5.zippyshare.com/v/C6tkh6AA/file.html

 

Edited by Simple01
Added Asset Example
Link to comment
  • 0
  • MTA Team

Thanks. I get the same problem here - GTA is refusing to parse the file data.
Checking the file in a hex viewer shows an incompatible DFF version number. Are you sure convdff is converting the file correctly?

(BTW the error occurs at engineReplaceModel because engineLoadDFF just does some basic checks. The real work is done in engineReplaceModel)

 

 

Link to comment
  • 0
  • MTA Anti-Cheat Team

The convdff tool cannot be used to 'convert' (as in: port) models from earlier GTA games to SA, the version parameter is just meant for instancing between consoles / PC format.

If you want to port that model to SA, you gotta do so manually or find a modeller willing to, or else search for a tool actually capable of it. Porting it like that isn't as simple as just setting RW version to SA's. The debug error that you see in client/debugscript happens when a DFF is corrupt, has errors or is unloadable, the latter is the case here.

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