Jump to content
Sign in to follow this  
Shadow Fox

Monster Music Regions script

Recommended Posts

I have searched the script forum but I do not believe I have found anything that could help me so now I am requesting something that is very specific and it deals with Regions.

However Since I am using a specific script I feel that I should post that script here as well as it has a bearing on my script request.

 

DP3 has helped me with the script below.

 

 

 

#==============================================================================

# ** Meph's Simple Region Audio (Requested by Cecillia)
#------------------------------------------------------------------------------
# MephistoX and DP3 helped with Airship and switch
# Version 1.2
# 22/07/2013
# RPGMaker VXAce
#------------------------------------------------------------------------------
# * Version History :
#
# Version 1 ---------------------------------------------------- (26/04/2012)
# - First Released Version
# Version 1.2 -------------------------------------------------- (26/06/2013)
# - Second Released Version
# Version 1.3 -------------------------------------------------- (22/07/2013)
# - Third Released Version
#------------------------------------------------------------------------------
# * Description :
#
# This Script allow the user to configure different BGMs depending on the
# region where the player is, if no bgm defined for that region the BGM
# will stay, also works with autoplay.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place The Script in the Materiales Section of your Script List
# See The Module to Check the Audio Configuration for the Map.
#------------------------------------------------------------------------------
# * Credits
#
# Avaliable for Any Proyect.
#==============================================================================
#==============================================================================
# ** Region Audio
#==============================================================================

module Region_Audio
#--------------------------------------------------------------------------
# * BGM Config : Configure the BGM for Each Map and Region
# - BGM_Config = {Map_ID => {Region_ID => 'BGM Name'}}
#--------------------------------------------------------------------------
BGM_Config = {}
BGM_Config[16] = {1 => 'Field1', 2 => 'Field2', 3 => 'Field3', 4 => 'Field4', 5 => 'Field5', 6 => 'Field6',}
Event_Switch_ID = 10
#--------------------------------------------------------------------------
# * Defined Audio? : Check if Audio for Map and Region is Defined
#--------------------------------------------------------------------------
def defined_audio?(map_id, region_id)
# Return true if Map_ID defined and Region_ID defined
return (BGM_Config.key?(map_id) && BGM_Config[map_id].key?(region_id))
end
end
#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# * Mixin Region_Audio
#--------------------------------------------------------------------------
include Region_Audio
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias_method :meph_chgrgbgm_gmap_autoplay, :autoplay
#--------------------------------------------------------------------------
# * Automatically Switch BGM and BGS
#--------------------------------------------------------------------------
def autoplay
unless $game_switches[Region_Audio::Event_Switch_ID]
# Check if Map ID is a Configured Region Music Map
if defined_audio?(@map_id, $game_player.region_id)
# Get BGM Name based on Map_ID and region where the player is
bgm_name = BGM_Config[@map_id][$game_player.region_id]
# Play the gotten BGM
return Audio.bgm_play('Audio/BGM/' + bgm_name, 100, 100)
end
end
# The Usual
meph_chgrgbgm_gmap_autoplay
end
#--------------------------------------------------------------------------
# * Update Region Audio : Update the Audio based on Region ID
#--------------------------------------------------------------------------
def update_region_audio(r_id)
# Get BGM
bgm_name = BGM_Config[@map_id][r_id]
# Return if Not Defined Audio or Currently Playing defined BGM
return if !defined_audio?(@map_id, r_id) || (@map.bgm.name == bgm_name)
# Play BGM
Audio.bgm_play('Audio/BGM/' + bgm_name, 100, 100)
end
end
#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias_method :meph_chgrgbgm_gplay_init , :initialize
alias_method :meph_chgrgbgm_gplay_update, :update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# The Usual
meph_chgrgbgm_gplay_init
# Region ID
@region_id = 0
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
meph_chgrgbgm_gplay_update
# Don't Update Sound if Inside of AirShip
unless $game_player.in_airship? || $game_switches[Region_Audio::Event_Switch_ID]
# If Actual Region is different from saved Region
if region_id != @region_id
# Save Actual Region
@region_id = region_id
# Update Map Region Audio
$game_map.update_region_audio(@region_id)
end
end
end
end

 

 

And this is what I am trying to accomplish.

Within the game there are between 6 and 8 main regions within EACH continent that are the same, and each region will have different music which is what the script above does.

 

However there would be several monsters that are completely different within the same region.

I have an example bellow:

 

There are four Continents and they all have region 1, which will play the SAME tune, but each different region is suppose to have different monsters.

Here is a quick example of what I am wanting.

 

In region 1 of Continent A has Wasps, Bees, and other incests

In region 1 of Continent B has Snakes, Lizards and other reptiles.

In region 1 of Continent C has Wolves, Foxes and other canines

In region 1 of Continent D has Cheetahs, Panthers and other felines.

 

And region 1 of ALL four regions should play Field1.

 

 

So with that information given, and if this idea can be done without resorting to using another script other then the above script please let me know on how I go about that.

Edited by Shadow Fox

Share this post


Link to post
Share on other sites

Why can't you just make each continent have a separate region, but all 4 of those separate regions play the same song?

Share this post


Link to post
Share on other sites

I have tried that but the music does NOT play... even though I have this in the script

 

BGM_Config[16] = {1 => 'Field1', 2 => 'Field1', 3 => 'Field1', 4 => 'Field1', 5 => 'Field2', 6 => 'Field2', 7 => 'Field2', 8 => 'Field2'}

 

I MAY be doing it wrong though.

Edited by Shadow Fox

Share this post


Link to post
Share on other sites

#--------------------------------------------------------------------------

# * BGM Config : Configure the BGM for Each Map and Region

# - BGM_Config = {Map_ID => {Region_ID => 'BGM Name'}}

#--------------------------------------------------------------------------

 

BGM_Config = {

 

# Map ID

1 => {

# Region ID # BGM Name

1 => 'Field1',

2 => 'Field2',

3 => 'Field3',

4 => 'Field4',

5 => 'Field5',

6 => 'Field6',

},

 

 

}

Share this post


Link to post
Share on other sites

It's working now. I think I might have had a , where there shouldn't be. This topic can be locked as I don't require a script anymore.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted