Advice for a novice about a pathfinding AI.

Discussion in 'JS Plugin Requests' started by Timothy Taber, Jul 6, 2017.

    Tags:
  1. Timothy Taber

    Timothy Taber Warper Member

    Messages:
    4
    Likes Received:
    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.
     
    #1
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,729
    Likes Received:
    7,583
    Location:
    Texas
    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.

     
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,562
    Likes Received:
    11,268
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    #3
  4. Timothy Taber

    Timothy Taber Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks I'll see what I can do with it.
     
    #4

Share This Page