Skip to content

Commit

Permalink
Merge pull request #39 from Fernando-A-Rocha/fixes-v4
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
Fernando-A-Rocha authored Sep 7, 2023
2 parents 44c5eb5 + 47f3261 commit f2e0401
Show file tree
Hide file tree
Showing 9 changed files with 5,529 additions and 5,485 deletions.
90 changes: 45 additions & 45 deletions .github/docs/custom_editor/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
![Newmodels Map Editor Banner](https://i.imgur.com/ln6mrLr.png)

The Newmodels Map Editor Project consits of **🧬experimental🧬** customized MTA:SA Map Editor resources to support new model IDs for vehicles, objects and skins using newmodels ([mta-add-models Project](https://github.com/Fernando-A-Rocha/mta-add-models#readme)).

MTA forum thread: [link](https://forum.mtasa.com/topic/133212-rel-add-new-models-library/#comment-1003395)

## Support/Help

If you need help with anything related to this project, please read the corresponding section on the MTA forum thread linked above.

## Installation

1. Follow the instructions on the [New-Models Editor v3.1.0 release page](https://github.com/Fernando-A-Rocha/mtasa-resources/releases/tag/v3.1.0-newmodels-editor).

2. Make sure you installed `newmodels` & `newmodels-engine` which you can obtain from the [mta-add-models v3.1.0 release page](https://github.com/Fernando-A-Rocha/mta-add-models/releases/tag/v3.1.0).
* Tutorial [here](/README.md#install).
* Both of these are required for the New-Models Map Editor to work.
* Make sure you have the right compatible versions of both resources installed.

3. Use **refresh** command in your server console to apply the resource changes.

## Usage

To use new models in your map, the editor needs to know which models have been added. The `models list` is stored inside XML files for objects, vehicles & skins in the `editor_gui` resource. We opted by not changing how the Map Editor reads these files, so it would be easier to update the Map Editor in the future.

The resource `editor_newmodels` is responsible for applying the new models to the editor GUI. It reads them from `newmodels` and adds the new models to the `models list` XML files.

This happens automatically when `editor_newmodels` is started. You can also use the command `/editor_newmodels` to force-update the models list.

You can place down new vehicles, objects and skins in your map. The editor script sets the element datas when spawning the elements.
When saving the map, the element datas are saved in the XML file. When a map is loaded, it will set all those datas => setting the correct new model IDs.

This means that the map can be loaded on any server that has the same new models in their `newmodels` resource, not requiring the custom map editor which is just for creating the maps :-)

**Happy mapping!**

## Contributing

Want to help make this project better? See [this note](https://github.com/Fernando-A-Rocha/mta-add-models#final-note).

## Credits

* [Fernando](https://github.com/Fernando-A-Rocha)
* [Rick](https://github.com/httpRick)
* [MTA:SA Resources Contributors](https://github.com/multitheftauto/mtasa-resources)
![Newmodels Map Editor Banner](https://i.imgur.com/ln6mrLr.png)

The Newmodels Map Editor Project consits of **🧬experimental🧬** customized MTA:SA Map Editor resources to support new model IDs for vehicles, objects and skins using newmodels ([mta-add-models Project](https://github.com/Fernando-A-Rocha/mta-add-models#readme)).

MTA forum thread: [link](https://forum.mtasa.com/topic/133212-rel-add-new-models-library/#comment-1003395)

## Support/Help

If you need help with anything related to this project, please read the corresponding section on the MTA forum thread linked above.

## Installation

1. Follow the instructions on the [New-Models Editor v3.2.0 release page](https://github.com/Fernando-A-Rocha/mtasa-resources/releases/tag/v3.2.0-newmodels-editor).

2. Make sure you installed `newmodels` & `newmodels-engine` which you can obtain from the [mta-add-models v3.2.0 release page](https://github.com/Fernando-A-Rocha/mta-add-models/releases/tag/v3.2.0).
* Tutorial [here](/README.md#install).
* Both of these are required for the New-Models Map Editor to work.
* Make sure you have the right compatible versions of both resources installed.

3. Use **refresh** command in your server console to apply the resource changes.

## Usage

To use new models in your map, the editor needs to know which models have been added. The `models list` is stored inside XML files for objects, vehicles & skins in the `editor_gui` resource. We opted by not changing how the Map Editor reads these files, so it would be easier to update the Map Editor in the future.

The resource `editor_newmodels` is responsible for applying the new models to the editor GUI. It reads them from `newmodels` and adds the new models to the `models list` XML files.

This happens automatically when `editor_newmodels` is started. You can also use the command `/editor_newmodels` to force-update the models list.

You can place down new vehicles, objects and skins in your map. The editor script sets the element datas when spawning the elements.
When saving the map, the element datas are saved in the XML file. When a map is loaded, it will set all those datas => setting the correct new model IDs.

This means that the map can be loaded on any server that has the same new models in their `newmodels` resource, not requiring the custom map editor which is just for creating the maps :-)

**Happy mapping!**

## Contributing

Want to help make this project better? See [this note](https://github.com/Fernando-A-Rocha/mta-add-models#final-note).

## Credits

* [Fernando](https://github.com/Fernando-A-Rocha)
* [Rick](https://github.com/httpRick)
* [MTA:SA Resources Contributors](https://github.com/multitheftauto/mtasa-resources)
58 changes: 29 additions & 29 deletions [examples]/newmodels-engine/meta.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<meta>
<!-- This resource is available in the repository below.
Its version now matches the main newmodels version!
https://github.com/Fernando-A-Rocha/mta-add-models -->

<info author="Fernando"
name="newmodels Engine"
description="useful functions to make good use of newmodels in your server"
version="3.1.0"
type="script" />

<include resource="newmodels" />

<!-- Main Script -->
<script src="shared.lua" type="shared" cache="false"/>

<!-- Testing script (optional - you can remove it) -->
<script src="testing_server.lua" type="server"/>

<!-- Exported Functions -->
<export function="createObject" type="shared"/>
<export function="createVehicle" type="shared"/>
<export function="createPed" type="shared"/>
<export function="createPickup" type="shared"/>
<export function="setPickupType" type="shared"/>
<export function="setElementModel" type="shared"/>
<export function="getElementModel" type="shared"/>
</meta>
<meta>
<!-- This resource is available in the repository below.
Its version now matches the main newmodels version!
https://github.com/Fernando-A-Rocha/mta-add-models -->

<info author="Fernando"
name="newmodels Engine"
description="useful functions to make good use of newmodels in your server"
version="3.2.0"
type="script" />

<include resource="newmodels" />

<!-- Main Script -->
<script src="shared.lua" type="shared" cache="false"/>

<!-- Testing script (optional - you can remove it) -->
<script src="testing_server.lua" type="server"/>

<!-- Exported Functions -->
<export function="createObject" type="shared"/>
<export function="createVehicle" type="shared"/>
<export function="createPed" type="shared"/>
<export function="createPickup" type="shared"/>
<export function="setPickupType" type="shared"/>
<export function="setElementModel" type="shared"/>
<export function="getElementModel" type="shared"/>
</meta>
Loading

0 comments on commit f2e0401

Please sign in to comment.