Jump to content

Adding the node creator features to map editor


rikicecchi

Recommended Posts

Hello rikicecchi,

I think you are looking for the npchlc_traffic and npchlc_traffic_editor resources. They were created by @Reyomin, previously known as CrystalMV, a highly reputable member inside of our MTA community. You can see the node editor in action in this video:

There does not appear to be any documentation on the MTA wiki regarding this resource. You should try following the regular MTA wiki editor plugins documentation for getting the traffic plugin to work. If you are facing any difficulty, feel free to ask!

Edited by The_GTA
  • Like 1
Link to comment
10 minutes ago, rikicecchi said:

Thank you so much!

You're welcome!

10 minutes ago, rikicecchi said:

Forgive me for a stupid question like this, but I came from GTA SAMP and this is the first time that I'm trying to develop on MTA.

A wise man has told me that there are no stupid questions. Believe in yourself.

10 minutes ago, rikicecchi said:

The question is: how can I add the scripts to the editor? Or I should use it as server script?

The MTA editor is solely a map editor, not a script editor. Thus you should create a companion resource for your map. The (probably) smartest way to do that is to make use of the mapmanager events for map loading and unloading detection. You could of course put the scripts into the same resource as the map file itself. But splitting away the scripts from the map allows you to use the same scripts for multiple maps!

I think you might find the documentation of the meta.xml file interesting. This file describes the layout of the to-be-loaded resource to the MTA server and is located in the root directory of every resource. You have to get used to writing these by hand if you want to start MTA development. ?

Edited by The_GTA
Link to comment
3 minutes ago, rikicecchi said:

In the resources folder I can find the editor files zipped. I would like to edit directly the "main editor". Which files I should touch?

I think that by "main editor" you mean the UI and the map editing logic. These are split between the editor_main and the editor_gui resources. Before editing any resources I recommend that you unzip them. You just have to create a folder with the same name in the same location as the .zip resource. Then the folder has a higher priority than the archived resource.

To take a look at the world editing logic, you could open the "editor_main/client/main.lua" file. Inside of this file you can find the world clicking implementation. For anything related to the fancy UI of the editor search inside the "editor_gui" resource.

I do not recommend editing the editor resource as a beginner in MTA development. You should first learn the basics of the Lua programming language, learn from good examples to get in touch with best practices and work your way up in programming skill. Advanced resources like the MTA editor tend to pack in a lot of complexity in as few lines of code by making use of advanced software models (class systems, Lua file modularity, shared functions, etc). The only recommendable thing for you is to get inspired, in a light way, by things possible but done in your own way.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...