Music Battle  Np4 Hitskin_logo Hitskin.com

Isto é uma pré-visualização de um tema em Hitskin.com
Instalar o temaVoltar para a ficha do tema

Aldeia RPG
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Music Battle Np4

2 participantes

Ir para baixo

Music Battle  Np4 Empty Music Battle Np4

Mensagem por urbios Ter Dez 04, 2012 5:33 am

Escavação para buscar melhorias em mr.mo Abs descobriu este addon:


Sempre que você se aproxima de uma música de batalha inimigo soou nos dados escojida basse rpg maker espero que seja útil



Código:
#==============================================================================
# ** Mr.Mo ABS
#    Wyatt Addon #1:  On-Map Battle Music
#------------------------------------------------------------------------------
#    by Commander Wyatt
#    edit by Urbios
#    version 1.0
#    04-28-2010
#    RGSS / RPGMaker XP
#------------------------------------------------------------------------------
#
#  INTRODUCTION:
#
#  This is probably without a doubt not the best script in the world, I made it
#  for my game and... well, it's probably not the best way of doing this. But I
#  thought I should share it as others might find it useful.  It's dead simple
#  so no credit is required unless you want to.
#
#  When an enemy comes  within a prescribed range,  the battle music will start
#  playing,  whether the enemy is attacking the player or not.  Enemy vs. enemy
#  attacks will normally not start the music since it is no longer dependent on
#  whether an enemy is attacking or not.  This is a marked improvement from the
#  earlier version.
#
#  However, you may also configure and change in-game whether specified enemy
#  groups may start  the battle music.  This too is an improvement,  in that
#  there is greater control over the conditions that starts the music.
#
#
#------------------------------------------------------------------------------
#
#  INSTALLATION:
#
#  Install this script above MAIN but below Mr.Mo's ABS.
#
#
#------------------------------------------------------------------------------
#
#  INSTRUCTIONS:
#
#  It uses the map's default music and the battle music from the editor.
#
#  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#
#  To turn on/off the system, perform a script call such as this:
#
#      $game_system.mmo_bgm = true
#        -or-
#      $game_system.mmo_bgm = nil
#
#  Do not pass a value of 'false' as RGSS has a problem with false values.
#
#  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#
#  To change the sensitivity, perform a script call such as this:
#
#      $game_system.mmo_bgm_cnt = 4
#
#  Which changes the battle music sensitivity to 2 seconds (measured in ½ sec.)
#
#  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#
#  To change the area range, perform a script call such as this:
#
#      $game_system.mmo_bgm_range = 6
#
#  Which changes the battle area range to 6 square radius.  You may also set
#  this value to either '0' or 'nil'  so it functions  based solely if there
#  are enemies on the map.
#
#  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#
#  To edit the extra enemies that trigger music, use a script call like this:
#
#      $game_system.mmo_bgm_enemies = [4,8]
#
#  Which changes the enemies that may also trigger battle music to enemies #4
#  and 6 within the database (enemy IDs, not events).  It may also be set to
#  'nil' if no extra enemies are desired.
#
#
#------------------------------------------------------------------------------
#
#  ISSUES:
#
#  It checks to auto-play music determined in your maps properties.  If you do
#  not have music pre-set, the music from the previous map (including the bat-
#  tle music) will carry over into the new map.
#
#
#------------------------------------------------------------------------------
#
#  COMPATABILITY:
#
#  I aliased this script, so it should be compatible with most things though I
#  am not entirely sure.  Designed for use with Mr.Mo's ABS and possibly his
#  SBABS and ABS-lite.
#
#
#------------------------------------------------------------------------------
#
#  VERSION HISTORY:
#
#  1.0 - Works for Mr.Mo's ABS
#  1.1 - lammer bug (initialize method added)
#  1.2 - Determined changec can work with Near's SBABS
#  1.3 - Made Sensitivity configurable and added Map Teleport feature
#  1.4 - Added On/Off capabilities.
#  1.5 - Music system now activates when enemies are within a set range
#  1.6 - Enemy Area range now adjustabe in-game
#  1.7 - Additional enemy IDs may now trigger battle music.
#  1.8 - Killed a lag issue bug.
#
#------------------------------------------------------------------------------
#
#  CREDITS AND THANKS:
#
#  Thanks to Mr.Mo for making  the battle system(s),  and thanks  to Tibuda for
#  helping me a bit.  Thanks also to Ccoa for the Graphics.framecount equasion
#  that eliminated the lag issue.
#
#------------------------------------------------------------------------------
#
#  TERMS OF USE:
#
#  Don't bother crediting me please, unless you really want to. Free or commer-
#  cial (but check with the terms in Mr.Mo's ABS for his terms).
#
#
#==============================================================================


  # Adjust (in 1/2 secs) how sensitive the music refresh/check is performed.
  # So a value of 1 rates a sensitivity of 1/2 a second and a value
  # of 2 would rate a 1 second sensitivity.
  #
    WYATT_MUSIC_SENSITIVITY = 1
   
  # Adjust enemy range for battle music (or 0/'nil' if no range limit).
  #
    WYATT_MUSIC_RANGE      = 5
   
  # Include additional enemy IDs that may trigger battle music in range.
  #
    WYATT_MUSIC_ENEMIES    = nil
   
  # Include additional enemy IDs that will never trigger music
  # (Like practice dummies)
  #   
    WYATT_MUSIC_EXCLUDED    = [43, 44, 45] 
 
   
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
#  Refer to "$game_temp" for the instance of this class.
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :mmo_bgm                  # Mr.Mo's battle music counter
end
 


#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles data surrounding the system. Backround music, etc.
#  is managed here as well. Refer to "$game_system" for the instance of
#  this class.
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # * Alias Listings
  #-------------------------------------------------------------------------- 
  alias wy_mbm_init initialize 
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :mmo_bgm                  # Mr.Mo's battle music switch
  attr_accessor :mmo_bgm_cnt              # Mr.Mo's battle music counter
  attr_accessor :mmo_bgm_range            # Mr.Mo's battle music range
  attr_accessor :mmo_bgm_enemies          # Mr.Mo's battle music enemies
  attr_accessor :mmo_bgm_excluded        # Mr.Mo's battle music exclusions
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    wy_mbm_init
    @mmo_bgm          = true
    @mmo_bgm_cnt      = WYATT_MUSIC_SENSITIVITY * 2
    @mmo_bgm_range    = WYATT_MUSIC_RANGE
    @mmo_bgm_enemies  = []
    @mmo_bgm_enemies  = WYATT_MUSIC_ENEMIES
    @mmo_bgm_excluded = []
    @mmo_bgm_excluded = WYATT_MUSIC_EXCLUDED
  end
end



#--------------------------------------------------------------------------
# * Class Mo ABS - DO NOT EDIT BELOW, if you don't know what you are doing :)
#--------------------------------------------------------------------------

class MrMo_ABS
  #--------------------------------------------------------------------------
  # * Alias Listings
  #-------------------------------------------------------------------------- 
  alias music_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Perform the original call
    music_update
    # Check for enemy music
    if check_enemy_music
      $game_temp.mmo_bgm = $game_system.mmo_bgm_cnt     
    end
  end 
  #--------------------------------------------------------------------------
  # * Check for enemy music
  #--------------------------------------------------------------------------
  def check_enemy_music
    # Preset music check to false
    music_check = false
    # Perform check for enemies only if enemies are in map
    unless @enemies == {}
      # grab current enemy music points
      bgm_hate = [0]
      # Only add extra enemies if array isn't nil
      if $game_system.mmo_bgm_enemies != nil
        bgm_hate += $game_system.mmo_bgm_enemies
      end
      # grab current exluded enemies
      bgm_exclude = [0]
      # Only add extra enemies if array isn't nil
      if $game_system.mmo_bgm_excluded != nil
        bgm_exclude += $game_system.mmo_bgm_excluded
      end
      # Grab area affect range
      range = $game_system.mmo_bgm_range
      # Prevent 'nil' errors
      range = 0 if range == nil
      # Check all active enemies in range
      for enemy in @enemies.values
        next if bgm_exclude.include?(enemy.enemy_id)
        # if no range limit
        if range == 0
          bgm_hate.each {|i|
            music_check = true  if enemy.hate_group.include?(i)
          }         
        else
          # Check area range
          if in_range?($game_player, enemy.event, range)
            bgm_hate.each {|i|
              music_check = true  if enemy.hate_group.include?(i)
            }
          end
        end
      end
    end
    return music_check
  end 
end



#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Alias Listings
  #-------------------------------------------------------------------------- 
  alias wy_mbm_update update
  alias wy_mbm_transfer transfer_player
  #--------------------------------------------------------------------------
  # * Object Initialization
  #-------------------------------------------------------------------------- 
  if @wy_abm_init_stack_prevent.nil?
    @wy_abm_init_stack_prevent = true 
    alias wy_mbm_init initialize
    def initialize
      $game_temp.mmo_bgm = 0
      wy_mbm_init
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #-------------------------------------------------------------------------- 
  def update
    if (Graphics.frame_count % 20) == 0
      if $game_system.mmo_bgm == true
        if $game_temp.mmo_bgm == 0
          $game_map.autoplay
        else
          $game_system.bgm_play($game_system.battle_bgm)
        end
        $game_temp.mmo_bgm -= 1 unless $game_temp.mmo_bgm <= 0
      end
    end
    wy_mbm_update
  end
  #--------------------------------------------------------------------------
  # * Player Place Move
  #--------------------------------------------------------------------------
  def transfer_player
    $game_temp.mmo_bgm = 0
    wy_mbm_transfer   
  end
end

_________________
RPG maker XP in android? Razz :
urbios
urbios
Iniciante
Iniciante

Mensagens : 73
Créditos : 22

Ir para o topo Ir para baixo

Music Battle  Np4 Empty Re: Music Battle Np4

Mensagem por Duel Ter Dez 04, 2012 10:03 am

Bom gostei,mas primeiro tenho que entender,Após se aproximar de algum inimigo toca um BGM né?
Se for isto +1 Cred por postar

_________________
Jack:
Duel
Duel
Aldeia Friend
Aldeia Friend

Mensagens : 1375
Créditos : 107

Ficha do personagem
Nível: 1
Experiência:
Music Battle  Np4 Left_bar_bleue0/0Music Battle  Np4 Empty_bar_bleue  (0/0)
Vida:
Music Battle  Np4 Left_bar_bleue30/30Music Battle  Np4 Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos