UltimaForum

Wsparcie [XP] - Kilka pytań.

MicroSeven - Wto 02 Lis, 2010 15:35
Temat postu: Kilka pytań.
Cześć, mam kilka pytań dotyczących RMXP.
A więc, pierwsze brzmi:
- Czy w XP'ku możliwe jest 'Rozmazywanie' w menu ? Coś jak w VX.
- Czy istnieje jakiś skrypt, który zmienia w wiadomościach, że zamiast 'przeskakującej' grafiki wyboru jest jej płynne przesuwanie ?
- Istnieje możliwość przerobienia tego skryptu by działał pod XP [ wersja automatyczna np. po walce, nie w menu. ] widziałem już podobny do XP'ka, lecz był ciut 'trudniejszy' i bardziej 'skomplikowany'...

Ayene - Wto 02 Lis, 2010 18:07

1. Rozmazanie menu? Możesz przecież dać rozmazane tło obrazkowe.
2. Poszukaj skryptów Custom Message System, nie wiem dokładnie czyjego autorstwa, ale na pewno znajdziesz.
3. Przerobiony skrypt z VX na XP, usunięte punkty w menu, dodane automatyczne wywoływanie.
Mam nadzieję, że wszystko działa.
Spoiler:

Kod:
#==============================================================================
# Requiem Upgrade
#==============================================================================

Points_Gained = 5 # Points that hero will gain when level-up

#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  attr_accessor :points
  alias requiem_upgwnd_setup setup
  def setup(actor_id)
    requiem_upgwnd_setup(actor_id)
    @points = 0
  end
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      @points += Points_Gained     
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    while @exp < @exp_list[@level]
      @level -= 1
    end
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
end
#------------------------------------------------------------------------------
class Requiem_UpgradeWindow < Window_Base
 
  def initialize(actor)
    super(0,0,320,320)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    update
  end
 
  def update
    self.contents.clear
    draw_actor_graphic(@actor,50,90)
    draw_actor_name(@actor,0,0)
    self.contents.font.color = normal_color
    self.contents.draw_text(224,0,64,32,@actor.level.to_s)
    self.contents.draw_text(224,32,64,32,@actor.points.to_s)
    self.contents.draw_text(128,32*3,96,32,@actor.maxhp.to_s)
    self.contents.draw_text(128,32*4,96,32,@actor.maxsp.to_s)
    self.contents.draw_text(128,32*5,96,32,@actor.str.to_s)
    self.contents.draw_text(128,32*6,96,32,@actor.dex.to_s)
    self.contents.draw_text(128,32*7,96,32,@actor.agi.to_s)
    self.contents.draw_text(128,32*8,96,32,@actor.int.to_s)
    refresh
  end
 
  def refresh   
    self.contents.font.color = system_color
    self.contents.draw_text(128,0,128,32,"Poziom:")
    self.contents.draw_text(128,32,128,32,"Punkty:")
    self.contents.draw_text(0,32*3,128,32,"HP:")
    self.contents.draw_text(0,32*4,128,32,"SP:")
    self.contents.draw_text(0,32*5,128,32,"Str:")
    self.contents.draw_text(0,32*6,128,32,"Dex:")
    self.contents.draw_text(0,32*7,128,32,"Agi:")
    self.contents.draw_text(0,32*8,128,32,"Int:")
  end
end
#------------------------------------------------------------------------------
class Scene_RequiemUpgrade
 
  def initialize(actor_index=0, from_menu=false)   
    @actor_index = actor_index
    @from_menu = from_menu
  end
 
  def main   
    @actor = $game_party.actors[@actor_index]
    @requiem_upgwindow = Requiem_UpgradeWindow.new(@actor)
    @requiem_upgwindow.x = (640 - @requiem_upgwindow.width) / 2
    @requiem_upgwindow.y = (480 - @requiem_upgwindow.height) / 2
    @requiem_upgcmdwnd  = Window_Command.new(64,[" +"," +"," +"," +"," +"," +"])
    @requiem_upgcmdwnd.index = 0
    @requiem_upgcmdwnd.x = @requiem_upgwindow.x + 192
    @requiem_upgcmdwnd.y = @requiem_upgwindow.y + 96
    @requiem_upgcmdwnd.opacity = 0   
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze   
    @requiem_upgwindow.dispose
    @requiem_upgcmdwnd.dispose
  end 
 
  def update     
    @requiem_upgwindow.update
    @requiem_upgcmdwnd.update
   
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_RequiemUpgrade.new(@actor_index)
      return
    end
    if Input.trigger?(Input::L)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_RequiemUpgrade.new(@actor_index)
      return
    end
   
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @from_menu
        $scene = Scene_Menu.new(4)
      else
        $scene = Scene_Map.new
      end
      return
    end   
   
    if Input.trigger?(Input::C)
      if @actor.points > 0
        $game_system.se_play($data_system.decision_se)
      else
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @requiem_upgcmdwnd.index
      when 0
        @actor.points -= 1
        @actor.maxhp += 10
      when 1
        @actor.points -= 1
        @actor.maxsp += 10
      when 2
        @actor.points -= 1
        @actor.str += 1
      when 3
        @actor.points -= 1
        @actor.dex += 1
      when 4
        @actor.points -= 1
        @actor.agi += 1
      when 5
        @actor.points -= 1
        @actor.int += 1
      end
      return
    end
  end   
end

class Scene_Map
  alias ayene_scmap_update update 
  def update
    ayene_scmap_update
    if $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_RequiemUpgrade.new(0)
    end
  end
end


MicroSeven - Wto 02 Lis, 2010 18:40

1. Dobra myśl.
2. Poszukam.
3. Tak skrypt działa, jest tylko jeden błąd, w okienku tło jest czarne.

Ayene - Wto 02 Lis, 2010 18:46

A jakie ma być? Można dać obrazek lub mapę w tle?
MicroSeven - Wto 02 Lis, 2010 18:54

Myślałem że powinna być widoczna mapa, mh... moja wina, mogłem napisać wcześniej.
Ayene - Wto 02 Lis, 2010 20:16

Podmień na poniższy ;-)
Spoiler:

Kod:
#==============================================================================
# Requiem Upgrade
#==============================================================================

Points_Gained = 5 # Points that hero will gain when level-up

#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  attr_accessor :points
  alias requiem_upgwnd_setup setup
  def setup(actor_id)
    requiem_upgwnd_setup(actor_id)
    @points = 0
  end
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      @points += Points_Gained     
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    while @exp < @exp_list[@level]
      @level -= 1
    end
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
end
#------------------------------------------------------------------------------
class Requiem_UpgradeWindow < Window_Base
 
  def initialize(actor)
    super(0,0,320,320)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    update
  end
 
  def update
    self.contents.clear
    draw_actor_graphic(@actor,50,90)
    draw_actor_name(@actor,0,0)
    self.contents.font.color = normal_color
    self.contents.draw_text(224,0,64,32,@actor.level.to_s)
    self.contents.draw_text(224,32,64,32,@actor.points.to_s)
    self.contents.draw_text(128,32*3,96,32,@actor.maxhp.to_s)
    self.contents.draw_text(128,32*4,96,32,@actor.maxsp.to_s)
    self.contents.draw_text(128,32*5,96,32,@actor.str.to_s)
    self.contents.draw_text(128,32*6,96,32,@actor.dex.to_s)
    self.contents.draw_text(128,32*7,96,32,@actor.agi.to_s)
    self.contents.draw_text(128,32*8,96,32,@actor.int.to_s)
    refresh
  end
 
  def refresh   
    self.contents.font.color = system_color
    self.contents.draw_text(128,0,128,32,"Poziom:")
    self.contents.draw_text(128,32,128,32,"Punkty:")
    self.contents.draw_text(0,32*3,128,32,"HP:")
    self.contents.draw_text(0,32*4,128,32,"SP:")
    self.contents.draw_text(0,32*5,128,32,"Str:")
    self.contents.draw_text(0,32*6,128,32,"Dex:")
    self.contents.draw_text(0,32*7,128,32,"Agi:")
    self.contents.draw_text(0,32*8,128,32,"Int:")
  end
end
#------------------------------------------------------------------------------
class Scene_RequiemUpgrade
 
  def initialize(actor_index=0, from_menu=false)   
    @actor_index = actor_index
    @from_menu = from_menu
  end
 
  def main   
    @spriteset = Spriteset_Map.new
    @actor = $game_party.actors[@actor_index]
    @requiem_upgwindow = Requiem_UpgradeWindow.new(@actor)
    @requiem_upgwindow.x = (640 - @requiem_upgwindow.width) / 2
    @requiem_upgwindow.y = (480 - @requiem_upgwindow.height) / 2
    @requiem_upgcmdwnd  = Window_Command.new(64,[" +"," +"," +"," +"," +"," +"])
    @requiem_upgcmdwnd.index = 0
    @requiem_upgcmdwnd.x = @requiem_upgwindow.x + 192
    @requiem_upgcmdwnd.y = @requiem_upgwindow.y + 96
    @requiem_upgcmdwnd.opacity = 0   
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze   
    @requiem_upgwindow.dispose
    @requiem_upgcmdwnd.dispose
    @spriteset.dispose
  end 
 
  def update     
    @requiem_upgwindow.update
    @requiem_upgcmdwnd.update
    @spriteset.update
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_RequiemUpgrade.new(@actor_index)
      return
    end
    if Input.trigger?(Input::L)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_RequiemUpgrade.new(@actor_index)
      return
    end
   
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @from_menu
        $scene = Scene_Menu.new(4)
      else
        $scene = Scene_Map.new
      end
      return
    end   
   
    if Input.trigger?(Input::C)
      if @actor.points > 0
        $game_system.se_play($data_system.decision_se)
      else
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @requiem_upgcmdwnd.index
      when 0
        @actor.points -= 1
        @actor.maxhp += 10
      when 1
        @actor.points -= 1
        @actor.maxsp += 10
      when 2
        @actor.points -= 1
        @actor.str += 1
      when 3
        @actor.points -= 1
        @actor.dex += 1
      when 4
        @actor.points -= 1
        @actor.agi += 1
      when 5
        @actor.points -= 1
        @actor.int += 1
      end
      return
    end
  end   
end

class Scene_Map
  alias ayene_scmap_update update 
  def update
    ayene_scmap_update
    if $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_RequiemUpgrade.new(0)
    end
  end
end


MicroSeven - Sro 03 Lis, 2010 05:39

Wszystko jest teraz w porządku, wielkie dzięki.

Powered by phpBB modified by Przemo © 2003 phpBB Group