Sign in to follow this  
Followers 0
Fegarur

Gritos de Batalla

6 posts in this topic

Descripción:
Durante la batalla, sonarán gritos cuando algún personaje o enemigo ataque, independientemente de los sonidos de animación. Es personalizable.

Script:[SPOILER]
CODE
#==============================================================================
# ** Delissa's Battle Cry
#  by DerVVulfman
#  Version 1
#  11-04-06
#
#------------------------------------------------------------------------------
#
#  INTRODUCTION:
#
#  This add-on system allows you to pre-program additional vocal cues for your
#  battlers so they can play these additional vocals during battle events.  It
#  can perform battle cries for heroes and enemies, for regular attacks or for
#  skill events.
#
#  This script was a request by a couple of friends.   Both wanted a system to
#  enhance their combat systems  and personalize  their battles  with an audio
#  system not dependant on the "battle animation" built into RMXP.   Now, with
#  this script, you can set each battler to scream out their 'battle cry' when
#  they perform their battle action.
#
#
#------------------------------------------------------------------------------
#
#  SETTING THE BATTLECRIES:
#
#  First off,  let me point out  that this system  plays audio clips  that are
#  kept in either your project's or the RTP's Audio\SE directory.  These clips
#  may be of any file format goverened by RMXP, and as such, no file extension
#  will be necessary when actually setting up your battlecry system.
#
#  In the script's SCENE_BATTLE code, you'll see two sets of hashes, one group
#  for the actor battlers and the other for enemy battlers.   Each group has 5
#  identical hashes:  Attack, Skill, Item, Block and Escape.
#
#  Within each hash,  you are able to enter the id number of a battler and the
#  audio clip it will perform.  It's pretty simple.
#  
#  If, for example,  you want a 'ghost'  battler to moan when it is performing
#  an attack (assuming it's enemy #1 in your RTP), you would add the following:
#
#  $enemy_cry_attack = {1 => "GhostMoan01"}
#
#  ... assuming you have an audio file named  "GhostMoan01"  in your project's
#  Audio\SE directory  or in your RTP directory.   Again,  please note that no
#  file extension is needed or required.  
#
#  And, if you were to set TWO sets of battlecries  (one for a ghost & one for
#  a zombie),  you'd enter them in the following manner  (again,  assuming the
#  RTP monsters are being used):
#
#  $enemy_cry_attack = {1 => "GhostMoan01", 9 => "ZombieGroan04"}
#
#  As you can see, you can skip between battlers when setting audio clips. And
#  while it is preferred to enter them in the id number order, it isn't neces-
#  sary.
#
#  To prevent monotony, there is an additional value that is in the system be-
#  low the two sets of hashes.   This value, $occur_cry_chance, determines the
#  chance of an audio clip to be played.   A value of 100 equals a 100% chance
#  of the file to be played, while a 25 gives the system a 1 in 4 chance of it
#  being played.
#
#------------------------------------------------------------------------------
#
#  COMPATIBILITY:
#
#  This script was designed around the basic DBS system.   I can confirm it's
#  functionality with the RTAB system,  as well as ParaDog's CTB v 2.58,  the
#  newest CTB by XRXS (version 65a).
#
#  It is NOT compatible with Ccoa's CTB v 3.04 script and it is unknown as to
#  the compatability to KGC's Active Count Battle system.
#
#  This audio system will not work, and is not compatible with Cybersam's Ani-
#  mation system.
#
#------------------------------------------------------------------------------
#
#  KNOWN ISSUES:
#
#  As this system retrieves the action states of the battlers:  Attack, Skill,
#  Item...  and from nothing else,  then this system begins to play the battle
#  cries from the  very moment  these states are triggered.   The only battler
#  overlay system  (Front-View system to a Side-View System)  that this script
#  works with is the new incarnation of Minkoff's Animated Battlers - Enhanced
#  (version 4.7 or higher) as a trigger system has been recently added to that
#  script.
#
#  Earlier versions of Animated Battlers will not play the audio clips for the
#  battlers.
#
#------------------------------------------------------------------------------
#
#  JUST IN CASE:
#
#  By default, the battlecry system will merely NOT play any sound effect if a
#  given battler has no related audio clip.  The system will even skip search-
#  ing through the system  if a hash is empty.   This is  designed  to prevent
#  avoidable errors  as well  as to play  only the proper clip  for the proper
#  battler.
#
#  Also, with a little assistance from Me™ and Mr.Mo,  I was able to create an
#  Error-Check routine that 'ensures' that no error  in this system will cause
#  the system to crash.
#
#  For example, if you enter into a hash of audio clips in the system,  a piece
#  that doesn't exist (either in the project or the RTP file), then this script
#  will merely skip playing this audio file to prevent errors.
#
#==============================================================================



#==============================================================================
# ** Scene_Battle (part 4)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle

#--------------------------------------------------------------------------
# * Configuration Section
#--------------------------------------------------------------------------

# Hero battle cries
$actor_cry_attack = {}  # The only PROPER way to have empty hashes.
$actor_cry_skill  = {}  # Do not use a NIL pseudovalue!
$actor_cry_item   = {}
$actor_cry_block  = {}
$actor_cry_escape = {}

# Enemy battle cries
$enemy_cry_attack = {1 => "006-System06"}
$enemy_cry_skill  = {}
$enemy_cry_item   = ()
$enemy_cry_block  = ()
$enemy_cry_escape = ()

# Chance of occuring
$occur_cry_chance = 100

#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
alias update_phase4_step2_scream update_phase4_step2
def update_phase4_step2(battler = @active_battler)
# Re-Set Battle Cry to empty
battlecry = nil

if $anim_cry_detect == true
#something
else
# Obtain Battle Cries for Enemies
if battler.is_a?(Game_Enemy)
# Branch according to each action
case battler.current_action.kind
when 0  # basic
 battlecry = $enemy_cry_attack[battler.id] if $enemy_cry_attack.include?(battler.id)
# If blocking
if battler.current_action.basic == 1
battlecry = $enemy_cry_block[battler.id] if $enemy_cry_block.include?(battler.id)
end
# If escaping
if battler.current_action.basic == 2
battlecry = $enemy_cry_escape[battler.id] if $enemy_cry_escape.include?(battler.id)
end
# If resting
if battler.current_action.basic == 3
battlecry = nil
end
when 1  # skill
battlecry = $enemy_cry_skill[battler.id] if $enemy_cry_skill.include?(battler.id)
when 2  # item
battlecry = $enemy_cry_item[battler.id] if $enemy_cry_item.include?(battler.id)
end
# otherwise, Obtain Battle Cries for Actors
else
# Branch according to each action
case battler.current_action.kind
when 0  # basic
battlecry = $actor_cry_attack[battler.id] if $actor_cry_attack.include?(battler.id)
# If blocking
if battler.current_action.basic == 1
battlecry = $actor_cry_block[battler.id] if $actor_cry_block.include?(battler.id)
end
# If escaping
if battler.current_action.basic == 2
battlecry = $actor_cry_escape[battler.id] if $actor_cry_escape.include?(battler.id)
end
# If resting
if battler.current_action.basic == 3
battlecry = nil
end
when 1  # skill
battlecry = $actor_cry_skill[battler.id] if $actor_cry_skill.include?(battler.id)
when 2  # item
battlecry = $actor_cry_item[battler.id] if $actor_cry_item.include?(battler.id)
end
end
# Perform the cry
perform_cry(battlecry)
# Erase Battle Cry
battlecry = nil
end  
# Perform original routine  
if $rtab_cry_detect == true
update_phase4_step2_scream(battler)
else
update_phase4_step2_scream
end
end


#--------------------------------------------------------------------------
# * Frame Update (main phase step 3 : animation for action performer)
#--------------------------------------------------------------------------  
alias dbc_update_phase4_step3 update_phase4_step3
def update_phase4_step3(battler = @active_battler)
# Perform original routine  
if $rtab_detected == true
dbc_update_phase4_step3(battler)
else
dbc_update_phase4_step3
end
# Set Battle Cry to empty
battlecry = nil
# Only perform if using Animated Battlers
if $anim_cry_detect == true
if $battle_charge == true
# Obtain Battle Cries for Enemies
if battler.is_a?(Game_Enemy)
# Branch according to each action
case battler.current_action.kind
when 0  # basic
battlecry = $enemy_cry_attack[battler.id] if $enemy_cry_attack.include?(battler.id)
# If blocking
if battler.current_action.basic == 1
battlecry = $enemy_cry_block[battler.id] if $enemy_cry_block.include?(battler.id)
end
# If escaping
if battler.current_action.basic == 2
battlecry = $enemy_cry_escape[battler.id] if $enemy_cry_escape.include?(battler.id)
end
# If resting
if battler.current_action.basic == 3
battlecry = nil
end
when 1  # skill
battlecry = $enemy_cry_skill[battler.id] if $enemy_cry_skill.include?(battler.id)
when 2  # item
battlecry = $enemy_cry_item[battler.id] if $enemy_cry_item.include?(battler.id)
end
# otherwise, Obtain Battle Cries for Actors
else
# Branch according to each action
case battler.current_action.kind
when 0  # basic
battlecry = $actor_cry_attack[battler.id] if $actor_cry_attack.include?(battler.id)
# If blocking
if battler.current_action.basic == 1
battlecry = $actor_cry_block[battler.id] if $actor_cry_block.include?(battler.id)
end
# If escaping
if battler.current_action.basic == 2
battlecry = $actor_cry_escape[battler.id] if $actor_cry_escape.include?(battler.id)
end
# If resting
if battler.current_action.basic == 3
battlecry = nil
end
when 1  # skill
battlecry = $actor_cry_skill[battler.id] if $actor_cry_skill.include?(battler.id)
when 2  # item
battlecry = $actor_cry_item[battler.id] if $actor_cry_item.include?(battler.id)
end
end
# Perform the cry
perform_cry(battlecry)
# Erase Battle Cry
battlecry = nil
# Reset Flag
$battle_charge = false
end
end
end

#--------------------------------------------------------------------------
# * Perform Cry
#--------------------------------------------------------------------------
def perform_cry(battlecry)
# Error checking.  Makes sure that even the default sound file is available.
# If it is missing, then the system will set the battle cry to >none<.
#
# If the chance of the battle cry is true
if rand(100) <= $occur_cry_chance
# If the battle cry isn't nil
if battlecry != nil
begin
@trd = RPG::AudioFile.new(battlecry)
Audio.se_play("Audio/SE/" + @trd.name,0,100)
# Sound file is true
rescue Errno::ENOENT
# Sound file is invalid (restore default)
battlecry = nil
end
# Play the cry
if battlecry != nil
Audio.se_play("Audio/SE/"[email protected], 80, 100)
end
end
end
end
end

#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within
#  the Scene_Battle class.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
# Special note:  When the normal method for detecting RTAB fails, I do this
alias bcry_initialize initialize
def initialize
# Perform the original routine
bcry_initialize
# If RTAB's 'zoom' feature is present
if @real_zoom != nil
# Set the RTAB detector to 'true'
$rtab_cry_detect = true
end
end
end


#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#  This sprite is used to display the battler.  It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias bcry_initialize initialize
def initialize(viewport, battler = nil)
# Perform the original routine
bcry_initialize(viewport,battler)
# If Animated Battler's 'battler offset' feature is present
if @battler_offset != nil
# Set the Animated Battlers detector to 'true'
$anim_cry_detect = true
end
end
end
[/SPOILER]
Instrucciones:
user posted image Coloca el script sobre Main y bajo el Sistema de Batalla que uses.
user posted image Los sonidos que quieras usar tienen que estar en la carpeta Audio\SE de tu proyecto.
user posted image Puedes editar esta parte
QUOTE
# Hero battle cries
$actor_cry_attack = {}  # The only PROPER way to have empty hashes.
$actor_cry_skill  = {}  # Do not use a NIL pseudovalue!
$actor_cry_item   = {}
$actor_cry_block  = {}
$actor_cry_escape = {}

# Enemy battle cries
$enemy_cry_attack = {1 => "006-System06"}
$enemy_cry_skill  = {}
$enemy_cry_item   = ()
$enemy_cry_block  = ()
$enemy_cry_escape = ()
para seleccionar qué sonidos quieres usar en cada momento. Ten en cuenta que attack es ataque, item es objeto, skill es habilidad... Edítalo de esta manera, tanto para los héroes (Hero battle cries) como para los enemigos (Enemy battle cries)
QUOTE
$enemy_cry_attack = {1 => "GhostMoan01"}
El 1 es número en la base de datos, en este caso del enemigo (un fantasma), y lo que va entre comillas es el nombre del archivo de sonido (sin extensión)
Si quieres poner más de un héroe o enemigo en cada apartado, colócalo así:
QUOTE
$enemy_cry_attack = {1 => "GhostMoan01", 9 => "ZombieGroan04"}
Eso significa que cuando ataque el enemigo 1 (fantasma) sonará "GhostMoan01" y cuando ataque el enemigo 9 (zombie) sonará "ZombieGroan04"
user posted image Para que no sea demasiado monótono, puedes editar esta línea (la 142):
QUOTE
$occur_cry_chance = 100
Cambia el 100 por el valor en porcentaje que quieras, teniendo en cuanta que serán las opciones que tiene el sonido de aparecer.

Compatibilidad:
user posted image Compatible con los Sistemas DBS, RTAB, XRXS CBS (65a) y ParaDog's CTB (2.58)
user posted image Incompatible con el Sistema Ccoa's CTB v 3.04 y se desconoce su compatibilidad con el sistema KGC's Active Count Battle.

En caso de encontrar más incompatibilidades, notificarlas.

Crédito:
Script creado por: DerVVulfman Edited by Fegarur
0

Share this post


Link to post
Share on other sites
eso se puede hacer con los eventos en batalla icon4.gif

este scripts es para vagos Edited by misako
0

Share this post


Link to post
Share on other sites
Lo se, pero si miras en la recopilación, la mayoría de scripts son para vagos. xD.png
De todas formas, esto es mucho más sencillo hacerlo con el script. No como otras cosas que casi cuesta más configurar el script que hacer el engine. xD.png
0

Share this post


Link to post
Share on other sites
o muy buen script"soy bago"me encanta aora mismo lo pongo es de los mejores gracias gracias bue aporte auxilio.gif
0

Share this post


Link to post
Share on other sites
"curioso" script xD.png
0

Share this post


Link to post
Share on other sites
jejejejeje xD.png
puse ese scripts y cuando mi hermana se acerco a la pc subi el volumen a todo xD.png
y ella se fue corriendo xD.png
Weeeeeeeeeeeeeeeeeeeee
buen script xD.png
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0