Charas-Project

Game Creation => RPG Maker => Topic started by: Ryuusei on February 19, 2013, 05:51:39 PM

Title: Music on different continents/parts of maps.
Post by: Ryuusei on February 19, 2013, 05:51:39 PM
I'm trying to program switches so they play music whenever the character walks into another area or goes to another continent and... I can't figure out how to do properly. I need help.
Title: Re: Music on different continents/parts of maps.
Post by: daoman89 on February 19, 2013, 06:58:17 PM
hmm.. u may need to make events that do that, but it'll be extremely tedious.  I'm sure someone here might know a better way.
Title: Re: Music on different continents/parts of maps.
Post by: drenrin2120 on February 19, 2013, 08:41:24 PM
Events won't work. You'd have to place an event on every single piece of land to compensate for the airship alone. Which would just clutter everything up and lag your overworld probably until it was unplayable. Not only that, it wouldn't work properly. Create one parallel process event that tracks the x and y of the player on the map. Then chart out the regions you want the music to start playing. Unfortunately, I'm not a math whiz, so I couldn't tell you how to chart out more than a box region. There are algorithms you can use though, that will keep track of different shaped areas. Say you want a large circle area, there's an equation for that. What I'm basically getting at, is you'll have several conditionals that run the x and y coordinate of the player through tests. If the x and y matches with this conditional, they must be in region 1,2,3,4,5,etc... Obviously, overlap will be hard to avoid. In that instance you can create priority, which would just be another set of conditionals and another variable keeping track of what songs being played. IF song B has priority over song D, play Song B in the region of overlap. Hopefully that makes sense. I don't really have time to go into detail so I wish you the best of luck and maybe someone else can extrapolate on what I'm saying.


Also, I deleted your second topic for being exactly like this one.  :P
Title: Re: Music on different continents/parts of maps.
Post by: Prpl_Mage on February 19, 2013, 09:47:49 PM
Why not just assign different BGMs to different maps in the map properties?
Title: Re: Music on different continents/parts of maps.
Post by: drenrin2120 on February 19, 2013, 09:53:03 PM
If I understood correctly, he's using one single map for the world map so that's not possible.
Title: Re: Music on different continents/parts of maps.
Post by: Meiscool on February 20, 2013, 12:18:40 AM
Easy. Just make some variables (Hero X and Hero Y may be the only ones you need).

Then make a bunch of square areas for the map using the variable cords situation forks.

Example:
Hero X greater than/equal to 0
  Hero X less than/equal to 30
    Hero Y greater than/equal to 0
      Hero Y less than/equal to 40
         Change background music to X
End

Just do something similar to that for every area you want to have different music. This method limits you to using squares, just remember that.