Battle BGM/Battleback Problems

Discussion in 'RPG Maker MV' started by EliteFerrex, Jan 16, 2017.

  1. EliteFerrex

    EliteFerrex Veteran Veteran

    Messages:
    43
    Likes Received:
    14
    Location:
    California, US
    First Language:
    English
    Hello, everyone.


    I'm having difficulty trying to make sure my battle BGMs and Battle Backs work correctly once the player has access to the Ship, because I don't want the wrong Battle Back or BGM playing in the wrong area of the world map. Before the player had the Ship, I simply controlled this via map specifications and the regular transfer player events, but now, if a player enters the world map in one part of the world and takes the ship to another, the Battle Back and Battle BGM will be wrong.


    I made an event that will automatically select the appropriate BGM and battleback based on the player's RegionID (See spoiler below), but my concern is whether or not having this event constantly running in the background on the world map will cause lag or other problems on mobile devices or less powerful computers. But I can't think of a different way to do it and still have it work with the player constantly changing RegionIDs going from area=>ship=>area again while still keeping things in order.


    For example, if the player enters a certain RegionID and the event were to activate and then flip a self switch, the event would never run again. If it activated and then flipped a switch, I'd need a way to trigger that switch to turn off any time the player's RegionID on the world map switched from one to another so that it would run the check again, and I don't know how to do that.


    Can anyone recommend a better method, or possibly offer a different Script to use for the event? Or, if you don't think this will be an issue and I'm overly concerned, feel free to tell me that, too (that would be nice...).


    Thank you in advance for the help!

    EVENT TRIGGER: PARALLEL


    If : Script : $gameMap.regionId($gamePlayer.x, $gamePlayer.y) === 1

    • Change Battle BGM: Battle1 (80, 100, 0)
    • Change Battle Back: Grassland & Grassland



    If : Script : $gameMap.regionId($gamePlayer.x, $gamePlayer.y) === 2

    • Change Battle BGM: Battle9 (80, 100, 0)
    • Change Battle Back: Grassland & Grassland



    If : Script : $gameMap.regionId($gamePlayer.x, $gamePlayer.y) === 3

    • Change Battle BGM: Battle11 (80, 100, 0)
    • Change Battle Back: Sand & Wasteland



    ...and so on for the other world map RegionIDs.
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,672
    Likes Received:
    6,594
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    someone else reported the same problem with the vehicle BGMs on different maps, and it was suggested that someone writes a plugin as a temporary fix for that bug - but I don't remember if that plugin ever got written and released. You should search for the other topics about this and check if it exists.
     
    #2
    EliteFerrex likes this.
  3. LadyBaskerville

    LadyBaskerville Hell-poodle Veteran

    Messages:
    645
    Likes Received:
    495
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    There's apparently a bug with the BGM not changing properly when the player changes maps while on a vehicle, but as far as I know there is no fix yet. The topic I remember reading was here in the MV Support forum, if you want to look for it.


    But I think you don't need to worry about that bug too much if you are using only a single world map - to change the Battle BGM depending where the player is on the map, you need some kind of evented solution anyway. Your scripts look fine, I would only add a Wait command of 10 frames or so at the end of all the event commands. Right now the Parallel Process runs 60 times per second, you don't need it to check for the player's position that often. With a Wait 10 frames at the end, it would run only 6 times a second - that's still often enough to recognize player movement, and it shouldn't cause any lag on low-end devices.


    Yanfly also has a plugin that allows you to run common events when the player steps on a region. I can't give you a link right now, but it should be easy to find.
     
    #3
    EliteFerrex likes this.
  4. Dalamar

    Dalamar Veteran Veteran

    Messages:
    370
    Likes Received:
    61
    First Language:
    English
    Primarily Uses:
    RMMV
    In addition to the wait command at the end of the event, I would change the script call to $gamePlayer.regionId() === x
     
    #4
    EliteFerrex likes this.
  5. EliteFerrex

    EliteFerrex Veteran Veteran

    Messages:
    43
    Likes Received:
    14
    Location:
    California, US
    First Language:
    English
    Thank you so much for the detailed reply. I'll look into this today! 
     
    #5

Share This Page