|
|||||||
![]() |
|
|
Herramientas | Desplegado |
|
#1
|
||||
|
||||
|
hola tengo el siguiente problema tengo este script de batalla lateral:
posteado por karere5 -Nombre Del Script:batalla lateral -Version Del Script:no se -Rpg Maker:XP bueno la verdad esque ami este scrip no me va me dice que se a colgado al momento de provarlo pero se los dejo aver si a ustedes le va para que me ayuden selos dejo exactamento como lo encontre XD Para empezar se deben crear dos nuevas clases la primera llamada: Animated_sprite que debe contener: Este scrip:
Spoiler
[
Código:
#==============================================================================
# * Animated_Sprite Scripted by: RPG
# editado por: cybersam
# traducido por: Dark_Buster_XYZ
#
# Quite el desmadre que no acupaba en mi script...
# lo demas es script de RPG... (aqui)
#
#------------------------------------------------------------------------------
# Una clase para Animated_sprite.
#==============================================================================
class Animated_Sprite < RPG::Sprite
#--------------------------------------------------------------------------
# - Variables de caso accesibles.
#--------------------------------------------------------------------------
attr_accessor :frames # Numero de cuadrosdeanimacion
attr_accessor :delay # tiempo entre cuadros (velocidad)
attr_accessor :frame_width # ancho de cadacuadro
attr_accessor :frame_height # alto de cada cuadro
attr_accessor :offset_x # Coordenada X para el primer cuadro
attr_accessor :offset_y # Coordenada Y para todos los cuadros
attr_accessor :current_frame # cuadro de animacion actual
attr_accessor :moving # se esta moviendo el sprite?
#--------------------------------------------------------------------------
# - Analiza un sprite animado
# puerto de vista : puerto de vista del sprite
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
@frame_width, @frame_height = 0, 0
change # un cambio basico para iniciar variables
@old = Graphics.frame_count # parael metodo de retarzo
@goingup = true # Incrementando animacion? (if @rm2k_mode is true)
@once = false # la animacion solo se reproduce una vez?
@animated = true # suele parar la animacion si @once es true
end
#--------------------------------------------------------------------------
# Comentario por RPG
# - Cambia la fuente (cambia la animacion)
# frames : Numero de cuadros
# delay : retarzo del cuadro, controla la velocidad
# offx : Coordenada X para el cuadro inicial
# offy : Coordenada y para todos los cuadros
# startf : Cuadro en que inicialaanimacion
# once : la animacion se reproduce una vez?
# rm2k_mode : modelo de animacion: 1-2-3-2 si es true, 1-2-3-1 si es false
#
# Comentario por cybersam
#
# el rm2k_mode ya no esta...
#--------------------------------------------------------------------------
def change(frames = 0, delay = 0, offx = 0, offy = 0,
startf = 0, once = false)
@frames = frames
@delay = delay
@offset_x, @offset_y = offx, offy
@current_frame = startf
@once = once
x = @current_frame * @frame_width + @offset_x
self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
@goingup = true
@animated = true
end
#--------------------------------------------------------------------------
# - Actualizar animacion y movimiento
#--------------------------------------------------------------------------
def update
super
if self.bitmap != nil and delay(@delay) and @animated
x = @current_frame * @frame_width + @offset_x
self.src_rect = Rect.new(x, @offset_y, @frame_width, @frame_height)
@current_frame = (@current_frame + 1) unless @frames == 0
@animated = false if @current_frame == @frames and @once
@current_frame %= @frames
end
end
#--------------------------------------------------------------------------
# - Move el sprite
# x : Coordenada X para el punto de destino
# y : Coordenada Y para el punto de destinot
# speed : velocidad de animacion (0 = retrazado, 1+ = rapido)
# delay : movimiento retrazado si la velocidad es = 0
#--------------------------------------------------------------------------
def move(x, y, speed = 1, delay = 0)
@destx = x
@desty = y
@move_speed = speed
@move_delay = delay
@move_old = Graphics.frame_count
@moving = true
end
#--------------------------------------------------------------------------
# - Mueve el sprite a destx y desty
#--------------------------------------------------------------------------
def update_move
return unless @moving
movinc = @move_speed == 0 ? 1 : @move_speed
if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0
self.x += movinc if self.x < @destx
self.x -= movinc if self.x > @destx
self.y += movinc if self.y < @desty
self.y -= movinc if self.y > @desty
@move_old = Graphics.frame_count
end
if @move_speed > 1 # Checasi el Sprite no pude llegar a su destino
self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and
(@destx - self.x).abs <= @move_speed
self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and
(@desty - self.y).abs <= @move_speed
end
if self.x == @destx and self.y == @desty
@moving = false
end
end
#--------------------------------------------------------------------------
# - Pausa la animacion, pero lo sigue actualizando
# frames : numero de cuadros
#--------------------------------------------------------------------------
def delay(frames)
update_move
if (Graphics.frame_count - @old >= frames)
@old = Graphics.frame_count
return true
end
return false
end
end
y debajo de esta la segunda llamada: Battle_animation quer debe contener Este otro scrip:
Spoiler
Código:
#===============================================================================
#
# Full Animated Side View Battle System (CBS) (v2.5) by cybersam
#
#===============================================================================
#
# y arrancamos!!!...
# esto hace el script muy fácil de ejecutar
# solamente añaden una nueva clase sobre "Main"
# e insertan esta cosa rara ahi
#
# como pueden ver que el scrip de cambio de sprite es del script
# japones entonces los créditos van para ellos ....
# lo edite un poco para que mostrara mas sprites y animaciones
# y añadi unaque otra cosita ...
# las siguiente es el movimiento de jugador...
#
#
#
# conseguí el script cambi battler en el scrip japones...
# los créditos de esto van al tipo que hizo esto...
#
# XRXS11. ver.0
#
# desde este instante no mas scrip japones ...
# no mas credito a ellos...
# pero le dejaré aquí ya que esto me ayudó mucho...
#
#
# como para las ideas ... missy me dio ideas realmente buenas
# que me ayudaron un chorro cuando no hallaba el rollo a algunos de estos rasgos...
#
# un credito mas que mencionar...
# es un scriptde RPG...
# no todo aqui...
# pero lo veras en los comentarios de script
#
#-------------------------------------------------------------------------------
#
# ok... desde que uso el movement script de RPG...
# hubo muchos cambios...
#
# cuando mires el script encontraras lineascomo: "pose(n)" o "enemy_pose(n)"
# desdeque quize que mis sprites tuvieran diferentes sprites...
# agregue una opcion a esto...
# si escribe un numero despues de "n" (la "n" significa el sprite que se
# esta usando)
# fo example 8... ("pose(4, 8)") esto le dira al escrip quela animacion 4
# tiene 8 cuadros...
# pose se usa con el juagador... y enemy_pose para el enemigo...
# use mis viejos numeros de sprite... (esta vezen solo un sprite...)
#
# esplicacion de las animaciones... (los digitos)
#
#
# 0 = mover (durante la pelea)
# 1 = inmovil
# 2 = defenza
# 3 = golpe (ser atacado)
# 4 = ataque
# 5 = habilidad
# 6 = muerte
# 7 = pose de victoria... idea de RPG....
#
#
# por su puesto este solo es el comienzo...
# se pueden agragar masanimaciones...
# pero por ahora es suficiente...
#
# mucho se cambio... y parece que ya quedo...
# por supuesto nesesita ser refinado porti para que se adecue a tu juego...
#
#
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
# no nesitas cambiar al actordel juego para que funcione
# en la batalla...
# esto lo hace por ti... ^-^
def screen_x
if self.index != nil
return self.index * 40 + 460
else
return 0
end
end
def screen_y
return self.index * 20 + 220
end
def screen_z
if self.index != nil
return self.index
else
return 0
end
end
end
class Spriteset_Battle
#desmadre de RPG...
attr_accessor :actor_sprites
attr_accessor :enemy_sprites
# acaba aqui... ^-^
def initialize
@viewport0 = Viewport.new(0, 0, 640, 480)
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
@battleback_sprite = Sprite.new(@viewport0)
# arreglo para enemigos... para que no ataquen al incorrecto...
# lo arregle hace mucho pero de todos modos lo comento
# pa que sepan de eso... ^-^''
@enemy_sprites = []
for enemy in $game_troop.enemies#.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@weather = RPG::Weather.new(@viewport0)
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
@timer_sprite = Sprite_Timer.new
update
end
def dispose
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.dispose
for sprite in @enemy_sprites + @actor_sprites
sprite.dispose
end
@weather.dispose
for sprite in @picture_sprites
sprite.dispose
end
@timer_sprite.dispose
@viewport0.dispose
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
@viewport4.dispose
end
def update
# esto hace que el personaje active tenga prioridad... (por Missy)
@viewport1.z = 50 and @viewport2.z = 51 if $actor_on_top == true
@viewport1.z = 51 and @viewport2.z = 50 if $actor_on_top == false
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 480)
if @battleback_sprite.bitmap.height == 320
@battleback_sprite.zoom_x = 1.5
@battleback_sprite.zoom_y = 1.5
@battleback_sprite.x = 320
@battleback_sprite.y = 480
@battleback_sprite.ox = @battleback_sprite.bitmap.width / 2
@battleback_sprite.oy = @battleback_sprite.bitmap.height
else
@battleback_sprite.x = 0
@battleback_sprite.y = 0
@battleback_sprite.ox = 0
@battleback_sprite.oy = 0
@battleback_sprite.zoom_x = 1
@battleback_sprite.zoom_y = 1
end
end
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
for sprite in @picture_sprites
sprite.update
end
@timer_sprite.update
@viewport0.tone = $game_screen.tone
@viewport0.ox = $game_screen.shake
@viewport4.color = $game_screen.flash_color
@viewport0.update
@viewport1.update
@viewport2.update
@viewport4.update
end
end
#==============================================================================
# Sprite Battler para el sistema de batalla lateral
#==============================================================================
# aqui haces animaciones y esas cosas...
# se que no es la mejor manera...
# pero fue la primera funcional que encontre....
# estonesestia cierto conocimiento de como funcionana las animaciones...
# si deseas cambiar algo...
# no lo explicare mucho por que es facil si sabes que hacer
# por otro lado creo quete tomara un pococ entenderlo, pero creo que quien
# de editar esto sabe queesta haciendo... ^-^
#
#
#
# aqui cambiare totalmente la clase "Sprite_Battler"...
# por lo que si cambiaste algo ahi tambien lo debes cambiar aqui
# (creo... que no lo probe... asi que te lo dejo a tu criterio)
# lo agregue lo marcare con: --> #
# lo que se tieneque explicar viene comentado...
# pero no completamente...
class Sprite_Battler < Animated_Sprite
attr_accessor :battler
attr_reader :index
attr_accessor :target_index
attr_accessor :frame_width
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@pattern_b = 0 #
@counter_b = 0 #
@index = 0 #
# esto es parael estado de la animacion...
# nolocambies amenosque sepas lo que haces...
$noanimation = false
@frame_width, @frame_height = 64, 64
# esmpieza el sprite
@battler.is_a?(Game_Enemy) ? enemy_pose(1) : pose(1)
@battler_visible = false
if $target_index == nil
$target_index = 0
end
end
def index=(index) #
@index = index #
update #
end #
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
def enemy #
$target_index += $game_troop.enemies.size
$target_index %= $game_troop.enemies.size
return $game_troop.enemies[$target_index] #
end #
def actor #
$target_index += $game_party.actors.size
$target_index %= $game_party.actors.size
return $game_party.actors[$target_index] #
end
#==============================================================================
# aqui hay un fragmento del scriptde RPG...
# solo cambie lineas desde aqui...
#
# aqui pudes agregar mas lineasde animacion... si tienes... ^-^
#==============================================================================
def pose(number, frames = 4)
case number
when 0 # correr
change(frames, 5, 0, 0, 0)
when 1 # inmovil
change(frames, 5, 0, @frame_height)
when 2 # defender
change(frames, 5, 0, @frame_height * 2)
when 3 # herido
change(frames, 5, 0, @frame_height * 3)
when 4 # ataque
change(frames, 5, 0, @frame_height * 4, 0, true)
when 5 # habilidad
change(frames, 5, 0, @frame_height * 5)
when 6 # muerte
change(frames, 5, 0, @frame_height * 6)
when 7 # victoria
change(frames, 5, 0, @frame_height * 7)
#when 8
# change(frames, 5, 0, @frame_height * 9)
# ...etc.
else
change(frames, 5, 0, 0, 0)
end
end
#--------------------------------------------------------------------------
# - Cambia la pose del enemigo
# numero : numero de la pose
#--------------------------------------------------------------------------
def enemy_pose(number ,enemy_frames = 4)
case number
when 0 # correr
change(enemy_frames, 5, 0, 0, 0)
when 1 # inmovil
change(enemy_frames, 5, 0, @frame_height)
when 2 # defender
change(enemy_frames, 5, 0, @frame_height * 2)
when 3 # herido
change(enemy_frames, 5, 0, @frame_height * 3)
when 4 # ataque
change(enemy_frames, 5, 0, @frame_height * 4, 0, true)
when 5 # habilidad
change(enemy_frames, 5, 0, @frame_height * 5)
when 6 # muerte
change(enemy_frames, 5, 0, @frame_height * 6)
when 7 # victoria
change(enemy_frames, 5, 0, @frame_height * 7)
# ...etc.
else
change(enemy_frames, 5, 0, 0, 0)
end
end
def default_pose
pose(1)
# aqui se cambia la pose de default si
# no tenemos mas del 75% de vida
# si PV es un poco bajo (- 25%)
if (@battler.hp * 100) /@battler.maxhp < 25
pose(9)
# si PV es bajo (- 50%)
elsif (@battler.hp * 100) /@battler.maxhp < 50
pose(9)
# si pv es muy bajo (- 75%)
elsif (@battler.hp * 100) /@battler.maxhp < 75
pose(9)
end
# y aqui cambiamos la animacion siel personaje esta
# envenenado, dormido, o similar...
# solo puse el dormido y el envenenado para provar...
if @battler.state?(3) # veneno
# cambia a la pose de dormido...
# (notengo muchos sprites asi que use la de defenza)
# puedes agregar mas sprites, incluse uno para cada estado...
pose(2)
elsif @battler.state?(7) #dormido
# cambia a envene nado
pose(6)
end
end
#==============================================================================
# fin del fracmento...
#==============================================================================
def update
super
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
if @battler.name != @battler_name
@battler.battler_hue != @battler_hue
@battler_hue = @battler.battler_hue
@battler_name = @battler.name
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @frame_width / 2
self.oy = @frame_height
if @battler.dead? or @battler.hidden
self.opacity = 0
end
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
if $noanimation == false
if @battler.damage == nil and
@battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
else
dispose_loop_animation
end
if @battler.is_a?(Game_Actor) and @battler_visible
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
if @battler.blink
blink_on
else
blink_off
end
unless @battler_visible
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
appear
@battler_visible = true
end
if not @battler.hidden and
(@battler.damage == nil or @battler.damage_pop) and
@battler.is_a?(Game_Actor)
appear
@battler_visible = true
end
end
if @battler_visible
if @battler.hidden
$game_system.se_play($data_system.escape_se)
escape
@battler_visible = false
end
if @battler.white_flash
whiten
@battler.white_flash = false
end
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
collapse
@battler_visible = false
else
$game_system.se_play($data_system.actor_collapse_se) unless @dead
@dead = true
pose(6)
end
else
@dead = false
end
end #
end
end
#==============================================================================
# Scene_Battle Sistemade Batalla Lateral
#==============================================================================
class Scene_Battle
def update_phase4
case @phase4_step
when 1
update_phase4_step1
when 2
update_phase4_step2
when 3
update_phase4_step3
when 4
update_phase4_step4
when 5
update_phase4_step5
when 6
update_phase4_step6
when 7
update_phase4_step7
end
end
def update_phase4_step1
# Cambiala pose del actor a default
#if @active_battler.is_a?(Game_Actor)
# @spriteset.actor_sprites[@active_battler.index].default_pose
#end
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
@spriteset.actor_sprites[i].default_pose unless actor.dead?
end
@help_window.visible = false
if judge
return
end
if $game_temp.forcing_battler == nil
setup_battle_event
if $game_system.battle_interpreter.running?
return
end
end
if $game_temp.forcing_battler != nil
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
if @action_battlers.size == 0
start_phase2
return
end
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
@active_battler = @action_battlers.shift
if @active_battler.index == nil
return
end
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
@active_battler.remove_states_auto
@status_window.refresh
@phase4_step = 2
end
def make_basic_action_result
if @active_battler.is_a?(Game_Actor)
$actor_on_top = true
elsif @active_battler.is_a?(Game_Enemy)
$actor_on_top = false
end
if @active_battler.current_action.basic == 0
#============================================================================
# EMPIEZAN LAS ARMAS...
#============================================================================
#
#======== DIFERENTES ARMAS CON DIFERENTES ANIMACIONES
#
# es massimple de lo que parece...
# si quiresagregar una animacion a un arma checa...
# y espero que descubras como funciona...
#
#
# si no...
# aqui esta como...
# primero...
# solo copia y pega "elseif @active_battler_enemy.weapon_id == ID..."
# justo después el último @weapon_sprite....
#
# El ID lo nesesitas chacaren tu base de datos y ver el numero antes de tu arma
# y ese el Id que nesesitas...
#
# lo mismova para el lado enemigo... ^-^
# normalmento los enemigosno acupan mas sprites para armas....
#
# si quieres usar mas... esntonces reemplaza "@weapon_sprite_enemy = 4"
# con estas lineas... (pero ocupas editarlas)
#
# if @active_battler.weapon_id == 1 # <-- numero ID del arma
# @weapon_sprite_enemy = 4 # <-- animacion de batalla
# elsif @active_battler.weapon_id == 5 # <-- numero ID del arma
# @weapon_sprite_enemy = 2 # <-- animacion de batalla
# elsif @active_battler.weapon_id == 9 # <-- numero ID del arma
# @weapon_sprite_enemy = 0 # <-- animacion de batalla
# elsif @active_battler.weapon_id == 13 # <-- numero ID del arma
# @weapon_sprite_enemy = 6 # <-- animacion de batalla
# else
# @weapon_sprite_enemy = 4
# end
#
#================================= FIN
if @active_battler.is_a?(Game_Actor)
if @active_battler.weapon_id == 1 # <-- numero ID del arma
@weapon_sprite = 4 # <-- animacion de batalla
elsif @active_battler.weapon_id == 5 # <-- numero ID del arma
@weapon_sprite = 2 # <-- animacion de batalla
elsif @active_battler.weapon_id == 9 # <-- numero ID del arma
@weapon_sprite = 0 # <-- animacion de batalla
elsif @active_battler.weapon_id == 13 # <-- numero ID del arma
@weapon_sprite = 6 # <-- animacion de batalla
else
@weapon_sprite = 4
end
# seccion del enemigo aqui... ^-^
else# @active_battler.is_a?(Game_Enemy)
@weapon_sprite_enemy = 4
end
#
#=============================================================================
# Fin de las armas....
#=============================================================================
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
#======== aqui se configuran movimientos y animaciones...
x = target.screen_x - 32
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
@spriteset.enemy_sprites[@active_battler.index]\
.move(x, target.screen_y, 10)
#========= si abserbas la configuracion del script RPG
#========= que el toma el numero 40 para la velocidad de la animacion...
#========= y creoque es muy rapidoasi que lo baje a 10...
end
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
#======= lo mismo para el jugador... ^-^
x = target.screen_x + 32
@spriteset.actor_sprites[@active_battler.index].pose(0)
@spriteset.actor_sprites[@active_battler.index]\
.move(x, target.screen_y, 10)
end
@target_battlers = [target]
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
if @active_battler.current_action.basic == 1
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(2) #defenza
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(2) #defenza
end
@help_window.set_text($data_system.words.guard, 1)
return
end
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
@help_window.set_text("Escapar", 1)
@active_battler.escape
return
end
if @active_battler.current_action.basic == 3
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
if @active_battler.current_action.basic == 4
if $game_temp.battle_can_escape == false
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
update_phase2_escape
return
end
end
#--------------------------------------------------------------------------
# Accion de Habilidad...
#--------------------------------------------------------------------------
def make_skill_action_result
@skill = $data_skills[@active_battler.current_action.skill_id]
unless @active_battler.current_action.forcing
unless @active_battler.skill_can_use?(@skill.id)
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
@active_battler.sp -= @skill.sp_cost
@status_window.refresh
@help_window.set_text(@skill.name, 1)
#=============================================================================
# INICIAN LOS SPRITESDE HABILIDAD
#=============================================================================
# es lo mismo que en el de armas...
#============================================================================
# Animacion de batalla Battle_animation
#============================================================================
#
# para quien esta en esto por primera vez
# vean el script espero que sea facil deentender...
#
# el numero despues de "pose" es el IDde animacion... y es igual para las demas.
# si tienes una animacion de habilidad con mascuadros...
# solo insertael numaro de cuadros despues del primer numero...
# se ve asi.... "pose(5, 8)" <-- 5 es la animacion...
# 8 esel maximo de cuadros (quiere decir que tu animacion tiene 8 cuadros...) ^-^
if @active_battler.is_a?(Game_Actor)
if @skill.name == "Cura" # <-- nombre de la primer habilidad
@spriteset.actor_sprites[@active_battler.index].pose(5) # <-- numero del sprite
elsif @skill.name == "Cross Cut" # <-- nombre de la segunda habilidad
@spriteset.actor_sprites[@active_battler.index].pose(6) # <-- numero del sprite
elsif @skill.name == "Fuego" # <-- nombre de la tercer habilidad
@spriteset.actor_sprites[@active_battler.index].pose(6) # <-- numero del sprite
end
else
if @skill.name == "Cura" # <-- nombre de la primer habilidad
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(5) # <-- numero del sprite
elsif @skill.name == "Cross Cut" # <-- nombre de la segunda habilidad
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(6) # <-- numero del sprite
elsif @skill.name == "Fuego" # <-- nombre de la tercer habilidad
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(6) # <-- numero del sprite
end
end
#=============================================================================
# TERMINAN LAS HABILIDADES
#=============================================================================
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = @skill.common_event_id
set_target_battlers(@skill.scope)
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# Como usamos los items
#--------------------------------------------------------------------------
def make_item_action_result
# disculpen pero aqui no meti mano...
# por quenotengo sprite de uso de objetos....
# soloagregue el sprite "inmovil" aqui...
# cuando tenga mastiempo usare uno... ^-^
# es lo mismo que en los otros...
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(1)
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
end
@item = $data_items[@active_battler.current_action.item_id]
unless $game_party.item_can_use?(@item.id)
@phase4_step = 1
return
end
if @item.consumable
$game_party.lose_item(@item.id, 1)
end
@help_window.set_text(@item.name, 1)
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
@common_event_id = @item.common_event_id
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
set_target_battlers(@item.scope)
for target in @target_battlers
target.item_effect(@item)
end
end
#==============================================================================
# otra vez.... un fracmento del scriptde RPG
#==============================================================================
# esto es parala pose de victoria...
def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
treasures = treasures[0..5]
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
$noanimation = true
@spriteset.actor_sprites[i].pose(7) unless actor.dead? # {=====}
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end
$game_party.gain_gold(gold)
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
@result_window = Window_BattleResult.new(exp, gold, treasures)
@phase5_wait_count = 100
end
#--------------------------------------------------------------------------
# actualizando el movimiento
# desde queRPG nolo comentaba... yo lo explicare...
#--------------------------------------------------------------------------
def update_phase4_step3
if @active_battler.current_action.kind == 0 and
@active_battler.current_action.basic == 0
# aqui... tenemos la animaciones de armas... para jugadores y enemigos
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(@weapon_sprite)
elsif @active_battler.is_a?(Game_Enemy)
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(@weapon_sprite_enemy)
end
end
if @animation1_id == 0
@active_battler.white_flash = true
else
@active_battler.animation_id = @animation1_id
@active_battler.animation_hit = true
end
@phase4_step = 4
end
def update_phase4_step4
# aqui para la animacion del golpe...
for target in @target_battlers
if target.is_a?(Game_Actor) and !@active_battler.is_a?(Game_Actor)
if target.guarding?
@spriteset.actor_sprites[target.index].pose(2)
else
@spriteset.actor_sprites[target.index].pose(3)
end
elsif target.is_a?(Game_Enemy) and !@active_battler.is_a?(Game_Enemy)
if target.guarding?
@spriteset.enemy_sprites[target.index].enemy_pose(2)
else
@spriteset.enemy_sprites[target.index].enemy_pose(3)
end
end
target.animation_id = @animation2_id
target.animation_hit = (target.damage != "Miss")
end
@wait_count = 8
@phase4_step = 5
end
def update_phase4_step5
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
@help_window.visible = false
@status_window.refresh
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(1)
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
end
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
if @active_battler.is_a?(Game_Actor)
@spriteset.actor_sprites[@active_battler.index].pose(1)
else
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
end
end
end
@phase4_step = 6
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
def update_phase4_step6
# aqui vemos si el jugador esta muerto y si es jugador o ememigo...
# estas lineas son para correrde regreso y la animacion inmovil....
if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
@spriteset.actor_sprites[@active_battler.index]\
.move(@active_battler.screen_x, @active_battler.screen_y, 20)
@spriteset.actor_sprites[@active_battler.index].pose(0)
elsif !@active_battler.dead?
@spriteset.enemy_sprites[@active_battler.index]\
.move(@active_battler.screen_x, @active_battler.screen_y, 20)
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
end
for target in @target_battlers
if target.is_a?(Game_Actor) and !target.dead?
@spriteset.actor_sprites[target.index].pose(1)
elsif !target.dead?
@spriteset.enemy_sprites[target.index].enemy_pose(1)
end
end
$game_temp.forcing_battler = nil
if @common_event_id > 0
common_event = $data_common_events[@common_event_id]
$game_system.battle_interpreter.setup(common_event.list, 0)
end
@phase4_step = 7
end
def update_phase4_step7
# aqui vemos si el jugador esta muerto y si es jugador o ememigo...
# estas lineas son para correrde regreso y la animacion inmovil....
if @active_battler.is_a?(Game_Actor) and !@active_battler.dead?
@spriteset.actor_sprites[@active_battler.index].pose(1)
elsif !@active_battler.dead?
@spriteset.enemy_sprites[@active_battler.index].enemy_pose(1)
end
$game_temp.forcing_battler = nil
if @common_event_id > 0
common_event = $data_common_events[@common_event_id]
$game_system.battle_interpreter.setup(common_event.list, 0)
end
@phase4_step = 1
end
# y esta extra... wsin esto no funciona correctamente...
def update
if $game_system.battle_interpreter.running?
$game_system.battle_interpreter.update
if $game_temp.forcing_battler == nil
unless $game_system.battle_interpreter.running?
unless judge
setup_battle_event
end
end
if @phase != 5
@status_window.refresh
end
end
end
$game_system.update
$game_screen.update
if $game_system.timer_working and $game_system.timer == 0
$game_temp.battle_abort = true
end
@help_window.update
@party_command_window.update
@actor_command_window.update
@status_window.update
@message_window.update
@spriteset.update
if $game_temp.transition_processing
$game_temp.transition_processing = false
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
if $game_temp.message_window_showing
return
end
if @spriteset.effect?
return
end
if $game_temp.gameover
$scene = Scene_Gameover.new
return
end
if $game_temp.to_title
$scene = Scene_Title.new
return
end
if $game_temp.battle_abort
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
return
end
if @wait_count > 0
@wait_count -= 1
return
end
# esto pausa la battalla mientras el personaje se mueve
for actor in @spriteset.actor_sprites
if actor.moving
return
end
end
# y esto es para el enemigo...
for enemy in @spriteset.enemy_sprites
if enemy.moving# and $game_system.animated_enemy
return
end
end
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
case @phase
when 1
update_phase1
when 2
update_phase2
when 3
update_phase3
when 4
update_phase4
when 5
update_phase5
end
end
#==============================================================================
# fin del fracmento
#==============================================================================
#------------------------------------------------------------------------------
# Scripted by: RPG
# editado por: cybersam
# traducido por: Dark_Buster_XYZ
#------------------------------------------------------------------------------
end
Ambos sobre main Por ejemplo: * Animated_sprite * Battle_animation * Main Para que funcione adecuadamente se deben poner en la carpeta Battlers los sprites detallados que vamos a usar, y que deben medir 64 x 64 cada cuadro de animacion y se aconseja que sean de 4 x minimo 7 ejemplo con el mismo nombre del personaje y mirando al lado correcto esto es tanto para personajes como para enemigos Battlers para este Script: Pack 1 ScreenShots: ![]() ah por cierto creditos a el por subirlo xD bueno volviendo al tema es que ya estoy completamente enojado de no poder alinear los sprites ya que en el momento de la batalla el personaje se mueve de manera erratica y ya estoy cansado de intentar alinear los personajes entonces queria saber si hay algun programa que me facilite la alineacion de los sprites claro tomando de ejemplo la chica de arriba ayuda plis Última edición por carlini32 fecha: 19-oct-2009 a las 18:53. |
|
|
|||
|
|||
|
como alinear sprites
|
![]() |
| Herramientas | |
| Desplegado | |
|
|
Temas Similares para: como alinear sprites
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Como hago sprites ? | blablablaxD | Ayuda | 1 | 18-ago-2009 05:01 |
| Como poner sprites y pedidos de sprites | MASTER-XELOR | Hack Roms | 0 | 27-abr-2009 23:42 |
| Como conseguir sprites | miniadri | Ayuda | 11 | 06-nov-2008 22:02 |
| Como renderizar Sprites | ~Εтэяпαl™ | Ayuda | 5 | 30-sep-2008 01:48 |
| Como se ponen las animaciones en las firmas y como se acen gifs a traves de sprites? | Nhaem | Firmas | 6 | 05-mar-2007 03:36 |







Mode Lineal
