Skip to content

Releases: Fernando-A-Rocha/mta-add-models

v6.0.1

14 Nov 12:14
f9a4e98

Choose a tag to compare

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_list way of loading new models (inspired by how it worked in newmodels v3)

Your mod_list.lua from newmodels v3 will work and will load your files without change (except maybe update the paths of the files)!

  • Added server-side functions addExternalModels and removeExternalModels (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 to sampobj_red) will be able to add new models from their own resource!

  • Added feature that uses downloadFile to 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

26 Feb 15:39
fcf8cd2

Choose a tag to compare

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

20 Feb 16:51
f09f385

Choose a tag to compare

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_decrypter script (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

14 Feb 11:50
eb27cdc

Choose a tag to compare

⚠️ 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

03 Sep 12:25
48bb0b7

Choose a tag to compare

A more recent version is out, don't download this!

v3.3.0

17 Sep 19:40
46b588b

Choose a tag to compare

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

07 Sep 18:16
f2e0401

Choose a tag to compare

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

09 Mar 16:21
595009b

Choose a tag to compare

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

06 Feb 13:15
60cf049

Choose a tag to compare

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.

⚠️Please read the documentation, in particular the examples which use newmodels-engine to simplify the implementation process.

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