Skip to content

Commit c6178fa

Browse files
Newmodels v6 (codename Red 🍒)
PR #67
2 parents 59888a3 + f4c82d0 commit c6178fa

86 files changed

Lines changed: 3242 additions & 474 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/img/ss1.png

-1.03 MB
Binary file not shown.

.github/workflows/linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
- name: Lint mta resources
1616
run: |
1717
echo 'ignore = {"512", "122","142","111","341","112","113","143","321","631","211","212","213","611","612","621"}' > config.lua
18-
luacheck --config config.lua ./
18+
luacheck --exclude-files '**/*async.lua' --config config.lua ./

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
# `Newmodels v5 Azul 💙`
1+
# `Newmodels v6 Red 🍒`
22

33
This MTA resource makes use of the clientside allocated models ([engineRequestModel](https://wiki.multitheftauto.com/wiki/EngineRequestModel) and related features) to add new peds (skins), vehicles and objects:
44

5-
- place your mods (dff/txd/col files) in designated folders that are automatically detected
5+
- there are 3 methods to add new models:
6+
- [1] place mod files (dff/txd/col files) in designated folders that are automatically scanned
7+
- [2] place mod files anywhere you want and list them in the mod list lua script
8+
- [3] dynamically load new models from external resources using exported functions
69
- the system syncs all added models with all players
7-
- use a simple trick in your existing scripts to work with the new model IDs
10+
- use a simple trick in your existing scripts to work with the new model IDs, or use the provided exported functions
811
- it's minimalistic, optimized and robust
912

10-
With this resource you can make scripts or change your existing scripts to add new skin, vehicle and object IDs to your server! For example, you may add all SA-MP object models!
13+
With this resource you can make scripts or change your existing scripts to add new skin, vehicle and object models to your server! For example, you may add all SA-MP object models!
1114

1215
## Docs/Tutorial
1316

14-
🚀 **Are you new to this resource?** Start here: [Documentation file](/.github/doc/DOCUMENTATION.md)
17+
🚀 **Are you new to this resource?**
18+
19+
Start here: [DOCUMENTATION.md file](/newmodels_red/DOCUMENTATION.md)
1520

1621
## Download
1722

18-
⚠️ **Before you download and install this resource**, ensure you meet the requirements specified in the [Documentation](/.github/doc/DOCUMENTATION.md).
23+
⚠️ **Before you download and install this resource**, ensure you meet the requirements specified in the **Documentation** linked above.
1924

2025
Get the [Latest Version](https://github.com/Fernando-A-Rocha/mta-add-models/releases/latest) from the **Releases** section.
2126

22-
## Older versions
23-
24-
It is easy to migrate to v5 from newmodels v4 (not from v3; the architecture of that version is no longer used). The **models folder structure remains the same**, but the scripts have changed in the way models are applied to elements.
27+
## Migrating from Older versions
2528

26-
This resource no longer uses and relies on the **MTA Element Data system** (`setElementData`) to sync the models to all clients! Instead, newmodels makes use of Lua tables and MTA events. This major change was made to **improve performance** and control the sync of models more efficiently.
29+
Please refer to the **Migration Guide** in the [MIGRATION.md file](/newmodels_red/MIGRATION.md).
2730

2831
## Community
2932

3033
Visit the [Thread on the MTA Forum](https://forum.mtasa.com/topic/133212-rel-add-new-models-library/) to get in touch with fellow users and developers.
3134

32-
## Media
33-
34-
![Screenshot 1](/.github/img/ss1.png)
35-
3635
## Final Note
3736

3837
Feel free to update the documentation in this repository, and contribute to the code via pull requests.

[examples]/sampobj_red/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# `sampobj_red`: SA-MP Objects for Newmodels v6
2+
3+
With [`newmodels_red`](https://github.com/Fernando-A-Rocha/mta-add-models) (and `sampobj_red` resource) you can add all of [SA-MP's object models](https://dev.prineside.com/en/gtasa_samp_model_id/tag/2-sa-mp/) to your server, so you can use them to create custom maps, or spawn objects using Lua scripts.
4+
5+
## Large Size ⚠️
6+
7+
There are over 1,400 SA-MP object models! It is recommended to keep `download="false"` in the resource's `meta.xml` as well as `metaDownloadFalse=true` in `server.lua` to prevent clients from downloading all the models when they join your server.
8+
9+
## How to install
10+
11+
1. [Download](https://www.mediafire.com/file/mgqrk0rq7jrgsuc/models.zip/file) `models.zip` containing all dff/txd/col files required (total of 4,297 files; 404 MB when extracted)
12+
2. Extract the contents of the zip to [sampobj_red/models/]([examples]/sampobj_red/models/) folder.
13+
14+
You're done! Newmodels will load the new models automatically when you start the `sampobj_red` resource. Their IDs are exactly the same as the IDs used in SA-MP.
15+
16+
You may test spawning a SA-MP object using the newmodels test commands. E.g. `11686` ([is a bar counter](https://dev.prineside.com/en/gtasa_samp_model_id/model/11686-CBarSection1/)).
17+
18+
## Media
19+
20+
![Example](./sampobj.png)

[examples]/sampobj_red/meta.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<meta>
2+
<!-- This resource is available in the repository below.
3+
Its version matches the main newmodels version!
4+
https://github.com/Fernando-A-Rocha/mta-add-models -->
5+
6+
<info author="Fernando" name="SAMP Objects Red"
7+
description="uses newmodels functions to add all SA-MP objects"
8+
version="6.0.0"
9+
type="script" />
10+
11+
<!-- IMPORTANT TO HAVE THIS VERSION OR HIGHER SO THAT IT WORKS AS EXPECTED
12+
https://nightly.mtasa.com -->
13+
<min_mta_version client="1.6.0-9.22649.0" server="1.6.0-9.22649.0"/>
14+
15+
<file src="models/*.col" download="false"/>
16+
<file src="models/*.txd" download="false"/>
17+
<file src="models/*.dff" download="false"/>
18+
19+
<script type="server" src="server.lua" />
20+
</meta>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
*.txd
21
*.dff
2+
*.txd
33
*.col
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Download link in README.md, extract all dff,txd,col files here

[examples]/sampobj_red/sampobj.png

1.21 MB
Loading

0 commit comments

Comments
 (0)