UltimaForum

Skrypty [XP] - Rozdawanie punktów co poziom

Lartarin - Pią 23 Paź, 2009 08:50
Temat postu: Rozdawanie punktów co poziom
Aloha!

Kolejny dzisiaj skrypt :lartarin:
Skrypt do RPG Makera XP daje nam możliwość większego wpływu na rozwój bohaterów.
Co ich poziom mamy do rozdysponowania określoną na początku liczbę punktów, za które możemy zwiększać ich statsy ^@^
Możemy zwiększać im cztery główne statsy; czyli siłę, inteligencję, zręczność i szybkość.
O punktach które możemy rozdać informuje nas ikonka poziomu pokazująca się na ekranie. Możemy ją ofkors wyłączyć ;-)



Skrypt wywołujemy kodem:
Kod:
$scene = Scene_Points.new


Aha, wklejamy go nad Main :lartarin:

A oto on:
Spoiler:

Kod:
#====================================================================
# Edited by Lartarin the Super Pig ^@^
#====================================================================
module BlizzCFG
#====================================================================
  STARTING_POINTS = 10 # ilość punktów startowych
  POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom
  DISPLAY_ICON = true # wyświetl ikonę  true/false
  ICON_DATA = [612, 452, 192]
  EVASION = 'Unik'
  STR_LIMIT = 999 # max. siły
  DEX_LIMIT = 999 # max. zręczności
  AGI_LIMIT = 999 # max.szybkości
  INT_LIMIT = 999 # max.inteligencji
  WINDOW_MODE = true # true/false
  AUTOMATIC_CALL = false # true/false
  AUTOMATIC_MAP_CALL = false # true/false
#====================================================================
  ATTR_LIMITS = [STR_LIMIT, DEX_LIMIT, AGI_LIMIT, INT_LIMIT]
#====================================================================
  end
#====================================================================
class Array
 
  def sum
    result = 0
    self.each {|i| result += i if i.is_a?(Numeric)}
    return result
  end
 
end
#==================================================================== 
class Game_Actor < Game_Battler
#==================================================================== 
  attr_reader :points
 
  alias setup_sds_later setup
  def setup(actor_id)
    @points = BlizzCFG::STARTING_POINTS
    setup_sds_later(actor_id)
  end
 
  alias exp_sds_later exp=
  def exp=(exp)
    old_level = @level
    exp_sds_later(exp)
    add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
  end
 
  def add_stat_points(val)
    @points += val if val > 0
  end
 
  def remove_stat_points(val)
    @points = [@points-val, 0].max
  end
 
end

#====================================================================
class Window_Base < Window
#==================================================================== 
  def draw_actor_battler(actor, x, y)
    bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    cw, ch = bitmap.width, bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect)
  end
 
  alias draw_actor_parameter_sds_later draw_actor_parameter
  def draw_actor_parameter(actor, x, y, type)
    if type == 7
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
    else
      draw_actor_parameter_sds_later(actor, x, y, type)
    end
  end
 
end

#====================================================================
class Window_Distribution_Status < Window_Base
#==================================================================== 
  attr_accessor :actor
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
    @actor = actor
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    refresh
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      draw_actor_battler(@actor, 280, 120)
      draw_actor_name(@actor, 4, 0)
      draw_actor_class(@actor, 4, 32)
      draw_actor_level(@actor, 4, 64)
      draw_actor_state(@actor, 4, 96)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 128, 80, 32, 'Doś.')
      self.contents.draw_text(4, 160, 80, 32, 'nast. poz.')
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 128, 156, 32, @actor.exp_s, 2)
      self.contents.draw_text(4, 160, 156, 32, @actor.next_rest_exp_s, 2)
      draw_actor_hp(@actor, 4, 224, 172)
      draw_actor_sp(@actor, 4, 256, 172)
      draw_actor_parameter(@actor, 4, 320, 0)
      draw_actor_parameter(@actor, 4, 352, 1)
      draw_actor_parameter(@actor, 4, 384, 2)
      draw_actor_parameter(@actor, 4, 416, 7)
      self.contents.font.color = system_color
      self.contents.draw_text(240, 240, 96, 32, 'Ekwipunek')
      draw_item_name($data_weapons[@actor.weapon_id], 240, 288)
      draw_item_name($data_armors[@actor.armor1_id], 240, 320)
      draw_item_name($data_armors[@actor.armor2_id], 240, 352)
      draw_item_name($data_armors[@actor.armor3_id], 240, 384)
      draw_item_name($data_armors[@actor.armor4_id], 240, 416)
    end
  end
 
end
 
#====================================================================
class Window_Distribution < Window_Selectable
#==================================================================== 
  attr_accessor :actor
  attr_reader   :points
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 0 : 480, 160, 160, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
      elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    self.active, self.index, = false, 0
    @item_max, @actor, @att, @points = 4, actor, [0, 0, 0, 0], 0
    refresh
  end
 
  def set_new_attributes
    @actor.str += @att[0]
    @actor.dex += @att[1]
    @actor.agi += @att[2]
    @actor.int += @att[3]
    @actor.remove_stat_points(@points)
  end
 
  def actor=(actor)
    @actor = actor
    @att[0] = @att[1] = @att[2] = @att[3] = @points = 0
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      self.contents.font.color = system_color
      self.contents.draw_text(52, 0, 72, 32, 'Pkt.', 2)
      self.contents.draw_text(4, 32, 120, 32, $data_system.words.str)
      self.contents.draw_text(4, 96, 120, 32, $data_system.words.dex)
      self.contents.draw_text(4, 160, 120, 32, $data_system.words.agi)
      self.contents.draw_text(4, 224, 120, 32, $data_system.words.int)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 48, 32, "#{actor.points-@points}", 2)
      self.contents.draw_text(36, 64, 56, 32, "#{@actor.str+@att[0]}", 2)
      self.contents.draw_text(36, 128, 56, 32, "#{@actor.dex+@att[1]}", 2)
      self.contents.draw_text(36, 192, 56, 32, "#{@actor.agi+@att[2]}", 2)
      self.contents.draw_text(36, 256, 56, 32, "#{@actor.int+@att[3]}", 2)
      self.contents.font.size += 8
      self.contents.font.bold = true
      (0...4).each {|i|
          self.contents.draw_text(0, (i + 1) * 64 - 8, 32, 42, '&#171;', 2)
          self.contents.draw_text(96, (i + 1) * 64 - 8, 32, 42, '&#187;')}
      self.contents.font.bold = false
      self.contents.font.size -= 8
    end
  end
 
  def add_points(num)
    attr = [@actor.str, @actor.dex, @actor.agi, @actor.int]
    if @points < @actor.points &&
        attr[index]+@att[index] < BlizzCFG::ATTR_LIMITS[index]
      @points = [@points + num, @actor.points].min
      @att[index] = [@att[index]+num, @points+@att[index]-@att.sum].min
      return true
    end
    return false
  end
 
  def remove_points(num)
    if @points > 0 && @att[index] > 0
      @points = [@points - num, 0].max
      @att[index] = [@att[index] - num, 0].max
      return true
    end
    return false
  end
 
  def update
    super
    return unless self.active
    if Input.press?(Input::R)
      if Input.repeat?(Input::RIGHT)
        if add_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.press?(Input::L)
      if Input.repeat?(Input::RIGHT)
        if add_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.repeat?(Input::RIGHT)
      if add_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.repeat?(Input::LEFT)
      if remove_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    end
  end
 
  def update_cursor_rect
    if @index < 0 || !self.active
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*64, 64, 32)
    end
  end
 
end
 
#====================================================================
class Window_Sure < Window_Command
#==================================================================== 
  attr_accessor :actor
 
  def initialize(width, commands)
    commands.push('')
    super
    @item_max, self.index = commands.size - 1, 0
    self.x, self.y, self.z = 320-self.width/2, 240-self.height/2, 10000
    refresh
  end
 
  def refresh
    super
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, 32, 'Jesteś pewien?', 1)
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * (index+1), self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*32, self.contents.width - 64, 32)
    end
  end
 
end

#==================================================================== 
class Scene_Points
#==================================================================== 
  def initialize
    @actor, @scene = $game_party.actors[0], $scene.class
  end
 
  def main
    commands = ['Rozdaj', 'Następny', 'Poprzedni', 'Koniec']
    @command_window = Window_Command.new(160, commands)
    @command_window.x = (BlizzCFG::WINDOW_MODE ? 0 : 480)
    @status_window = Window_Distribution_Status.new(@actor)
    @distro_window = Window_Distribution.new(@actor)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    [@command_window, @status_window, @distro_window].each {|win| win.dispose}
  end
 
  def make_sure_window
    commands = ['Nie', 'Akceptuj zmiany', 'Odrzuć zmiany']
    @sure_window = Window_Sure.new(256, commands)
  end
 
  def update
    if @command_window.active
      @command_window.update
      update_main_command
    elsif @sure_window != nil
      @sure_window.update
      update_sure
    elsif @distro_window.active
      @distro_window.update
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        @command_window.active, @distro_window.active = true, false
      end
    end
  end
 
  def update_main_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @distro_window.points != 0
        @command_window.index, @command_window.active = 3, false
        make_sure_window
      else
        $scene = @scene.new
      end
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 0 then @command_window.active, @distro_window.active = false, true
      when 1
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 2
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 3
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          $scene = @scene.new
        end
      end
    end
  end
 
  def update_sure
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @sure_window.dispose
      @sure_window, @command_window.active = nil, true
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 2
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 3
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          $scene = @scene.new
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      end
    end
  end
 
end

#====================================================================
class Scene_Battle
#==================================================================== 
  alias main_sds_later main
  def main
    main_sds_later
    if BlizzCFG::AUTOMATIC_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
 
end

#====================================================================
class Scene_Map
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    @notify.dispose if @notify != nil
  end
 
  alias upd_sds_later update
  def update
    check_icon if BlizzCFG::DISPLAY_ICON
    upd_sds_later
    if BlizzCFG::AUTOMATIC_MAP_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
  def check_icon
    if $game_party.actors.any? {|actor| actor.points > 0}
      if @notify == nil
        @notify = RPG::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 = BlizzCFG::ICON_DATA[2]
        end
        @notify.x, @notify.y = BlizzCFG::ICON_DATA[0, 2]
        @notify.z = 5000
        @notify.blink_on
      end
      @notify.update
   
  end
end
#====================================================================
# www.ultimateam.pl
#====================================================================


Cyklop - Pią 23 Paź, 2009 20:03

Świetne, takie coś przydałoby się jeszvze do VX. Pozdro dla Fire Pig :P
Unnamed - Sob 24 Paź, 2009 17:56

Spoko skrypt. Widzialem juz kiedys podobny ale nie mozna bylo ustawic maxa dla statystyk. Dzienks, przyda sie na pewno ale znowu bede musial zmienic mechanike gry. Trudno :)
Kaz - Sob 31 Paź, 2009 08:54

Da się zrobić, by ten sposób działał również przy level-upach nie wywoływanych przez $scene = Scene_Points.new?
Lartarin - Sob 31 Paź, 2009 09:11

Aloha!
W skrypcie wystąpił mały błąd, oto poprawna wersja:

Spoiler:

Kod:
#====================================================================
# Edited by Lartarin the Super Pig ^@^
#====================================================================
module BlizzCFG
#====================================================================
  STARTING_POINTS = 10 # ilość punktów startowych
  POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom
  DISPLAY_ICON = true # wyświetl ikonę  true/false
  ICON_DATA = [612, 452, 192]
  EVASION = 'Unik'
  STR_LIMIT = 999 # max. siły
  DEX_LIMIT = 999 # max. zręczności
  AGI_LIMIT = 999 # max.szybkości
  INT_LIMIT = 999 # max.inteligencji
  WINDOW_MODE = true # true/false
  AUTOMATIC_CALL = true # true/false
  AUTOMATIC_MAP_CALL = false # true/false
#====================================================================
  ATTR_LIMITS = [STR_LIMIT, DEX_LIMIT, AGI_LIMIT, INT_LIMIT]
#====================================================================
  end
#====================================================================
class Array
 
  def sum
    result = 0
    self.each {|i| result += i if i.is_a?(Numeric)}
    return result
  end
 
end
#====================================================================
class Game_Actor < Game_Battler
#====================================================================
  attr_reader :points
 
  alias setup_sds_later setup
  def setup(actor_id)
    @points = BlizzCFG::STARTING_POINTS
    setup_sds_later(actor_id)
  end
 
  alias exp_sds_later exp=
  def exp=(exp)
    old_level = @level
    exp_sds_later(exp)
    add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
  end
 
  def add_stat_points(val)
    @points += val if val > 0
  end
 
  def remove_stat_points(val)
    @points = [@points-val, 0].max
  end
 
end

#====================================================================
class Window_Base < Window
#====================================================================
  def draw_actor_battler(actor, x, y)
    bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    cw, ch = bitmap.width, bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect)
  end
 
  alias draw_actor_parameter_sds_later draw_actor_parameter
  def draw_actor_parameter(actor, x, y, type)
    if type == 7
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
    else
      draw_actor_parameter_sds_later(actor, x, y, type)
    end
  end
 
end

#====================================================================
class Window_Distribution_Status < Window_Base
#====================================================================
  attr_accessor :actor
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
    @actor = actor
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    refresh
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      draw_actor_battler(@actor, 280, 120)
      draw_actor_name(@actor, 4, 0)
      draw_actor_class(@actor, 4, 32)
      draw_actor_level(@actor, 4, 64)
      draw_actor_state(@actor, 4, 96)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 128, 80, 32, 'Doś.')
      self.contents.draw_text(4, 160, 80, 32, 'nast. poz.')
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 128, 156, 32, @actor.exp_s, 2)
      self.contents.draw_text(4, 160, 156, 32, @actor.next_rest_exp_s, 2)
      draw_actor_hp(@actor, 4, 224, 172)
      draw_actor_sp(@actor, 4, 256, 172)
      draw_actor_parameter(@actor, 4, 320, 0)
      draw_actor_parameter(@actor, 4, 352, 1)
      draw_actor_parameter(@actor, 4, 384, 2)
      draw_actor_parameter(@actor, 4, 416, 7)
      self.contents.font.color = system_color
      self.contents.draw_text(240, 240, 96, 32, 'Ekwipunek')
      draw_item_name($data_weapons[@actor.weapon_id], 240, 288)
      draw_item_name($data_armors[@actor.armor1_id], 240, 320)
      draw_item_name($data_armors[@actor.armor2_id], 240, 352)
      draw_item_name($data_armors[@actor.armor3_id], 240, 384)
      draw_item_name($data_armors[@actor.armor4_id], 240, 416)
    end
  end
 
end
 
#====================================================================
class Window_Distribution < Window_Selectable
#====================================================================
  attr_accessor :actor
  attr_reader   :points
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 0 : 480, 160, 160, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
      elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    self.active, self.index, = false, 0
    @item_max, @actor, @att, @points = 4, actor, [0, 0, 0, 0], 0
    refresh
  end
 
  def set_new_attributes
    @actor.str += @att[0]
    @actor.dex += @att[1]
    @actor.agi += @att[2]
    @actor.int += @att[3]
    @actor.remove_stat_points(@points)
  end
 
  def actor=(actor)
    @actor = actor
    @att[0] = @att[1] = @att[2] = @att[3] = @points = 0
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      self.contents.font.color = system_color
      self.contents.draw_text(52, 0, 72, 32, 'Pkt.', 2)
      self.contents.draw_text(4, 32, 120, 32, $data_system.words.str)
      self.contents.draw_text(4, 96, 120, 32, $data_system.words.dex)
      self.contents.draw_text(4, 160, 120, 32, $data_system.words.agi)
      self.contents.draw_text(4, 224, 120, 32, $data_system.words.int)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 48, 32, "#{actor.points-@points}", 2)
      self.contents.draw_text(36, 64, 56, 32, "#{@actor.str+@att[0]}", 2)
      self.contents.draw_text(36, 128, 56, 32, "#{@actor.dex+@att[1]}", 2)
      self.contents.draw_text(36, 192, 56, 32, "#{@actor.agi+@att[2]}", 2)
      self.contents.draw_text(36, 256, 56, 32, "#{@actor.int+@att[3]}", 2)
      self.contents.font.size += 8
      self.contents.font.bold = true
      (0...4).each {|i|
          self.contents.draw_text(0, (i + 1) * 64 - 8, 32, 42, '>>', 2)
          self.contents.draw_text(96, (i + 1) * 64 - 8, 32, 42, '<<')}
      self.contents.font.bold = false
      self.contents.font.size -= 8
    end
  end
 
  def add_points(num)
    attr = [@actor.str, @actor.dex, @actor.agi, @actor.int]
    if @points < @actor.points &&
        attr[index]+@att[index] < BlizzCFG::ATTR_LIMITS[index]
      @points = [@points + num, @actor.points].min
      @att[index] = [@att[index]+num, @points+@att[index]-@att.sum].min
      return true
    end
    return false
  end
 
  def remove_points(num)
    if @points > 0 && @att[index] > 0
      @points = [@points - num, 0].max
      @att[index] = [@att[index] - num, 0].max
      return true
    end
    return false
  end
 
  def update
    super
    return unless self.active
    if Input.press?(Input::R)
      if Input.repeat?(Input::RIGHT)
        if add_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(100)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.press?(Input::L)
      if Input.repeat?(Input::RIGHT)
        if add_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      elsif Input.repeat?(Input::LEFT)
        if remove_points(10)
          $game_system.se_play($data_system.cursor_se)
          refresh
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    elsif Input.repeat?(Input::RIGHT)
      if add_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.repeat?(Input::LEFT)
      if remove_points(1)
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    end
  end
 
  def update_cursor_rect
    if @index < 0 || !self.active
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*64, 64, 32)
    end
  end
 
end
 
#====================================================================
class Window_Sure < Window_Command
#====================================================================
  attr_accessor :actor
 
  def initialize(width, commands)
    commands.push('')
    super
    @item_max, self.index = commands.size - 1, 0
    self.x, self.y, self.z = 320-self.width/2, 240-self.height/2, 10000
    refresh
  end
 
  def refresh
    super
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, 32, 'Jesteś pewien?', 1)
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * (index+1), self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*32, self.contents.width - 64, 32)
    end
  end
 
end

#====================================================================
class Scene_Points
#====================================================================
  def initialize
    @actor, @scene = $game_party.actors[0], $scene.class
  end
 
  def main
    commands = ['Rozdaj', 'Następny', 'Poprzedni', 'Koniec']
    @command_window = Window_Command.new(160, commands)
    @command_window.x = (BlizzCFG::WINDOW_MODE ? 0 : 480)
    @status_window = Window_Distribution_Status.new(@actor)
    @distro_window = Window_Distribution.new(@actor)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    [@command_window, @status_window, @distro_window].each {|win| win.dispose}
  end
 
  def make_sure_window
    commands = ['Nie', 'Akceptuj zmiany', 'Odrzuć zmiany']
    @sure_window = Window_Sure.new(256, commands)
  end
 
  def update
    if @command_window.active
      @command_window.update
      update_main_command
    elsif @sure_window != nil
      @sure_window.update
      update_sure
    elsif @distro_window.active
      @distro_window.update
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        @command_window.active, @distro_window.active = true, false
      end
    end
  end
 
  def update_main_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @distro_window.points != 0
        @command_window.index, @command_window.active = 3, false
        make_sure_window
      else
        $scene = @scene.new
      end
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 0 then @command_window.active, @distro_window.active = false, true
      when 1
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 2
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
          @distro_window.index = 0
        end
      when 3
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          $scene = @scene.new
        end
      end
    end
  end
 
  def update_sure
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @sure_window.dispose
      @sure_window, @command_window.active = nil, true
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 2
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
          @actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
          [@status_window, @distro_window].each {|win| win.refresh}
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      when 3
        if @sure_window.index > 0
          @distro_window.set_new_attributes if @sure_window.index == 1
          $scene = @scene.new
        end
        @sure_window.dispose
        @sure_window, @command_window.active = nil, true
      end
    end
  end
 
end

#====================================================================
class Scene_Battle
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    if BlizzCFG::AUTOMATIC_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
 
end

#====================================================================
class Scene_Map
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    @notify.dispose if @notify != nil
  end
 
  alias upd_sds_later update
  def update
    check_icon if BlizzCFG::DISPLAY_ICON
    upd_sds_later
    if BlizzCFG::AUTOMATIC_MAP_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
  def check_icon
    if $game_party.actors.any? {|actor| actor.points > 0}
      if @notify == nil
        @notify = RPG::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 = BlizzCFG::ICON_DATA[2]
        end
        @notify.x, @notify.y = BlizzCFG::ICON_DATA[0, 2]
        @notify.z = 5000
        @notify.blink_on
      end
      @notify.update
   
  end
end
#====================================================================
# www.ultimateam.pl
#====================================================================



Co do wywołania automatycznego, to zmień to:
Kod:
AUTOMATIC_CALL = true # true/false

Azsak von Triger - Sob 31 Paź, 2009 09:32

Zaraz dodam do vx rozdawanie punktów :)
dawidos989 - Pią 06 Lis, 2009 16:29

możecie dokładnie powiedzieć gdzie wpisać ten kod bo nie wiem jestem nowy
Lartarin - Sob 07 Lis, 2009 10:33

Aloha!



Zaznaczona na czerwono ikonka to script editor, wejdź w niego i zjedź na sam dół.
Skrypt wklej nad Main.
Main jest na samym dole.

Bulooo - Pon 28 Gru, 2009 15:13




Proszę o pomoc ;-(

alintes - Pon 28 Gru, 2009 16:51

mi to samo wyskakuje help!!!!!!!!! ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-(
Ayene - Pon 28 Gru, 2009 17:44

Z powyższego skryptu usuńcie linijkę 497 z:
Kod:
@notify.update


Wszystko powinno działać.

Bulooo - Pon 28 Gru, 2009 17:55

Wielkie dzięki już wszystko działa :))
adek16 - Sro 30 Gru, 2009 20:26

mi wyskakuje ten sam błąd przy odpalaniu zapisu gry jeżeli daje nowa gra to tak nie ma.

usuwałem już ze skryptu linijkę 497 ale dalej nie działa.proszę o pomoc :cry: :cry:

Ayene - Sro 30 Gru, 2009 20:56

To dlatego, że zapis gry musi zawierać skrypt... innymi słowy, dopiero po umieszczeniu skryptu powinieneś zapisać grę, a wtedy bez problemu się wczyta.
adek16 - Czw 31 Gru, 2009 09:23

czyli że od nowa mam robić 53 lvl / :-)
Ayene - Czw 31 Gru, 2009 15:13

To Ty w swojej grze robisz levele? Z resztą nie musisz ich robić od początku. Wystarczy, że dołożysz na mapie zdarzenie, które podniesie Tobie poziom drużyny o 52.
A taki już jest wymóg skryptu, że nie jest kompatybilny z zapisem (oczywiście tylko wówczas, gdy zapis nie posiada skryptu).

adek16 - Czw 31 Gru, 2009 15:39

no dobra zrobię od początku 52 lvl a potem zimniejsze :-)
krychapl - Wto 05 Sty, 2010 19:45

Ej co trzeba zrobić żeby ten skrypt dawał mniej pkt?
Ayene - Wto 05 Sty, 2010 20:06

Wystarczy, że zmienisz linijkę:
Kod:
POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom

Możesz zmniejszyć z 5 np. do 2.

herosword - Sro 06 Sty, 2010 17:21

z jakim skryptem to zamienić ??
Ayene - Sro 06 Sty, 2010 21:03

Nie zamienić tylko dodać. Tutaj masz tutorial :arrow: Dodawanie nowych skryptów
13741372 - Sro 10 Lut, 2010 18:05

mam pytanko gdzie mam wkleic to ($scene = Scene_Points.new) :-| bo jak wlaczam menu to mi niewyskakuje okno stat
Lartarin - Czw 11 Lut, 2010 10:11

new event (nowe zdarzenie), 3 zakładka --> (script) dodaj skrypt
I tam to wklejasz!
Było już to pisane wielokrotnie...

13741372 - Czw 11 Lut, 2010 14:58

SLUCHAJ jak wylączam gosciowe to mi wyskakuje error
Ayene - Czw 11 Lut, 2010 15:19

Jaki błąd Tobie wyskakuje? Podaj jego całą treść.
RtaMag2 - Czw 11 Lut, 2010 20:44

Zaraz zaraz niech ktoś mi wytłumaczy jak klikam spoiler to co mam z tym zrobić? a to $scene coś tam to do jakiej liniki wkleić niech ktoś powie :-|
Ayene - Czw 11 Lut, 2010 20:46

Tutaj masz tutorial :arrow: http://www.ultimateam.pl/viewtopic.php?t=2254
RtaMag2 - Czw 11 Lut, 2010 21:06

Ayene a mam jeszcze pytanko co z tym zrobić $scene = Scene_Points.new
i wyskakuje mi plusik tylko jak go włonczyć?

Ayene - Czw 11 Lut, 2010 21:09

W edycji zdarzeń masz polecenie na trzeciej stronie o nazwie Script / Skrypt. To tam należy wpisać:
Kod:
$scene = Scene_Points.new

RtaMag2 - Czw 11 Lut, 2010 21:12

Teraz zadam głupie pytanie gdzie jest Edycja zdarzeń? :-(
Ayene - Czw 11 Lut, 2010 21:17

Na pewno wstawiałeś już jakieś zdarzenia (events) na mapie.

Spoiler:


RtaMag2 - Czw 11 Lut, 2010 21:24

Dzięki wszystko spoko już jest ale jeszcze jest jeden problem jak rozdam staty i wyłoncze rozdawanie i przejde dalej do gry to mi się ukazuje błąd
?????? 'Skrypt' ? 497 ??? NoMethodError ????????
undefined method ' update ' for nil:NilClass :cry:

Ayene - Czw 11 Lut, 2010 21:27

Już padło to pytanie :arrow: http://www.ultimateam.pl/...p?p=17831#17831
RtaMag2 - Czw 11 Lut, 2010 21:31

Dziękuję już wszystko jest dobrze :-)
damian0151@wp.pl - Nie 21 Lut, 2010 22:24

Witam, Ja zupełnie nie wiem jak to zrobić. Wkleiłem to na sam dół w dział "Main" i nic, tylko jakiś błąd mi wyskakuje ja próbuje włączyć gre.

Bardzo proszę o dokładne wytłumaczenie co mam robić.

Z góry dziękuje :)

Ayene - Pon 22 Lut, 2010 08:25

Widocznie źle wklejasz. Tutaj masz tutorial :arrow: http://www.ultimateam.pl/viewtopic.php?t=2254
damian0151@wp.pl - Pon 22 Lut, 2010 10:48

Już wszystko jest ok, dziękuje za pomoc :)
HESEE - Pon 05 Kwi, 2010 19:42

Ej mam taki problem gdy wygram walkę ze stworkiem to mam rozdawanie pkt a ja chcem żeby było tylko jak np. pogadam z gościem.
Ale zdarzenie już zrobiłem tylko ten koniec walki.

Czeliosss - Pon 05 Kwi, 2010 19:53

To wpisz
Kod:
$scene = Scene_Points.new

HESEE - Pon 05 Kwi, 2010 19:57

W skrypcie tak?
Mam tu już i dalej jest tak.
PS:Mam rozdawanie pkt po walce.

Sabikku - Pon 05 Kwi, 2010 20:01

Znajdź w skrypcie wszystkie:
Kod:
$scene = Scene_Points.new

(linjijka ~452) i je usuń.

Potem stwórz zdarzenie (człowiek, z którym rozmowa wywoła przyznawanie punktów), i jako komendę wybierz script (ostatnia zakładka), w okienku wpisz ten sam kod który usunąłeś w skrypcie.

HESEE - Pon 05 Kwi, 2010 20:08

Dzięki działa już.
Czeliosss - Pon 05 Kwi, 2010 20:27

A mam pytanie czy dało by się usunąć ten plus w rogu, bo to psuje klimat.
Sabikku - Pon 05 Kwi, 2010 20:29

Znajdź to (pod koniec skryptu):
Cytat:
#====================================================================
class Scene_Map
#====================================================================
alias main_sds_later main
def main
main_sds_later
@notify.dispose if @notify != nil
end

alias upd_sds_later update
def update
check_icon if BlizzCFG::DISPLAY_ICON
upd_sds_later
if BlizzCFG::AUTOMATIC_MAP_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
def check_icon
if $game_party.actors.any? {|actor| actor.points > 0}
if @notify == nil
@notify = RPG::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 = BlizzCFG::ICON_DATA[2]
end
@notify.x, @notify.y = BlizzCFG::ICON_DATA[0, 2]
@notify.z = 5000
@notify.blink_on
end
@notify.update

end
end

Jeśli nie chcesz plusika, usuń całość. Ale polecam zmodyfikować kolory (te zera) w taki sposób, żeby było wystarczająco klimatycznie.

HESEE - Pon 05 Kwi, 2010 20:33

Ej możecie pomóc bo nie mam napisów wogóle w grze nawet menu.
Czeliosss - Pon 05 Kwi, 2010 20:38

Dzięki. Ty to zawsze pomożesz.
HESEE - Pon 10 Maj, 2010 19:16

Mam pytanie czy da rady tak zrobić aby po kliknięciu przycisku np:R pojawiało się rozdawanie pkt?
Czeliosss - Pon 10 Maj, 2010 19:20

Zrób commont event uruchamiany przełącznikiem. Zrób warunek jak A jest włączone to ... i tu wywołujesz skrypt.
Pzdr.

HESEE - Pon 10 Maj, 2010 19:29

Nie rozumiem mógł by ktoś raźniej albo może wklejka do skryptu?
pw115 - Pon 10 Maj, 2010 20:26

Proszę oto ss jak to ma wyglądać:
SS:

Spoiler:




Bezel - Pon 01 Lis, 2010 17:58

Może ktoś zeedytować ów skrypt by było tam też HP i SP? HP po 5 pkt, a sp po 3
4Garbi - Pon 20 Gru, 2010 17:53

Da się jakoś zrobić, aby tą ikonę w rogu wyłączać przełącznikiem etc.?
Haski5 - Pon 21 Lut, 2011 19:53

heh. Wogóle nie mam pojęcia jak rozdać staty. chodzi o to by mi wyskoczyło te okno
superbaton - Nie 27 Lut, 2011 14:15

Ten skrypt dziala tylko vizualnie...Albo mi sie Tak zdaje
bo jak dodam w sile 300pkt to wale tak samo jak mialem 100
I czy sie dodac jeszcze zeby bylo mozna hp dodawac?

maxemort - Sob 09 Kwi, 2011 11:55

a na jakim przycisku urzyc tego skryptu pliss pisać :roll: :roll: :roll: :roll: :roll: :roll:
FireBlade - Sob 09 Kwi, 2011 12:14

Nie używa się go na żadnym przycisku tylko komendą "script" w ostatnim okienku zdarzeń
polecam użyć szukajki i poszukać na forum o wlepianiu skryptów najlepiej poszukać wdziale tutoriale.

Sorak - Sro 13 Kwi, 2011 08:04

Mam do was pytanie. Czy ktoś mógłby napisać jak się edytuje window_command aby w menu pojawiła się nowa opcja czyli "Rozdawanie punktów"?
genialnyzolw - Pon 25 Kwi, 2011 13:15

@Sorak
Jeśli chcesz mieć w menu nową opcje to wejdź w Scene_Menu i znajdź tam linijkę
Kod:
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Stan"
    s5 = "Zapis gry"
    s6 = "Koniec"

dodaj np. s7= "Rozdawanie punktów"
później masz
     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
do tego dodajesz s7 czyli
     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
później znajdujesz when 0, when 1, when 2, when 3, when 4, when 5 no i dodajesz when 6
a tam wklejasz wywoływacz czyli:
$scene = Scene_Points.new
no i to tyle


Można jeszcze 2 sposobem bez dodawania nowej opcji do menu

Kod:
Zmieniamy nazwę s4
na np.

s4= "Rozdawanie Umiejętności"

schodzimy niżej na when 3
i zmieniamy wszystko na
$scene = Scene_Points.new

Floor - Sro 18 Maj, 2011 12:09

Skrypt jest spoko, ale jak biorę:
Czy chcesz zatwierdzić zmiany. To wyskakuje mi error.

Melvin - Nie 13 Lis, 2011 12:33

Skrypt fajny, ale byłoby miło jakbyś podała autora.
Zapewne Blizzardowi to wisi, ale wypadało by go umieścić na początku.

Link do oryginału: http://forum.chaos-projec...opic,114.0.html

Nathaniel125 - Pią 24 Lut, 2012 15:23

Świetny skrypt. Ale czy ktoś mógłby go nieco przerobić? Chciałbym by skrypt pozwalał zmieniać statystyki tylko jednego bohatera (tak więc komendy "poprzedni" i "następny" mogłyby zostać usunięte) i by można było zwiększać również HP i SP.
Mateusz SSJ8 - Pią 24 Lut, 2012 19:40

Mnie tam to nie przeszkadza, bo sam w "Miasteczko Nowoczesne" pozwalam na pięć gości w drużynie. A co do skryptu, to dałem własny mechanizm automatycznego wywoływania ekranu rozwoju.

Cytat:
Po każdej walce komputer sprawdza, ilu bohaterów awansowało. Jeśli w walce uczestniczył przynajmniej jeden, któremu XPL skoczyło w górę (XPL.abs > 0), to po wciśnięciu Entera przez gracza wyskoczy okno wyboru. Wybranie opcji "Rozwój postaci" wywołuje ekran rozwoju drużyny, ale tylko dla uczestników walki, którzy awansowali, bez względu na to, czy opuścili drużynę podczas walki, czy nie. Po wybraniu opcji "Zakończ walkę" gracz od razu wraca na mapę. Jeśli liczba awansujących w walce wynosi zero, okno wyboru nie pojawia się. Ten system działa w fazówce ("Miasteczko Nowoczesne 6" używa SSJ8_ATB) i standardowej biegówce ("Miasteczko Nowoczesne 6" używa SSJ8_Run). ABS (w "Miasteczko Nowoczesne 6" jest to SSJ8_ABS) nie korzysta z tego systemu.

Ayene - Pon 27 Lut, 2012 13:03

Nathaniel125, sprawdź to:
Spoiler:

Kod:
#====================================================================
# Autor Blizzard
# Modyfikacja by Ayene
#====================================================================
module BlizzCFG
#====================================================================
  STARTING_POINTS = 10 # liczba punktów startowych
  POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom
  DISPLAY_ICON = true # wyświetl ikonę true/false
  ADD_HP_SP = 20   # o ile wzrasta HP i SP
  ICON_DATA = [612, 452, 192]
  EVASION = 'Unik'
  HP_LIMIT = 9999 # max. hp
  SP_LIMIT = 9999 # max. sp
  STR_LIMIT = 999 # max. siły
  DEX_LIMIT = 999 # max. zręczności
  AGI_LIMIT = 999 # max.szybkości
  INT_LIMIT = 999 # max.inteligencji
  WINDOW_MODE = true # true/false
  AUTOMATIC_CALL = false # true/false
  AUTOMATIC_MAP_CALL = false # true/false
#====================================================================
  ATTR_LIMITS = [HP_LIMIT, SP_LIMIT, STR_LIMIT, DEX_LIMIT, AGI_LIMIT, INT_LIMIT]
#====================================================================
  end
#====================================================================
class Array
 
  def sum
    result = 0
    self.each {|i| result += i if i.is_a?(Numeric)}
    return result
  end
 
end
#====================================================================
class Game_Actor < Game_Battler
#====================================================================
  attr_reader :points
 
  alias setup_sds_later setup
  def setup(actor_id)
    @points = BlizzCFG::STARTING_POINTS
    setup_sds_later(actor_id)
  end
 
  alias exp_sds_later exp=
  def exp=(exp)
    old_level = @level
    exp_sds_later(exp)
    add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
  end
 
  def add_stat_points(val)
    @points += val if val > 0
  end
 
  def remove_stat_points(val)
    @points = [@points-val, 0].max
  end
 
end

#====================================================================
class Window_Base < Window
#====================================================================
  def draw_actor_battler(actor, x, y)
    bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    cw, ch = bitmap.width, bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw/2, y - ch/2, bitmap, src_rect)
  end
 
  alias draw_actor_parameter_sds_later draw_actor_parameter
  def draw_actor_parameter(actor, x, y, type)
    if type == 7
      self.contents.font.color = system_color
      self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
    else
      draw_actor_parameter_sds_later(actor, x, y, type)
    end
  end
end

#====================================================================
class Window_Distribution_Status < Window_Base
#====================================================================
  attr_accessor :actor
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
    @actor = actor
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    refresh
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      draw_actor_battler(@actor, 280, 120)
      draw_actor_name(@actor, 4, 0)
      draw_actor_class(@actor, 4, 32)
      draw_actor_level(@actor, 4, 64)
      draw_actor_state(@actor, 4, 96)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 128, 80, 32, 'Doś.')
      self.contents.draw_text(4, 160, 80, 32, 'nast. poz.')
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 128, 156, 32, @actor.exp_s, 2)
      self.contents.draw_text(4, 160, 156, 32, @actor.next_rest_exp_s, 2)
      draw_actor_hp(@actor, 4, 224, 172)
      draw_actor_sp(@actor, 4, 256, 172)
      draw_actor_parameter(@actor, 4, 320, 0)
      draw_actor_parameter(@actor, 4, 352, 1)
      draw_actor_parameter(@actor, 4, 384, 2)
      draw_actor_parameter(@actor, 4, 416, 7)
      self.contents.font.color = system_color
      self.contents.draw_text(240, 240, 96, 32, 'Ekwipunek')
      draw_item_name($data_weapons[@actor.weapon_id], 240, 288)
      draw_item_name($data_armors[@actor.armor1_id], 240, 320)
      draw_item_name($data_armors[@actor.armor2_id], 240, 352)
      draw_item_name($data_armors[@actor.armor3_id], 240, 384)
      draw_item_name($data_armors[@actor.armor4_id], 240, 416)
    end
  end
 
end
 
#====================================================================
class Window_Distribution < Window_Selectable
#====================================================================
  attr_accessor :actor
  attr_reader   :points
 
  WLH = 26
 
  def initialize(actor)
    super(BlizzCFG::WINDOW_MODE ? 0 : 480, 96, 160, 384)
    self.contents = Bitmap.new(width - 32, height - 32)
    if $fontface != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
      elsif $defaultfonttype != nil
      self.contents.font.name = "Comic Sans MS"
      self.contents.font.size = 22
      self.contents.font.bold = true
    end
    self.active, self.index, = false, 0
    @item_max, @actor, @att, @points = 6, actor, [0, 0, 0, 0, 0, 0], 0
    refresh
  end
 
  def set_new_attributes
    @actor.maxhp += @att[0]
    @actor.maxsp += @att[1]
    @actor.str += @att[2]
    @actor.dex += @att[3]
    @actor.agi += @att[4]
    @actor.int += @att[5]
    @actor.remove_stat_points(@points)
  end
 
  def actor=(actor)
    @actor = actor
    @att[0] = @att[1] = @att[2] = @att[3] = @att[4] = @att[5] = @points = 0
  end
 
  def refresh
    self.contents.clear
    unless @actor == nil
      self.contents.font.color = system_color
      wlh = WLH
      self.contents.draw_text(52, 0, 72, wlh, 'Pkt.', 2)   
      self.contents.draw_text(4, wlh, 120, wlh, $data_system.words.hp)
      self.contents.draw_text(4, wlh*3, 120, wlh, $data_system.words.sp)     
      self.contents.draw_text(4, wlh*5, 120, wlh, $data_system.words.str)
      self.contents.draw_text(4, wlh*7, 120, wlh, $data_system.words.dex)
      self.contents.draw_text(4, wlh*9, 120, wlh, $data_system.words.agi)
      self.contents.draw_text(4, wlh*11, 120, wlh, $data_system.words.int)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 48, wlh, "#{actor.points-@points}", 2)     
      self.contents.draw_text(36, wlh*2, 56, wlh, "#{@actor.maxhp+@att[0]}", 2)
      self.contents.draw_text(36, wlh*4, 56, wlh, "#{@actor.maxsp+@att[1]}", 2)
      self.contents.draw_text(36, wlh*6, 56, wlh, "#{@actor.str+@att[2]}", 2)
      self.contents.draw_text(36, wlh*8, 56, wlh, "#{@actor.dex+@att[3]}", 2)
      self.contents.draw_text(36, wlh*10, 56, wlh, "#{@actor.agi+@att[4]}", 2)
      self.contents.draw_text(36, wlh*12, 56, wlh, "#{@actor.int+@att[5]}", 2)
      self.contents.font.bold = true
      (0...6).each {|i|
          self.contents.draw_text(0, (i + 1) * wlh*2 - 8, 32, wlh+12, '<', 2)
          self.contents.draw_text(96, (i + 1) * wlh*2 - 8, 32, wlh+12, '>')}
      self.contents.font.bold = false
    end
  end
 
  def add_points
    attr = [@actor.maxhp, @actor.maxsp, @actor.str, @actor.dex, @actor.agi, @actor.int]
    if @points < @actor.points &&
        attr[index]+@att[index] < BlizzCFG::ATTR_LIMITS[index]
      @points = [@points + 1, @actor.points].min     
      case index
      when 0,1; num = BlizzCFG::ADD_HP_SP
      else ; num = 1
      end 
      @att[index] = [@att[index]+num, @points*num+@att[index]].min
      return true
    end
    return false
  end
 
  def remove_points
    if @points > 0 && @att[index] > 0
      @points = [@points - 1, 0].max
      case index
      when 0,1; num = BlizzCFG::ADD_HP_SP
      else ; num = 1
      end
      @att[index] = [@att[index] - num, 0].max
      return true
    end
    return false
  end
 
  def update
    super
    return unless self.active
    if Input.repeat?(Input::RIGHT)
      if add_points
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    elsif Input.repeat?(Input::LEFT)
      if remove_points
        $game_system.se_play($data_system.cursor_se)
        refresh
      else
        $game_system.se_play($data_system.buzzer_se)
      end
    end
  end
 
  def update_cursor_rect
    if @index < 0 || !self.active
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*WLH*2, 64, WLH)
    end
  end
 
end
 
#====================================================================
class Window_Sure < Window_Command
#====================================================================
  attr_accessor :actor
 
  def initialize(width, commands)
    commands.push('')
    super
    @item_max, self.index = commands.size - 1, 0
    self.x, self.y, self.z = 320-self.width/2, 240-self.height/2, 10000
    refresh
  end
 
  def refresh
    super
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.contents.width - 8, 32, 'Jesteś pewien?', 1)
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * (index+1), self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(32, (@index+1)*32, self.contents.width - 64, 32)
    end
  end
 
end

#====================================================================
class Scene_Points
#====================================================================
  def initialize
    @actor, @scene = $game_party.actors[0], $scene.class
  end
 
  def main
    commands = ['Rozdaj', 'Koniec']
    @command_window = Window_Command.new(160, commands)
    @command_window.x = (BlizzCFG::WINDOW_MODE ? 0 : 480)
    @status_window = Window_Distribution_Status.new(@actor)
    @distro_window = Window_Distribution.new(@actor)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    [@command_window, @status_window, @distro_window].each {|win| win.dispose}
  end
 
  def make_sure_window
    commands = ['Nie', 'Akceptuj zmiany', 'Odrzuć zmiany']
    @sure_window = Window_Sure.new(256, commands)
  end
 
  def update
    if @command_window.active
      @command_window.update
      update_main_command
    elsif @sure_window != nil
      @sure_window.update
      update_sure
    elsif @distro_window.active
      @distro_window.update
      if Input.trigger?(Input::B) or Input.trigger?(Input::C)
        $game_system.se_play($data_system.cancel_se)
        @command_window.active, @distro_window.active = true, false
      end
    end
  end
 
  def update_main_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if @distro_window.points != 0
        @command_window.index, @command_window.active = 3, false
        make_sure_window
      else
        $scene = @scene.new
      end
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 0 then @command_window.active, @distro_window.active = false, true
      when 1
        if @distro_window.points != 0
          @command_window.active = false
          make_sure_window
        else
          $scene = @scene.new
        end
      end
    end
  end
 
  def update_sure
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @sure_window.dispose
      @sure_window, @command_window.active = nil, true
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)       
      if @sure_window.index > 0
        @distro_window.set_new_attributes if @sure_window.index == 1
        $scene = @scene.new
      end       
      @sure_window.dispose
      @sure_window, @command_window.active = nil, true
    end
  end
end

#====================================================================
class Scene_Battle
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    if BlizzCFG::AUTOMATIC_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
 
end

#====================================================================
class Scene_Map
#====================================================================
  alias main_sds_later main
  def main
    main_sds_later
    @notify.dispose if @notify != nil
  end
 
  alias upd_sds_later update
  def update
    check_icon if BlizzCFG::DISPLAY_ICON
    upd_sds_later
    if BlizzCFG::AUTOMATIC_MAP_CALL &&
        $game_party.actors.any? {|actor| actor.points > 0}
      $scene = Scene_Points.new
    end
  end
  def check_icon
    if $game_party.actors.any? {|actor| actor.points > 0}
      if @notify == nil
        @notify = RPG::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 = BlizzCFG::ICON_DATA[2]
        end
        @notify.x, @notify.y = BlizzCFG::ICON_DATA[0, 2]
        @notify.z = 5000
        @notify.blink_on
      end
      @notify.update
  end
end
#====================================================================
# www.ultimateam.pl
#====================================================================


Nathaniel125 - Pon 27 Lut, 2012 21:14

Już traciłem nadzieje na to że ktoś odpowie :-P
Dziękuje Ayene, ;-)
Mam jeszcze jedno pytanie: jak określić o ile wzrośnie HP i SP wraz z każdym rozdanym punktem? Bo domyślnie rośnie o 1 a to trochę mało.

Edit:
Ayene wygląda na to że wszystko jest ok ;) Dziękuje :-D

Tomekproer2 - Wto 24 Kwi, 2012 13:31

Fajny Skrpycik działa na polskiej wersji bez problemu ;-)

Dziękuje

Helseth - Czw 10 Maj, 2012 11:27

Witam
Pojawił się u mnie mały problem

Podczas gdy ktoś awansuje w menu mam dostępną zakładkę "statystyki" gdzie można rozdawać punkty statystyk. Za każdym razem pojawia się okienko z pierwszą postacią, problem polega na tym, że chciałbym zmienić w skrypcie tak, żeby bezpośrednio można było wskazać postać której "okno rozdawania statystyk" ma się pojawić oraz pozbyć się "następny" i "poprzedni" z menu opcji rozdawania

proszę o pomoc co i gdzie mam z edytować :-)

Ayene - Czw 10 Maj, 2012 16:35

A w jaki sposób dodałeś zakładkę do menu? Ręcznie, czy skorzystałeś z jakiegoś dodatkowego menu?
Helseth - Czw 10 Maj, 2012 20:21

ręcznie, tak jak ktoś podał w tym temacie , zastąpiłem już istniejące statystyki w menu tylko podmieniłem je komendą która wywołuje skrypt rozdawania statystyk xD tak, że wszystko raczej standardowe
Ayene - Czw 10 Maj, 2012 20:41

Wklej tutaj treść "Scene_Menu". Trzeba ją nieco zmodyfikować.
Helseth - Czw 10 Maj, 2012 22:38

Spoiler:

Kod:
#==============================================================================
#  Scene_Menu
#------------------------------------------------------------------------------
#
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  #
  #     
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  #
   #--------------------------------------------------------------------------
  def main
    #
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Statystyki"
    s5 = "Zapis gry"
    s6 = "Koniec"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    #
    if $game_party.actors.size == 0
      #
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    #
    if $game_system.save_disabled
      #
      @command_window.disable_item(4)
    end
    #
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    #
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    #
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    #
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    #
    Graphics.transition
    #
    loop do
      #
      Graphics.update
      #
      Input.update
      #
      update
      #       if $scene != self
        break
      end
    end
    #
    Graphics.freeze
    #
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def update
    #
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    #
    if @command_window.active
      update_command
      return
    end
    #
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def update_command
    #
    if Input.trigger?(Input::B)
      #
      $game_system.se_play($data_system.cancel_se)
      #
      $scene = Scene_Map.new
      return
    end
    #
    if Input.trigger?(Input::C)
      #
      if $game_party.actors.size == 0 and @command_window.index < 4
        #
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      #
      case @command_window.index
      when 0  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Item.new
      when 1  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  #
        $scene = Scene_Points.new
      when 4  #
        #
        if $game_system.save_disabled
          #
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Save.new
      when 5  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def update_status
    #
    if Input.trigger?(Input::B)
      #
      $game_system.se_play($data_system.cancel_se)
      #
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    #
    if Input.trigger?(Input::C)
      #
      case @command_window.index
      when 1  # &#12473;&#12461;&#12523;
        #
        if $game_party.actors[@status_window.index].restriction >= 2
          #
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Skill.new(@status_window.index)
      when 2  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Equip.new(@status_window.index)
      when 3  #
        #  SE
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end


Ayene - Nie 13 Maj, 2012 21:20

Zamień skrypt Scene_Menu na poniższy:
Spoiler:

Kod:
#==============================================================================
#  Scene_Menu
#------------------------------------------------------------------------------
#
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  #
  #     
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  #
   #--------------------------------------------------------------------------
  def main
    #
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Statystyki"
    s5 = "Zapis gry"
    s6 = "Koniec"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    #
    if $game_party.actors.size == 0
      #
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    #
    if $game_system.save_disabled
      #
      @command_window.disable_item(4)
    end
    #
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    #
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    #
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    #
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    #
    Graphics.transition
    #
    loop do
      #
      Graphics.update
      #
      Input.update
      #
      update
      if $scene != self
        break
      end
    end
    #
    Graphics.freeze
    #
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def update
    #
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    #
    if @command_window.active
      update_command
      return
    end
    #
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def update_command
    #
    if Input.trigger?(Input::B)
      #
      $game_system.se_play($data_system.cancel_se)
      #
      $scene = Scene_Map.new
      return
    end
    #
    if Input.trigger?(Input::C)
      #
      if $game_party.actors.size == 0 and @command_window.index < 4
        #
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      #
      case @command_window.index
      when 0  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Item.new
      when 1  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0       
      when 4  #
        #
        if $game_system.save_disabled
          #
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Save.new
      when 5  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  #
  #--------------------------------------------------------------------------
  def update_status
    #
    if Input.trigger?(Input::B)
      #
      $game_system.se_play($data_system.cancel_se)
      #
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    #
    if Input.trigger?(Input::C)
      #
      case @command_window.index
      when 1  # &#12473;&#12461;&#12523;
        #
        if $game_party.actors[@status_window.index].restriction >= 2
          #
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Skill.new(@status_window.index)
      when 2  #
        #
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Equip.new(@status_window.index)
      when 3  #
        #  SE
        $game_system.se_play($data_system.decision_se)
        #
        $scene = Scene_Points.new(@status_window.index)
      end
      return
    end
  end
end


W skrypcie na rozdawanie punktów znajdź linijki (319~321):
Kod:
def initialize
    @actor, @scene = $game_party.actors[0], $scene.class
  end

i zamień je na:
Kod:
def initialize(actor = $game_party.actors[0])
    @actor, @scene = $game_party.actors[actor], $scene.class
  end

Helseth - Pon 14 Maj, 2012 15:15

U mnie te linijki są trochę wyżej 305~307

I wywala mi błąd w 306 linijce

@actor, @scene = $game_party.actors['actor'], $scene.class

type error
cannot convert String into Integer

:(

Ayene - Pon 14 Maj, 2012 17:02

W 306 linijce nie powinno być dwóch apostrofów (' ') przed i po słowie "actor", czyli powinna wyglądać tak:
Kod:
@actor, @scene = $game_party.actors[actor], $scene.class

a nie tak:
Kod:
@actor, @scene = $game_party.actors['actor'], $scene.class

Helseth - Pon 14 Maj, 2012 17:35

aa sorka z tymi ' ' to już sam kombinowałem i omyłkowo wkleiłem z tym ;p
No ale błąd i tak wywala po skopiowaniu tego co kazałaś mi wrzucić ;P
(Ten skrypt statystyk mam z HP i SP co jest kilka postów wyżej)

ciągle jest taki błąd w tej mojej 306 linijce :
@actor, @scene = $game_party.actors[actor], $scene.class


Type error
cannot convert Game_Actor into Integer

Ayene - Pon 14 Maj, 2012 17:55

A spróbuj linijkę:
Kod:
def initialize(actor = $game_party.actors[0])

zamienić na:
Kod:
def initialize(actor = 0)

Helseth - Pon 14 Maj, 2012 18:18

dla odmiany gra teraz po zmianie działa, ale nadal nie ma takiego efektu jak chce :P czyli żeby było można bezpośrednio włączyć okno rozdawania statystyk wybranej postaci,
Bo jest tak jak było wcześniej nawet jeśli wybiore postać 2,3,4 zawsze otwiera się od postaci 1szej i trzeba zmieniać tym przyciskiem "następny, poprzedni" których się chce pozbyć :(

Ayene - Pon 14 Maj, 2012 18:24

A nadpisałeś skrypt Scene_Menu, który wrzuciłam w spoiler w tym poście? http://www.ultimateam.pl/...p?p=76247#76247
Helseth - Pon 14 Maj, 2012 18:26

No oczywiście ^^

sam nie wiem co może być przyczyną :(

Ayene - Pią 18 Maj, 2012 22:03

Przede wszystkim, nie edytowałeś poprawnie linijki 306 w skrypcie 'Skrypt statystyk', powinno być:
Kod:
@actor, @scene = $game_party.actors[actor], $scene.class

a miałeś
Kod:
@actor, @scene = $game_party.actors[0], $scene.class

po drugie masz skrypt, który nadpisuje Tobie menu. Wejdź w 'Menu' (skrypt nad poprzednim) i znajdź linijkę:
Kod:
$scene = Scene_Points.new

zamień ją na:
Kod:
$scene = Scene_Points.new(@status_window.index)

Helseth - Nie 20 Maj, 2012 23:52

Działa elegancko :P

Dziękuję jesteś wielka :D
i przepraszam za zawracanie gitary ^^

kolkav5 - Wto 26 Cze, 2012 16:06

Cyklop napisał/a:
Świetne, takie coś przydałoby się jeszvze do VX. Pozdro dla Fire Pig :P

Zobacz sobie.
http://www.ultimateam.pl/viewtopic.php?t=2068 :mrgreen:

Darker11 - Sro 10 Kwi, 2013 18:18

Witam, wiem, że temat trochę przestarzały, ale...
Kiedy wyświetla mi okno rozdawania punktów to wyświetla się tak:,,&#17 'tu ilość danej statystyki' &#18'' i chciałbym zamienić to ,,&#17'' i ,,&#18'' na np. ,,>'' i ,,<'' ale nie wiem jak... przeszukałem kilka razy skrypt ale nic nie znalazłem... Mam nadzieje, że ktoś tu pomoże...

Rouch - Sro 10 Kwi, 2013 21:30

Masz przecież takie linie w skrypcie:
Kod:
self.contents.draw_text(0, (i + 1) * 64 - 8, 32, 42, '&#171;', 2)
          self.contents.draw_text(96, (i + 1) * 64 - 8, 32, 42, '&#187;')}

Darker11 - Czw 11 Kwi, 2013 13:58

aa faktycznie nie zauważyłem... Dzięki... :-)
m4t3us2 - Sob 04 Maj, 2013 15:53

Da się zmienić pozycje tego kwadracika ?
Ayene - Sob 04 Maj, 2013 20:52

Pokombinuj z parametrami w linijce:
Kod:
ICON_DATA = [612, 452, 192]

Vizzardion - Pon 06 Maj, 2013 04:18

Nie rozumiem tego kodu nim wywołujemy skrypt wytlumaczy mi ktos krok po kroku jak go dodac zeby dzialal?? najpierw kod potem skrypt sam skyprt? czy jak? prosze pomocy

Powered by phpBB modified by Przemo © 2003 phpBB Group