Mundo Maker
¡Bienvenid@ a Mundo Maker!

¿Quieres aprender todo sobre el RPG Maker?



Regístrate y forma parte de Mundo Maker.
Conectarse

Recuperar mi contraseña

Temas importantes
----------------------------------------
Páginas con recursos RPG Maker
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
Afiliados
Estadísticas
Tenemos 4140 miembros registrados.
El último usuario registrado es ReyPizza.

Nuestros miembros han publicado un total de 84802 mensajes en 12071 argumentos.

[RMXP] Ayuda en script Party Changer

Ver el tema anterior Ver el tema siguiente Ir abajo

RPG Maker XP [RMXP] Ayuda en script Party Changer

Mensaje por AsFzKakarotto el 2017-06-04, 04:22

Vengo con un script muy novedoso... que quisas a alguien le fascine o quisas alguien ya lo tenga. El script funciona perfectamente pero me gustaría pedir ayuda a un scripter de generoso corazón xd que me pueda adaptarlo para 4 grupos de héroes y no solo 2 como viene por defecto.

Función de el script:
Este Script nos deja cambiar de Party, o sea, podemos cambiar los integrantes del grupo por otros
que tengamos en reserva. Lo novedoso de este Script es que nos deja cambiar mientras jugamos entre
el Grupo 1 y el 2 en tan solo un instante mientras jugamos.

Instrucciones:
•Para llamar el script pongan:

$scene = Scene_PartyChanger.new

•Para cambiar entre ventanas apreten SHIFT y abajo o arriba
•Para cambiar entre la Party 1 y la 2 usen:

$game_party.switch!

Script:

Código:
#==============================================================================
# ■ Party Changer
#------------------------------------------------------------------------------
#  Made by Selwyn // selwyn@rmxp.ch
#   Version 1
#   released the 9th of September 2006
#
#   to switch between party 1 and party 2, use this line of code :
#     $game_party.switch!
#  
#   to call the Party Changer screen, use this line of code :
#     $scene = Scene_PartyChanger.new
#
#   to switch between windows, hold SHIFT down and press down or up.
#==============================================================================

#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
#  
#==============================================================================

class Game_Party
 #--------------------------------------------------------------------------
 # ● define instance variable
 #--------------------------------------------------------------------------
 attr_reader   :party_a
 attr_reader   :party_b
 attr_reader   :reserve
 attr_reader   :gold
 attr_reader   :steps
 #--------------------------------------------------------------------------
 # ● initialize
 #--------------------------------------------------------------------------
 def initialize
   @switch = false
   @party_a = []
   @party_b = []
   @reserve = []
  
   @gold = 0
   @steps = 0
   @items = {}
   @weapons = {}
   @armors = {}
 end
 #--------------------------------------------------------------------------
 # ● switch!
 #--------------------------------------------------------------------------
 def switch!
   @switch = !@switch
   true
 end
 #--------------------------------------------------------------------------
 # ● switch
 #--------------------------------------------------------------------------
 def switch(a1, index1, a2, index2)
   array1 = [@reserve, @party_a, @party_b][a1]
   array2 = [@reserve, @party_a, @party_b][a2]
   array1[index1], array2[index2] = array2[index2], array1[index1]
   @reserve.compact!
   @party_a.compact!
   @party_b.compact!
 end
 #--------------------------------------------------------------------------
 # ● actors
 #--------------------------------------------------------------------------
 def actors
   if @switch
     return @party_b
   else
     return @party_a
   end
 end
 #--------------------------------------------------------------------------
 # ● actors=
 #--------------------------------------------------------------------------
 def actors=(value)
   if @switch
     @party_b = value
   else
     @party_a = value
   end
 end
 #--------------------------------------------------------------------------
 # ● setup_starting_members
 #--------------------------------------------------------------------------
 def setup_starting_members
   self.actors = []
   for i in $data_system.party_members
     self.actors.push($game_actors[i])
   end
 end
 #--------------------------------------------------------------------------
 # ● setup_battle_test_members
 #--------------------------------------------------------------------------
 def setup_battle_test_members
   self.actors = []
   for battler in $data_system.test_battlers
     actor = $game_actors[battler.actor_id]
     actor.level = battler.level
     gain_weapon(battler.weapon_id, 1)
     gain_armor(battler.armor1_id, 1)
     gain_armor(battler.armor2_id, 1)
     gain_armor(battler.armor3_id, 1)
     gain_armor(battler.armor4_id, 1)
     actor.equip(0, battler.weapon_id)
     actor.equip(1, battler.armor1_id)
     actor.equip(2, battler.armor2_id)
     actor.equip(3, battler.armor3_id)
     actor.equip(4, battler.armor4_id)
     actor.recover_all
     self.actors.push(actor)
   end
   @items = {}
   for i in 1...$data_items.size
     if $data_items[i].name != ""
       occasion = $data_items[i].occasion
       if occasion == 0 or occasion == 1
         @items[i] = 99
       end
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● refresh
 #--------------------------------------------------------------------------
 def refresh
   new_actors = []
   for i in 0...self.actors.size
     if $data_actors[self.actors[i].id] != nil
       new_actors.push($game_actors[self.actors[i].id])
     end
   end
   self.actors = new_actors
 end
 #--------------------------------------------------------------------------
 # ● max_level
 #--------------------------------------------------------------------------
 def max_level
   if self.actors.size == 0
     return 0
   end
   level = 0
   for actor in self.actors
     if level < actor.level
       level = actor.level
     end
   end
   return level
 end
 #--------------------------------------------------------------------------
 # ● add_actor
 #--------------------------------------------------------------------------
 def add_actor(actor_id)
   actor = $game_actors[actor_id]
   unless @party_a.include?(actor) or @party_b.include?(actor)
     if self.actors.size < 4
       self.actors.push(actor)
       $game_player.refresh
     else
       unless @reserve.include?(actor)
         @reserve.push(actor)
       end
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● add_actor_a
 #--------------------------------------------------------------------------
 def add_actor_a(actor_id)
   actor = $game_actors[actor_id]
   unless @party_a.include?(actor) or @party_b.include?(actor)
     if @party_a.size < 4
       @party_a.push(actor)
       $game_player.refresh
     else
       unless @reserve.include?(actor)
         @reserve.push(actor)
       end
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● add_actor_b
 #--------------------------------------------------------------------------
 def add_actor_b(actor_id)
   actor = $game_actors[actor_id]
   unless @party_a.include?(actor) or @party_b.include?(actor)
     if @party_b.size < 4
       @party_b.push(actor)
       $game_player.refresh
     else
       unless @reserve.include?(actor)
         @reserve.push(actor)
       end
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● remove_actor
 #--------------------------------------------------------------------------
 def remove_actor(actor_id)
   actor = $game_actors[actor_id]
   @party_a.delete(actor)
   @party_b.delete(actor)
   unless @reserve.include?(actor)
     @reserve.push(actor)
   end
   $game_player.refresh
 end
 #--------------------------------------------------------------------------
 # ● clear_actions
 #--------------------------------------------------------------------------
 def clear_actions
   for actor in self.actors
     actor.current_action.clear
   end
 end
 #--------------------------------------------------------------------------
 # ● inputable?
 #--------------------------------------------------------------------------
 def inputable?
   for actor in self.actors
     if actor.inputable?
       return true
     end
   end
   return false
 end
 #--------------------------------------------------------------------------
 # ● all_dead?
 #--------------------------------------------------------------------------
 def all_dead?
   if $game_party.actors.size == 0
     return false
   end
   for actor in self.actors
     if actor.hp > 0
       return false
     end
   end
   return true
 end
 #--------------------------------------------------------------------------
 # ● check_map_slip_damage
 #--------------------------------------------------------------------------
 def check_map_slip_damage
   for actor in self.actors
     if actor.hp > 0 and actor.slip_damage?
       actor.hp -= [actor.maxhp / 100, 1].max
       if actor.hp == 0
         $game_system.se_play($data_system.actor_collapse_se)
       end
       $game_screen.start_flash(Color.new(255,0,0,128), 4)
       $game_temp.gameover = $game_party.all_dead?
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● random_target_actor
 #--------------------------------------------------------------------------
 def random_target_actor(hp0 = false)
   roulette = []
   for actor in self.actors
     if (not hp0 and actor.exist?) or (hp0 and actor.hp0?)
       position = $data_classes[actor.class_id].position
       n = 4 - position
       n.times do
         roulette.push(actor)
       end
     end
   end
   if roulette.size == 0
     return nil
   end
   return roulette[rand(roulette.size)]
 end
 #--------------------------------------------------------------------------
 # ● random_target_actor_hp0
 #--------------------------------------------------------------------------
 def random_target_actor_hp0
   return random_target_actor(true)
 end
 #--------------------------------------------------------------------------
 # ● smooth_target_actor
 #--------------------------------------------------------------------------
 def smooth_target_actor(actor_index)
   actor = self.actors[actor_index]
   if actor != nil and actor.exist?
     return actor
   end
   for actor in self.actors
     if actor.exist?
       return actor
     end
   end
 end
end

#==============================================================================
# ■ Window_Party
#------------------------------------------------------------------------------
#  
#==============================================================================

class Window_Party < Window_Selectable
 #--------------------------------------------------------------------------
 # ● initialize
 #--------------------------------------------------------------------------
 def initialize(party = 0)
   super(0, 288 + party * 96, 320, 96)
   self.contents = Bitmap.new(width - 32, height - 32)
   @party = party
   @item_max = @column_max = 4
   refresh
   self.active = false
   self.index = -1
 end
 #--------------------------------------------------------------------------
 # ● refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   @actors = @party == 0 ? $game_party.party_a : $game_party.party_b
   for i in 0...@actors.size
     x = i * 80
     actor = @actors[i]
     draw_actor_graphic(actor, x + 24, 56)
   end
 end
 #--------------------------------------------------------------------------
 # ● actor
 #--------------------------------------------------------------------------
 def actor
   return @actors[self.index]
 end
 #--------------------------------------------------------------------------
 # ● update_cursor_rect
 #--------------------------------------------------------------------------
 def update_cursor_rect
   if @index < 0
     self.cursor_rect.empty
   else
     self.cursor_rect.set(@index * 80, 0, 48, 64)
   end
 end
end

#==============================================================================
# ■ Window_Party
#------------------------------------------------------------------------------
#  
#==============================================================================

class Window_Reserve < Window_Selectable
 #--------------------------------------------------------------------------
 # ● initialize
 #--------------------------------------------------------------------------
 def initialize()
   super(0, 0, 320, 288)
   refresh
   self.active = true
   self.index = 0
 end
 #--------------------------------------------------------------------------
 # ● refresh
 #--------------------------------------------------------------------------
 def refresh
   @item_max = $game_party.reserve.size
   self.contents = nil
   self.contents = Bitmap.new(width - 32, ($game_party.reserve.size + 3) / 4 * 64) rescue Bitmap.new(1, 1)
   @column_max = 4
   for i in 0...$game_party.reserve.size
     x = i % 4 * 80
     y = i / 4 * 64
     actor = $game_party.reserve[i]
     draw_actor_graphic(actor, x + 24, y + 56)
   end
 end
 #--------------------------------------------------------------------------
 # ● actor
 #--------------------------------------------------------------------------
 def actor
   return $game_party.reserve[self.index]
 end
 #--------------------------------------------------------------------------
 # ● top_row
 #--------------------------------------------------------------------------
 def top_row
   return self.oy / 64
 end
 #--------------------------------------------------------------------------
 # ● top_row=
 #--------------------------------------------------------------------------
 def top_row=(row)
   if row < 0
     row = 0
   end
   if row > row_max - 1
     row = row_max - 1
   end
   self.oy = row * 64
 end
 #--------------------------------------------------------------------------
 # ● page_row_max
 #--------------------------------------------------------------------------
 def page_row_max
   return (self.height - 32) / 64
 end
 #--------------------------------------------------------------------------
 # ● update_cursor_rect
 #--------------------------------------------------------------------------
 def update_cursor_rect
   if @index < 0
     self.cursor_rect.empty
     return
   end
   row = @index / @column_max
   if row < self.top_row
     self.top_row = row
   end
   if row > self.top_row + (self.page_row_max - 1)
     self.top_row = row - (self.page_row_max - 1)
   end
   cursor_width = self.width / @column_max - 32
   x = @index % @column_max * (cursor_width + 32)
   y = @index / @column_max * 64 - self.oy
   self.cursor_rect.set(x, y, cursor_width, 64)
 end
end

#==============================================================================
# ■ Window_ChangerStatus
#------------------------------------------------------------------------------
#  
#==============================================================================

class Window_ChangerStatus < Window_Base
 #--------------------------------------------------------------------------
 # ● initialize
 #--------------------------------------------------------------------------
 def initialize()
   super(320, 0, 320, 384)
   self.contents = Bitmap.new(width - 32, height - 32)
 end
 #--------------------------------------------------------------------------
 # ● refresh
 #--------------------------------------------------------------------------
 def refresh(actor)
   return if @actor == actor
   self.contents.clear
   @actor = actor
   return if @actor.nil?
  
   draw_actor_graphic(@actor, 232, 160)
  
   draw_actor_name(@actor, 4, 0)
   draw_actor_class(@actor, 4 + 144, 0)
  
   draw_actor_level(@actor, 4, 32)
   draw_actor_state(@actor, 4, 64)
  
   draw_actor_hp(@actor, 128, 32, 172)
   draw_actor_sp(@actor, 128, 64, 172)
  
   draw_actor_parameter(@actor, 4, 96, 0)
   draw_actor_parameter(@actor, 4, 128, 1)
   draw_actor_parameter(@actor, 4, 160, 2)
  
   draw_actor_parameter(@actor, 4, 208, 3)
   draw_actor_parameter(@actor, 4, 240, 4)
   draw_actor_parameter(@actor, 4, 272, 5)
   draw_actor_parameter(@actor, 4, 304, 6)
 end
end

#==============================================================================
# ■ Window_ChangerSwitching
#------------------------------------------------------------------------------
#  
#==============================================================================

class Window_ChangerSwitching < Window_Base
 #--------------------------------------------------------------------------
 # ● initialize
 #--------------------------------------------------------------------------
 def initialize()
   super(320, 384, 320, 96)
   self.contents = Bitmap.new(width - 32, height - 32)
 end
 #--------------------------------------------------------------------------
 # ● refresh
 #--------------------------------------------------------------------------
 def refresh(actor)
   return if @actor == actor
   self.contents.clear
   @actor = actor
   return if @actor.nil?
   self.contents.draw_text(0, 0, 200, 64, "Switching : #{@actor.name}")
   draw_actor_graphic(@actor, 200 + 32, 56)
 end
end

#==============================================================================
# ■ Scene_PartyChanger
#------------------------------------------------------------------------------
#  
#==============================================================================

class Scene_PartyChanger
 #--------------------------------------------------------------------------
 # ● main
 #--------------------------------------------------------------------------
 def main
   @switching = false
   @switcher = [0, 0]
   @reserve_window = Window_Reserve.new
   @party_a_window = Window_Party.new(0)
   @party_b_window = Window_Party.new(1)
   @status_window  = Window_ChangerStatus.new
   @switch_window  = Window_ChangerSwitching.new
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @reserve_window.dispose
   @party_a_window.dispose
   @party_b_window.dispose
   @status_window.dispose
   @switch_window.dispose
 end
 #--------------------------------------------------------------------------
 # ● refresh
 #--------------------------------------------------------------------------
 def refresh
   @reserve_window.refresh
   @party_a_window.refresh
   @party_b_window.refresh
 end
 #--------------------------------------------------------------------------
 # ● update
 #--------------------------------------------------------------------------
 def update
   @reserve_window.update
   @party_a_window.update
   @party_b_window.update
   @status_window.update
   if Input.trigger?(Input::B)
     $scene = Scene_Map.new
     return
   end
   if @reserve_window.active
     update_reserve
     @status_window.refresh(@reserve_window.actor)
     return
   end
   if @party_a_window.active
     update_party_a
     @status_window.refresh(@party_a_window.actor)
     return
   end
   if @party_b_window.active
     update_party_b
     @status_window.refresh(@party_b_window.actor)
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● update_reserve
 #--------------------------------------------------------------------------
 def update_reserve
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     if @switching
       $game_party.switch(0, @reserve_window.index, *@switcher)
       @switch_window.refresh(nil)
       @switching = false
     else
       @switcher = [0, @reserve_window.index]
       @switch_window.refresh(@reserve_window.actor)
       @switching = true
     end
     refresh
     return
   end
   if Input.press?(Input::SHIFT) and Input.trigger?(Input::DOWN)
     $game_system.se_play($data_system.cursor_se)
     @reserve_window.index = -1
     @reserve_window.active = false
     @party_a_window.index = 0
     @party_a_window.active = true
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● update_party_a
 #--------------------------------------------------------------------------
 def update_party_a
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.cursor_se)
     if @switching
       $game_party.switch(1, @party_a_window.index, *@switcher)
       @switch_window.refresh(nil)
       @switching = false
     else
       @switcher = [1, @party_a_window.index]
       @switch_window.refresh(@party_a_window.actor)
       @switching = true
     end
     refresh
     return
   end
   if Input.press?(Input::SHIFT) and Input.trigger?(Input::UP)
     $game_system.se_play($data_system.cursor_se)
     @party_a_window.index = -1
     @party_a_window.active = false
     @reserve_window.index = 0
     @reserve_window.active = true
     return
   end
   if Input.press?(Input::SHIFT) and Input.trigger?(Input::DOWN)
     $game_system.se_play($data_system.cursor_se)
     @party_a_window.index = -1
     @party_a_window.active = false
     @party_b_window.index = 0
     @party_b_window.active = true
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● update_party_b
 #--------------------------------------------------------------------------
 def update_party_b
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.cursor_se)
     if @switching
       $game_party.switch(2, @party_b_window.index, *@switcher)
       @switch_window.refresh(nil)
       @switching = false
     else
       @switcher = [2, @party_b_window.index]
       @switch_window.refresh(@party_b_window.actor)
       @switching = true
     end
     refresh
     return
   end
   if Input.press?(Input::SHIFT) and Input.trigger?(Input::UP)
     $game_system.se_play($data_system.cursor_se)
     @party_b_window.index = -1
     @party_b_window.active = false
     @party_a_window.index = 0
     @party_a_window.active = true
     return
   end
 end
end

Imagen


El Script es de: Selwyn

Y para matar 2 pájaros en un solo tiro alguien sabe como demonios se cambia
El sonido que da inicio el combate, mientras se juega el juego., no desde la base de datos.
avatar
AsFzKakarotto
Novato
Novato

0/3

Créditos 97

Gracias : 19

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


Permisos de este foro:
No puedes responder a temas en este foro.