How to reference another event inside a script?

Discussion in 'Javascript/Plugin Support' started by JCeetra, Jun 18, 2019.

  1. JCeetra

    JCeetra Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey RPG Maker community, hope I can get some good help.

    I'm working with a plethora of yanfly's plugins, so bear with me. I'm trying to get the Event Chase plugin to play music while the enemy is chasing the player, then play the map's music again when the event is no longer chasing the player.

    So I have an event set up that triggers the battle when the event touches the player. This event's Movement is set to Custom Route, where it just stands there and waits for the player to come in range. Its movement is exactly this:

    $this._chaseRange = 10

    By yanfly's Event Chase plugin, this has the enemy chase the player once in range. This part works just fine.
    Then in the plugin description, I have Common Event 008 set up, which simply plays chase music. This also works just fine.

    From here, how can I get the event to stop playing the music and turn on the map's music? And how can this easily be applied to all other enemies I make from here on?
     
    #1
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,588
    Likes Received:
    7,517
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV

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

     
    #2
  3. Nekohime1989

    Nekohime1989 Cat Princess Veteran

    Messages:
    253
    Likes Received:
    94
    First Language:
    English
    Primarily Uses:
    RMMV
    calling this should allow you access that event. be careful though.
    Code:
    $gameMap.event(id)
     
    #3
  4. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,407
    Likes Received:
    2,821
    Location:
    Philippines
    First Language:
    Tagalog
    When do you want that to happen? When the event stops chasing? You'd probably need to modify Yanfly's plugin to also allow you to define a CE that will run when an event stops chasing
     
    #4

Share This Page