DragonFF icon indicating copy to clipboard operation
DragonFF copied to clipboard

Exporting a model with embedded collisions

Open kylesmyrk opened this issue 4 years ago • 5 comments

Is it possible to replicate kdff and have collisions embedded within a .DFF file?

I'd like to export models and use them in AddSimpleModel on SAMP, and from what I gather, it should be possible by duplicating the mesh and setting it as a collision object before exporting, but no luck.

Anything I export has no collisions in-game. Is this a feature?

kylesmyrk avatar Feb 20 '21 17:02 kylesmyrk

It is possible to have collisions embedded within a .DFF file, it's already the case in most if not all vehicle models in SA. While exporting, there is an option to "Export Collisions" alongside other options like Mass Export or the version of the file. If it doesn't work despite of enabling that, it might be an issue with how you import it in-game.

Parik27 avatar Feb 20 '21 20:02 Parik27

Interesting, that's been the approach but no luck.

I'm no expert on this, but doing a bit of my own research, I can see that the DFF file structure uses 0x0253F2FA for collisions, which I can see is being used when exporting the DFF file. Is that just for vehicle collisions by any chance?

My use case is for game objects such as buildings, etc.

kylesmyrk avatar Feb 20 '21 21:02 kylesmyrk

Interestingly, looking into what kdff outputs, the collisions use 0x253F2FF instead.

After amending the Collision Model block type to use that ID, and importing a collision object into the game, it has all of its collisions as expected.

Is there any particular reason as to why this is?

kylesmyrk avatar Feb 20 '21 21:02 kylesmyrk

Hmm, that's interesting. I could add an option to select which type of collision to export from the model. I couldn't find any documentation for type 0x253F2FF, but I suppose it could be an extension by SAMP or kdff.

Parik27 avatar Feb 22 '21 00:02 Parik27

Seeing as kdff was released by Kalcor around the same time as custom model support (I think?), it suggests that the new type is something that SAMP uses internally.

The ability to select which type of collision would be ideal.

kylesmyrk avatar Feb 22 '21 10:02 kylesmyrk