Add ability to replace clump model with atomic and vice-versa#4052
Add ability to replace clump model with atomic and vice-versa#4052FileEX wants to merge 20 commits intomultitheftauto:masterfrom
Conversation
|
Is it possible to use a general solution? It looks like automatic conversation may break some models. |
Yes, you're probably right. This could be backwards incompatible in some way, and additionally, automatically 'guessing' the model type is quite problematic and results in more complex code. I think this solution is appropriate, allowing the user to define which model type should be created |
|
I added engineConvertModelToType to convert the model to another type (atomic, clump, damageable-atomic, timed object). I tested this in many different variations to eliminate as many crashes as possible. I think the PR is ready, as I haven't observed any new crashes. The default behavior is the same as before, meaning only one atomic is replaced bool engineConvertModelToType(number modelId, string newType = "object" | "timed-object" | "damageable-object" | "clump") |
|
Merge this and #4555, please |
Fixed #3699
Until now, when replacing an atomic model with a clump model, only one atomic was visible in the game. On the other hand, when replacing a clump model with an atomic model, the function would either return false or cause a crash.
Now MTA also supports replacing clump-type objects. However, to maintain backward compatibility, models are not automatically converted based on the number of atomics. If you want to replace an atomic-type object with a clump-type object, you need to convert it using the function below
Syntax
Once this PR is merged, the next item on my to-do list is object animations.