[VX] KOMPATYBILNOŚĆ - Wersja do druku
Ultima Forum
[VX] KOMPATYBILNOŚĆ - Wersja do druku

+- Ultima Forum (https://forum.ultimateam.pl)
+-- Dział: RPG Maker (/Forum-RPG-Maker)
+--- Dział: Wsparcie (/Forum-Wsparcie)
+--- Wątek: [VX] KOMPATYBILNOŚĆ (/Thread-VX-KOMPATYBILNO%C5%9A%C4%86)



KOMPATYBILNOŚĆ - Nokachi - 10-01-14 22:08

Mam problem. Otóż dwa skrypty: ten http://www.ultimateam.pl/viewtopic.php?t=2068
i ten http://www.ultimateam.pl/viewtopic.php?p=71332#71332 gryzą się wzajemnie. Podejrzewam, że chodzi o numerowanie @scene ale nie jestem na tyle zaawansowany żeby samemu temu zaradzić. Czy ktoś mądry mógłby mi pomóc?


RE: KOMPATYBILNOŚĆ - Ayene - 12-01-14 17:50

Skrypt na rozdawanie punktów zamień na poniższy:
Kod:
#==============================================================================
# Requiem Upgrade
# Autor: Requiem
# Zamieścił: Karsznickus
# Modyfikacja z samowyskakującym oknem: Ayene
# Modyfikacja z ikoną awansu pobrana od Blizzarda
#==============================================================================

module Ayene
  
  # Samowyświetlające się okno - przy każdym następnym awansie okno samo będzie
  # się pojawiać
  OKNO_UP = false    # true / false
  
  # Ikona sygnalizująca awans na poziom
  LEVEL_UP_ICON = true  # true / false
  
  # Parametry ikony [x, y, opacity]
  ICON_DATA = [510, 380, 200]
  
end

Points_Gained = 5 # liczba punktów co poziom

#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  
  attr_accessor :points
  
  alias requiem_upgwnd_initialize initialize
  alias requiem_upgwnd_lvlup level_up
  
  def initialize(actor_id)
    requiem_upgwnd_initialize(actor_id)
    @points = 0
  end
  
  def level_up
    requiem_upgwnd_lvlup
    @points += Points_Gained
    # gdy awans na poziom następuje poprzez bezpośrednie dodanie exp drużynie
    if Ayene::OKNO_UP == true
      $scene = Scene_RequiemUpgrade.new(0,false) unless $game_temp.in_battle == true      
    end
  end
end

#------------------------------------------------------------------------------
# by Ayene
# okno ze statystykami wyświetla się po walce, gdy ktoś z drużyny ma awans
if Ayene::OKNO_UP
  class Scene_Battle < Scene_Base    
    alias ayene_proc_vic process_victory
    def process_victory
      ayene_proc_vic    
      if $game_party.members.any? {|actor| actor.points > 0}
        $scene = Scene_RequiemUpgrade.new(0,false)
      else
       battle_end(0)
      end
    end
  end
end
#koniec

#------------------------------------------------------------------------------
# by Ayene
class Scene_Map < Scene_Base
  alias terminate_sds_later terminate
  def terminate
    terminate_sds_later
    @notify.dispose unless @notify.nil?
  end
  
  alias upd_sds_later update
  def update
    upd_sds_later
    check_icon if Ayene::LEVEL_UP_ICON
  end
  
  def check_icon
    if $game_party.members.any? {|actor| actor.points > 0}
      if @notify == nil
        @notify = Sprite.new
      else        
        @notify.bitmap = Bitmap.new(24, 24)
        @notify.bitmap.fill_rect(0, 0, 24, 24, Color.new(255, 255, 255))
        @notify.bitmap.fill_rect(22, 1, 2, 23, Color.new(0, 0, 0))
        @notify.bitmap.fill_rect(1, 22, 23, 2, Color.new(0, 0, 0))
        @notify.bitmap.set_pixel(23, 0, Color.new(0, 0, 0))
        @notify.bitmap.set_pixel(0, 23, Color.new(0, 0, 0))
        @notify.bitmap.fill_rect(2, 2, 20, 20, Color.new(0, 0, 224))
        @notify.bitmap.fill_rect(4, 10, 16, 4, Color.new(255, 255, 255))
        @notify.bitmap.fill_rect(10, 4, 4, 16, Color.new(255, 255, 255))
        @notify.opacity = Ayene::ICON_DATA[2]
      end  
      @notify.x, @notify.y = Ayene::ICON_DATA[0, 2]
      @notify.z = 5000
    end
    @notify.update unless @notify.nil?
  end
end
#koniec

#------------------------------------------------------------------------------
class Requiem_UpgradeWindow < Window_Base
  
  def initialize(actor)
    super(0,65,320,320)
    @actor = actor
    update
  end
  
  def update
    self.contents.clear
    draw_actor_face(@actor,0,0,92)
    draw_actor_name(@actor,160,0)
    self.contents.font.color = normal_color
    self.contents.draw_text(224,28,64,WLH,@actor.level)
    self.contents.draw_text(224,26*2,64,WLH,@actor.points)
    self.contents.draw_text(128,24*5,96,WLH,@actor.maxhp)
    self.contents.draw_text(128,24*6,96,WLH,@actor.maxmp)
    self.contents.draw_text(128,24*7,96,WLH,@actor.atk)
    self.contents.draw_text(128,24*8,96,WLH,@actor.def)
    self.contents.draw_text(128,24*9,96,WLH,@actor.spi)
    self.contents.draw_text(128,24*10,96,WLH,@actor.agi)
    refresh
  end
  
  def refresh
    self.contents.font.color = system_color
    self.contents.draw_text(128,28,128,WLH,Vocab::level+":")
    self.contents.draw_text(128,26*2,128,WLH,"Punkty:")
    self.contents.draw_text(0,24*5,128,WLH,Vocab::hp_a+":")
    self.contents.draw_text(0,24*6,128,WLH,Vocab::mp_a+":")
    self.contents.draw_text(0,24*7,128,WLH,Vocab::atk+":")
    self.contents.draw_text(0,24*8,128,WLH,Vocab::def+":")
    self.contents.draw_text(0,24*9,128,WLH,Vocab::spi+":")
    self.contents.draw_text(0,24*10,128,WLH,Vocab::agi+":")
  end
  
end

# by Ayene
# Niewielka modyfikacja Window_Help
class Window_Help < Window_Base
  def initialize (y = 0, width = 544)
    super(0, y, width, WLH + 32)
  end
end
# koniec
#------------------------------------------------------------------------------
class Scene_RequiemUpgrade < Scene_Base
  
  def initialize(actor_index=0, from_menu=false)
    create_menu_background
    @actor_index = actor_index
    @from_menu = from_menu
  end
  
  def start
    super
    create_menu_background    
    @actor = $game_party.members[@actor_index]
    @requiem_upgwindow = Requiem_UpgradeWindow.new(@actor)
    @requiem_upgwindow.x = (544 - @requiem_upgwindow.width) / 2
    @requiem_upgcmdwnd  = Window_Command.new(64,[" +"," +"," +"," +"," +"," +"])
    @requiem_upgcmdwnd.index = 0
    @requiem_upgcmdwnd.x = @requiem_upgwindow.x + 192
    @requiem_upgcmdwnd.y = @requiem_upgwindow.y + 120
    @requiem_upgcmdwnd.opacity = 0
    # by Ayene
    # Dodany Window_Help
    @help_window = Window_Help.new (10, 320)
    @help_window.x = (544 - @requiem_upgwindow.width) / 2
    @help_window.set_text("L/R - Zmiana bohatera",1)
    # koniec
  end

# by Ayene
# następny / poprzedni bohater
  def next_actor
    @actor_index += 1
    @actor_index %= $game_party.members.size
    if @from_menu == true
    $scene = Scene_RequiemUpgrade.new(@actor_index,true)
    else
    $scene = Scene_RequiemUpgrade.new(@actor_index,false)
    end
  end
  
  def prev_actor
    @actor_index += $game_party.members.size - 1
    @actor_index %= $game_party.members.size
    if @from_menu == true
    $scene = Scene_RequiemUpgrade.new(@actor_index,true)
    else
    $scene = Scene_RequiemUpgrade.new(@actor_index,false)
    end
  end
# koniec
  
  def update
    super
    update_menu_background
    @requiem_upgwindow.update
    @requiem_upgcmdwnd.update
    @help_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      if @from_menu
        $scene = Scene_Menu.new(4)
      else
        $scene = Scene_Map.new
      end
    # by Ayene
    # następny / poprzedni bohater
    elsif Input.trigger?(Input::R)
      Sound.play_cursor
      next_actor
    elsif Input.trigger?(Input::L)
      Sound.play_cursor
      prev_actor
    # koniec    
    elsif Input.trigger?(Input::C)
      if @actor.points > 0
        Sound.play_decision
      else
        Sound.play_buzzer
        return
      end
      case @requiem_upgcmdwnd.index
      when 0
        @actor.points -= 1
        @actor.maxhp += 10
      when 1
        @actor.points -= 1
        @actor.maxmp += 10
      when 2
        @actor.points -= 1
        @actor.atk += 1
      when 3
        @actor.points -= 1
        @actor.def += 1
      when 4
        @actor.points -= 1
        @actor.spi += 1
      when 5
        @actor.points -= 1
        @actor.agi += 1
      end      
    end
  end
  
  def terminate
    super
    dispose_menu_background
    @requiem_upgwindow.dispose
    @requiem_upgcmdwnd.dispose
    @help_window.dispose
  end
    
end

Przesuń go nad skrypt 'Leongon Main Menu Manager'.
W tym ostatnim znajdź linijkę 52:
Kod:
[ "Hello", Scene_Hello, false, true, false, false, false],
zamień ją na:
Kod:
[       "Rozdaj", Scene_RequiemUpgrade,   true,   true,  130,  false,  false],



RE: KOMPATYBILNOŚĆ - Nokachi - 12-01-14 19:02

Dzięki Ayene, jesteś wielka :zeby: