EliteFerrex

Regular
Regular
Joined
Oct 26, 2015
Messages
43
Reaction score
16
First Language
English
Primarily Uses
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.
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,954
Reaction score
11,895
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.
 

LadyBaskerville

Hell-poodle
Regular
Joined
Sep 12, 2016
Messages
705
Reaction score
648
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.
 

Dalamar

Regular
Regular
Joined
Apr 29, 2013
Messages
370
Reaction score
64
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
 

EliteFerrex

Regular
Regular
Joined
Oct 26, 2015
Messages
43
Reaction score
16
First Language
English
Primarily Uses
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.

Thank you so much for the detailed reply. I'll look into this today! 
 

Latest Threads

Latest Posts

Latest Profile Posts

Twitch! We're at it live with some game development! Feel free to drop by!
Deffo need to do a twofer for the advent compilation tomorrow. I saw the Nutcracker downtown and now I am full of tequila. You know. As you do.
After a long hiatus, I return to these parts, and the RPG Maker in me rekindled!
49 weeks into my project and I have hit 1,000 hours in the editor. (Plus maybe 500 hours in Pixelorama.)playtime.png
Just made a massive breakthrough in an MV -> MZ plugin conversion for my jam game! Gonna have a feature MZ games have basically never had. :D

Forum statistics

Threads
136,901
Messages
1,271,253
Members
180,683
Latest member
DrowsieDumbo
Top