Releases: Fernando-A-Rocha/mta-add-models
v6.0.1
Newmodels v6 (codename Red 🍒)
Main changes:
- Updated documentation markdown files
Multiple README's have been updated, including a brand new Migration guide to migrate from previous versions to Newmodels v6.
- Added
mod_listway of loading new models (inspired by how it worked in newmodels v3)
Your
mod_list.luafrom newmodels v3 will work and will load your files without change (except maybe update the paths of the files)!
- Added server-side functions
addExternalModelsandremoveExternalModels(exported) for loading new models from external resources (inspired by how it worked in newmodels v3)
Resources like
sampobj_reloaded(which has been rewritten and renamed tosampobj_red) will be able to add new models from their own resource!
- Added feature that uses
downloadFileto download model files only when they are needed, instead of on resource start
This existed on newmodels v3 to download model files just before applying them, so they are not included in the initial server download for the player. This is very useful for SA-MP objects, which now won't occupy megabytes of the DL size, and will only download on demand!
- Added dev command
checkmodelid
Runs only on server console. Useful for checking if a model ID is a default GTA ID or a custom model, and what it's registered as.
- Added custom event
"newmodels_red:preDownloadNewModels"for developers to pre-download a list of model files.
Developers may want to decide when files should be downloaded to later speed up loading of new models. Usage:
triggerEvent("newmodels_red:preDownloadNewModels", localPlayer, { <customModelId1>, <customModelId2>, ... })
Conclusion:
These main new features make it possible to now easily migrate from newmodels v3, because we've achieved feature parity with that version. I'm sorry for having removed these features in newmodels v4 and v5 with the simplified file-based loading method (still available).
Documentation is available!
Don't forget the main README file which contains all you need to know!
v5.2.0
Newmodels v5.2.0 (Codename Azul 💙)
Changelog
Changes since previous version (v5.1.0):
- Updated default object ID verification to include the CJ clothing component IDs
- Added spawnPlayer function override and exported that supports custom model ID as skin ID argument. Previously you had to manually re-apply/set the player's skin using setElementModel after using spawnPlayer with the base model skin ID.
Documentation is available!
Don't forget the main README file which contains all you need to know!
v5.1.0
Newmodels v5.1.0 (Codename Azul 💙)
Changelog
Additions since previous version (v5.0.0):
- New function
getCustomModelName(id)to obtain the custom name (string) defined for a custom model ID - NandoCrypt files (.nandocrypt) support. Mod files with this extension (.dff.nandocrypt, .txd.nandocrypt, .col.nandocrypt) will now get automatically decrypted and loaded thanks to your
nando_decrypterscript (one is included for testing).
Documentation is available!
Don't forget the main README file which contains all you need to know!
v5.0.0
⚠️ A newer version has been published, check the latest release! ⚠️
Newmodels v5 (Codename Azul 💙)
This version (v5) changes the core and exported scripts to no longer use element data!
The principle stays the same, models are synced automatically and as a developer you don't need to worry about anything!
Good bye element data!
Now the custom model IDs of elements are stored in a table on the server that gets synced to all clients whenever it is updated and when a client starts the resource.
To prevent memory leaking, this table is properly cleared when elements are destroyed both on the client and server.
Documentation is available!
Don't forget the main README file which contains all you need to know!
v4.0.0
A more recent version is out, don't download this!
v3.3.0
Please do not use this version, check the latest release!
Changes:
- Fixed vehicle handling sync for added models!
The previous implementation would cause severe server lag if used in many vehicles & with many players online. This is safe now.
-
Updated isDefaultID with MTA 1.6 new skin IDs (ped models)
-
Added 2 missing aclrequest permissions to newmodels
Enjoy !! ❤️
v3.2.0
Changelog
- refreshStreamedInElements fix => frees all allocated IDs when mod list is received to prevent conflicts
- added engineLoadTXD optional param (default true): filteringEnabled
- added engineReplaceModel optional param (default false): alphaTransparency
- updated minimum client & server version to MTA 1.6 🥳
As always don't forget to leave feedback. Check out the MTA forum thread that links to an active Discord discussion thread.
v3.1.0
This release doesn't break anything. The previous 3.0.0 release remains stable, although I recommend updating :-)
Revamped Exported Functions
⚡️ Cleaner & Easier to Use
✔️ Backwards Compatible
- addExternalMods_IDFilenames
- addExternalMod_IDFilenames
- addExternalMods_CustomFileNames
- addExternalMod_CustomFilenames
- removeExternalMods
Changes the format of the modInfo list passed as argument to addExternalMods_IDFilenames and addExternalMods_CustomFileNames.
Adds a new optional argument "onFinishEvent" to addExternalMods_IDFilenames, addExternalMods_CustomFileNames and removeExternalMods.
Functions addExternalMod_IDFilenames and addExternalMod_CustomFilenames can now receive a table with options instead of all the argument variables.
Using the old argument formats in the functions will output a warning to the debug console.
Updated sampobj_reloaded and vehicle_manager examples to reflect these changes and use the new function formats.
Updated documentation (please read).
Thank you
Rick for suggesting these enhancements.
v3.0.0
Release Notes
⚠️ Check your custom code (need to update)
This update permenantly fixes element model logic.
Now, client or server newmodels scripts never listen to element model change. You are responsible for using setElementModel in your scripts, and setting custom model ID element data.
Some explanations
In the past, the element model was being altered by newmodels (using performance-heavy debug hooks) because I thought that it was necessary due to how the engineRequestModel & engineFreeModel features worked. This belief was wrong.
Model serverside always remains the same for an element. It is changed on the client to the allocated/requested ID when set, and it restores the parent/base model ID when the allocated ID is freed automatically. Before, I thought that it didn't restore the parent/base model ID clientside and the element stayed with an "allocated/requested" model ID even after it was freed, this was proved incorrect by time and testing.
What to do
For example, If you have a player with custom skin ID data set, and you want to switch it to a default skin ID, you need to set the custom skin data to nil and do setElementModel. This used to be handled "automatically", however it was unnecessarily performance-heavy.
Check this example for how to spawn a player properly because the use of spawnPlayer requires special attention.
Changes
- Removed unnecessary & breaking element model change logic (such as doing set element model refresh, it only caused additional issues)
- Replaced newmodels-example with vehicle_manager