-
-
Notifications
You must be signed in to change notification settings - Fork 454
Add ability to replace clump model with atomic and vice-versa #4052
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
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") |
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.