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
38,425
Reaction score
10,852
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
644
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
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

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

Grading the last exams for this semester and I need a break because I am laughing too hard xD
edit: Video link removed due to well Internet problems making it essentially nothing anyway. :kaoswt:
Sleep logic:
4 hours or less = I feel like I'm dying
5-6 hours: Feeling well rested
More than 6 hours: I feel like I'm dying
Women always say "I want to be spoiled" then get mad when I spoil them. Why would you say that if you didnt actually want to know the ending?


decided to have subclasses work differently in my game. They summon in a partner when you select one. this took some work tho as I had to get the class scene to pop up as a common event instead of straight from the menu. it was the only way to add/remove party members while on the menu screens.

Forum statistics

Threads
131,543
Messages
1,220,648
Members
173,220
Latest member
ZecaVn
Top