Skip to content

Commit 0084f6d

Browse files
Version 5, goodbye element data!
1 parent c0b0064 commit 0084f6d

File tree

38 files changed

+1207
-2163
lines changed

38 files changed

+1207
-2163
lines changed

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
# Newmodels v3 and older
1+
# Newmodels v5 `Azul💙`
22

3-
🗃️ Visit [the archive branch](https://github.com/Fernando-A-Rocha/mta-add-models/tree/archive) and the previous Releases for **older versions** of `newmodels` (not recommended).
3+
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-
# Newmodels v4 (`Reborn`)
6-
7-
This is an MTA resource which makes use of the [engineRequestModel](https://wiki.multitheftauto.com/wiki/EngineRequestModel) features to add new peds (skins), vehicles and objects:
8-
9-
- place your mods (dff/txd/col files) in designated folders that are automatically detected by the script
5+
- place your mods (dff/txd/col files) in designated folders that are automatically detected
106
- 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
118
- it's minimalistic, optimized and robust
129

13-
In simpler terms, with this resource you can make scripts/change your scripts to add new skin, vehicle and object IDs to your server! For example, we can now add all SA-MP objects.
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!
1411

15-
## Community
12+
## What changed? ⚠️
1613

17-
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.
14+
**This version (v5) provides no backwards compatibility with previous versions (v3, v4)!**
1815

19-
## Download
16+
However, it is easy to migrate from v4 (not from v3) to v5. The models folder structure remained the same, but the scripts have changed.
2017

21-
Get the [Latest Version](https://github.com/Fernando-A-Rocha/mta-add-models/releases/latest) from the **Releases** section.
18+
This resource no longer uses and relies on the **MTA Element Data system** to sync the models to all clients! This major change was made to **improve performance** and control the sync of models more efficiently.
2219

23-
## *What if I already use an older version on my server?* 😮
20+
## Docs/Tutorial
2421

25-
Read the documentation linked below, and look for the **Backwards Compatibility** section.
22+
🚀 **Are you new to this resource?**
2623

27-
## Docs/Tutorial
24+
Access the [Documentation file](/.github/doc/DOCUMENTATION.md) to learn everything you need to know.
2825

29-
Access the [Documentation file](/.github/doc/DOCUMENTATION.md) to learn about this resource and how to use it.
26+
## Community
27+
28+
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.
29+
30+
## Download
31+
32+
Get the [Latest Version](https://github.com/Fernando-A-Rocha/mta-add-models/releases/latest) from the **Releases** section.
3033

3134
## Media
3235

[examples]/test_vehicles/meta.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

[examples]/test_vehicles/s_vehicles.lua

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 52 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,53 @@
1-
<meta>
2-
<info author="FernandoMTA" version="4.0.0" type="script" name="newmodels_reborn" description="Adds new vehicle/ped/object models, automatically synced with all players."/>
3-
4-
<!-- IMPORTANT TO HAVE THIS VERSION OR HIGHER SO THAT IT WORKS AS EXPECTED
5-
https://nightly.mtasa.com -->
6-
<min_mta_version client="1.6.0-9.22649.0" server="1.6.0-9.22649.0"></min_mta_version>
7-
8-
<!-- Main Scripts -->
9-
<script src="scripts/core/shared_local.lua" type="shared"/>
10-
<script src="scripts/core/shared_exported.lua" type="shared"/>
11-
<script src="scripts/core/shared_importfunc.lua" type="shared"/>
12-
<script src="scripts/core/client_logic.lua" type="client"/>
13-
<script src="scripts/core/server_logic.lua" type="server"/>
14-
<!-- Exported functions -->
15-
<export function="getCustomModels" type="shared"/>
16-
<export function="getCustomModelDataKey" type="shared"/>
17-
<export function="isDefaultID" type="shared"/>
18-
<export function="createObject" type="shared"/>
19-
<export function="createVehicle" type="shared"/>
20-
<export function="getVehicleType" type="shared"/>
21-
<export function="createPed" type="shared"/>
22-
<export function="createPickup" type="shared"/>
23-
<export function="setPickupType" type="shared"/>
24-
<export function="setElementModel" type="shared"/>
25-
<export function="getElementModel" type="shared"/>
26-
<export function="getElementBaseModel" type="shared"/>
27-
<export function="getBaseModelIdFromCustomModelId" type="shared"/>
28-
<export function="import" type="shared"/>
29-
30-
<!-- Files -->
31-
<file src="models/**/*.col"/>
32-
<file src="models/**/*.txd"/>
33-
<file src="models/**/*.dff"/>
34-
35-
<!-- ............................................................................... -->
36-
<!-- OPTIONAL THINGS: .............................................................. -->
37-
38-
<!-- Update Checker (RECOMMENDED, please keep this to be warned of new releases!) -->
39-
<script src="scripts/optional/update_checker/s_update_checker.lua" type="server"/>
40-
<aclrequest>
41-
<right name="function.fetchRemote" access="true"/>
42-
</aclrequest>
43-
44-
<!-- Debugging / Testing -->
45-
<script src="scripts/optional/debug/g_debug.lua" type="shared"/>
46-
<script src="scripts/optional/debug/c_debug.lua" type="client"/>
47-
<script src="scripts/optional/debug/s_debug.lua" type="server"/>
48-
49-
<!-- Backwards compatibility with newmodels 3.3.0 -->
50-
<script src="scripts/optional/compatibility/shared_exported.lua" type="shared"/>
51-
<script src="scripts/optional/compatibility/shared_importfunc.lua" type="shared"/>
52-
<script src="scripts/optional/compatibility/server_funcs.lua" type="server"/>
53-
<!-- Exported functions (Client & Server) -->
54-
<export type="shared" function="getModList"/>
55-
<export type="shared" function="getDataNameFromType"/>
56-
<export type="shared" function="getBaseModelDataName"/>
57-
<export type="shared" function="getBaseModel"/>
58-
<export type="shared" function="getModDataFromID"/>
59-
<export type="shared" function="isDefaultID"/>
60-
<export type="shared" function="isCustomModID"/>
61-
<export type="shared" function="isRightModType"/>
62-
<export type="shared" function="checkModelID"/>
63-
<!-- Exported functions (Server only) -->
64-
<export type="server" function="addExternalMod_IDFilenames"/>
65-
<export type="server" function="addExternalMods_IDFilenames"/>
66-
<export type="server" function="addExternalMod_CustomFilenames"/>
67-
<export type="server" function="addExternalMods_CustomFileNames"/>
68-
<export type="server" function="removeExternalMod"/>
69-
<export type="server" function="removeExternalMods"/>
70-
<!-- Exported functions (Client only) -->
71-
<export type="client" function="isClientReady"/>
72-
<export type="client" function="isModAllocated"/>
73-
<!-- <export type="client" function="forceDownloadMod"/> -->
74-
<!-- <export type="client" function="isBusyDownloading"/> -->
75-
1+
<meta>
2+
<info author="FernandoMTA" version="5.0.0" type="script" name="newmodels_azul"
3+
description="Adds new vehicle/ped/object models, automatically synced with all players."/>
4+
5+
<!-- IMPORTANT TO HAVE THIS VERSION OR HIGHER SO THAT IT WORKS AS EXPECTED
6+
https://nightly.mtasa.com -->
7+
<min_mta_version client="1.6.0-9.22649.0" server="1.6.0-9.22649.0"></min_mta_version>
8+
9+
<!-- Main Scripts -->
10+
<script src="scripts/core/shared_local.lua" type="shared"/>
11+
<script src="scripts/core/shared_exported.lua" type="shared"/>
12+
<script src="scripts/core/shared_importfunc.lua" type="shared"/>
13+
<script src="scripts/core/client_logic.lua" type="client"/>
14+
<script src="scripts/core/server_logic.lua" type="server"/>
15+
<!-- Exported functions -->
16+
<export function="getCustomModels" type="shared"/>
17+
<export function="getElementModels" type="shared"/>
18+
<export function="getElementCustomModel" type="shared"/>
19+
<export function="setElementCustomModel" type="shared"/>
20+
<export function="isDefaultID" type="shared"/>
21+
<export function="createObject" type="shared"/>
22+
<export function="createVehicle" type="shared"/>
23+
<export function="getVehicleType" type="shared"/>
24+
<export function="createPed" type="shared"/>
25+
<export function="createPickup" type="shared"/>
26+
<export function="setPickupType" type="shared"/>
27+
<export function="setElementModel" type="shared"/>
28+
<export function="getElementModel" type="shared"/>
29+
<export function="getElementBaseModel" type="shared"/>
30+
<export function="getBaseModelIdFromCustomModelId" type="shared"/>
31+
<export function="isValidElement" type="shared"/>
32+
<export function="getValidElementTypes" type="shared"/>
33+
<export function="import" type="shared"/>
34+
35+
<!-- Files -->
36+
<file src="models/**/*.col"/>
37+
<file src="models/**/*.txd"/>
38+
<file src="models/**/*.dff"/>
39+
40+
<!-- ............................................................................... -->
41+
<!-- OPTIONAL THINGS: .............................................................. -->
42+
43+
<!-- Update Checker (RECOMMENDED, please keep this to be warned of new releases!) -->
44+
<script src="scripts/optional/update_checker/s_update_checker.lua" type="server"/>
45+
<aclrequest>
46+
<right name="function.fetchRemote" access="true"/>
47+
</aclrequest>
48+
49+
<!-- Debugging / Testing -->
50+
<script src="scripts/optional/debug/g_debug.lua" type="shared"/>
51+
<script src="scripts/optional/debug/c_debug.lua" type="client"/>
52+
<script src="scripts/optional/debug/s_debug.lua" type="server"/>
7653
</meta>
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
Model files (ending in `.dff`/`.col`/`.txd`) must be placed in this `models` folder following specific rules
2-
3-
See the example files to visualize the structure of this system
4-
5-
- Vehicles must be placed in the `vehicle` folder, Skins in `ped`, and Objects in `object`
6-
7-
- Inside the type folder, you must create a folder with the base model ID of the new model (e.g. `490`, which is FBI Rancher)
8-
9-
- **Optional:** Inside the base model folder, you must create a folder with the name of the new model (e.g. `2005 Schafter`)
10-
11-
- Then, you must place the model files named as the New ID of the model (e.g. `80001.dff` & `80001.txd`)
12-
13-
- **Optional:** Models can be customized with a `New ID.txt` file with the following settings (any line that doesn't contain these words is ignored):
14-
15-
- `disableAutoFree`
16-
- `disableTXDTextureFiltering`
17-
- `enableDFFAlphaTransparency`
18-
- `txd=PATH_TO_TXD_FILE_INSIDE_models_FOLDER` (used for shared textures)
19-
- `dff=PATH_TO_DFF_FILE_INSIDE_models_FOLDER` (used for shared models)
20-
- `col=PATH_TO_COL_FILE_INSIDE_models_FOLDER` (used for shared collisions)
21-
- `lodDistance=NUMBER` (used for setting https://wiki.multitheftauto.com/wiki/EngineSetModelLODDistance)
22-
- `settings=PATH_TO_ANOTHER_SETTINGS_FILE_INSIDE_models_FOLDER` (in case you want to share the same settings between multiple models)
1+
Model files (ending in `.dff`/`.col`/`.txd`) must be placed in this `models` folder following specific rules
2+
3+
See the example files to visualize the structure of this system
4+
5+
- Vehicles must be placed in the `vehicle` folder, Skins in `ped`, and Objects in `object`
6+
7+
- Inside the type folder, you must create a folder with the base model ID of the new model (e.g. `490`, which is FBI Rancher)
8+
9+
- **Optional:** Inside the base model folder, you must create a folder with the name of the new model (e.g. `2005 Schafter`)
10+
11+
- Then, you must place the model files named as the New ID of the model (e.g. `80001.dff` & `80001.txd`)
12+
13+
- **Optional:** Models can be customized with a `New ID.txt` file with the following settings (any line that doesn't contain these words is ignored):
14+
15+
- `disableAutoFree`
16+
- `disableTXDTextureFiltering`
17+
- `enableDFFAlphaTransparency`
18+
- `txd=PATH_TO_TXD_FILE_INSIDE_models_FOLDER` (used for shared textures)
19+
- `dff=PATH_TO_DFF_FILE_INSIDE_models_FOLDER` (used for shared models)
20+
- `col=PATH_TO_COL_FILE_INSIDE_models_FOLDER` (used for shared collisions)
21+
- `lodDistance=NUMBER` (used for setting https://wiki.multitheftauto.com/wiki/EngineSetModelLODDistance)
22+
- `settings=PATH_TO_ANOTHER_SETTINGS_FILE_INSIDE_models_FOLDER` (in case you want to share the same settings between multiple models)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
txd=object/1337/boxes.txd
1+
txd=object/1337/boxes.txd
22
lodDistance=300

0 commit comments

Comments
 (0)