Jump to content

AI


rain_gloom

Recommended Posts

As you can see in the library example it uses require function. As far as I know, MTA blocks this function for security purposes. In case people would load IO libraries to get access to the server files (even worse, system files) for example.

Peds are just entities that are controlled by script to give scripter full control over the peds. If you want the AI, script it. AI is a tricky subject and requires knowledge to find the best ways for peds behavior.

Link to comment

There is no problem with usage of require function in the library, because removing it and including the files into meta.xml will have the same effect (unless I have missed something). Since the library is grid-based and for 2D games, its usage in MTA would limit the pathfinding to 2D plane.

As for single player AI, it's not worth bringing it to MTA. It would require some effort to make it synced, and it relies on client-side data too much. Remaking it in scripts is better. Actually, NPC HLC was my attempt to do something like that, but since I was focused on the traffic script, the basic tasks were priority and NPC HLC didn't come out really good. I won't update it, but I may make another ped-controlling script from scratch. The problem which often makes scripting harder is making the script control all peds at the same time. But I recently realized that Lua coroutines are a good way to avoid this because they allow scripting of a single ped in continuous code without having to care about other peds.

Link to comment

Aha, I knew what this was the minute I saw the URL. I've seen it before...

CrystalMV you are correct about the including the files and removing the require.

adrenalineSYS you can't really use this because element positions are only stored and you don't actually know how much space the item occupies (hence the script won't know if there is a blocked area)

You could, however, implement this within a maze because usually mazes have a fixed width of walking passageway and each width*width is one unit in the code.

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...