EliteFerrex

Veteran
Veteran
Joined
Oct 26, 2015
Messages
43
Reaction score
15
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

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,022
Reaction score
10,021
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
Veteran
Joined
Sep 12, 2016
Messages
706
Reaction score
634
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

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

EliteFerrex

Veteran
Veteran
Joined
Oct 26, 2015
Messages
43
Reaction score
15
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

I actually did work on my game today. This is momentous enough to warrant a status post.
Working on a character poses plugin!
Aerosys wrote on OcRam's profile.
Just saw your video about Map Generation. What a pity it's gone! It looked really well-made and like an excellent competitor to mine.
The Florida city I was born and raised in, Fort Myers, has been in the national news lately. We took a major hit from the hurricane. I'm fine, but others weren't so lucky.

Forum statistics

Threads
125,659
Messages
1,172,605
Members
164,787
Latest member
mio_fa
Top