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


