Advice for a novice about a pathfinding AI.

Timothy Taber

Warper
Member
Joined
Jul 6, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
I want to implement a feature or script for events (NPCs) that will allow them to locate other events and make their way too them.

As an example a cow leaves a barn to graze at a certain time, but if a monster appears it will head to the nearest barn and goes inside. Or an NPC has a hunger meter and when the hungry event is triggered the NPC will go to the nearest eatery event to order food or something. I want to make it so I can just do a look for nearest (Insert event type here) event.

There might already be ways to do this, but I'm no programmer. I'll be using a lot of Yanfly's scripts because it seems to simplify things with the notes, and I know that when it comes to scripting it is all about knowing how to speak in code, but I have never scripted before so could someone give me a general idea of how to properly translate this in code.

When (Insert event type here) event is triggered.
Get location of all (Insert event type here) events on map.
Compare (Insert event type here) event locations to this event's current location.
Identify nearest (Insert event type here) event location by the comparison.
Make event move to the nearest (Insert event type here) event.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,353
Reaction score
8,533
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

Timothy Taber

Warper
Member
Joined
Jul 6, 2017
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Thanks I'll see what I can do with it.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,858
Messages
1,017,023
Members
137,565
Latest member
Callmelogann
Top