Raccoon Game RPG รวมพลนักพัฒนา
[Script] ติดตั้งสกิลเป็นสล็อท Rpgvx_1024x768b

Join the forum, it's quick and easy

Raccoon Game RPG รวมพลนักพัฒนา
[Script] ติดตั้งสกิลเป็นสล็อท Rpgvx_1024x768b
Raccoon Game RPG รวมพลนักพัฒนา
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[Script] ติดตั้งสกิลเป็นสล็อท

Go down

[Script] ติดตั้งสกิลเป็นสล็อท Empty [Script] ติดตั้งสกิลเป็นสล็อท

ตั้งหัวข้อ by boyhit Fri Oct 28, 2011 7:52 am

สคริปต์อันนี้เยอะหน่อยนะคะ เพราะมะต้องออกแบบ Interface ให้ด้วย ไม่ถูกใจยังไงก็ไปแก้เองละกัน(ฮา)


ส่วนแรกคือ Game_Actor เอาอันนี้ไปแทนของเก่าได้เลยค่ะ
ซ่อน


ต่อไปตรงนี้เอาไปไว้ตรงไหนก็ได้ค่ะ ตั้งชื่อว่า Window_SkillStock
Code:
#==============================================================================
# * Window_SkillStock
#------------------------------------------------------------------------------
# เนƒโ‚ฌโ‚ฌIn the skill picture and the battle picture, it is the window which indicates the
# summary of the skill which can be used.
#==============================================================================

class Window_SkillStock < Window_Selectable
  #--------------------------------------------------------------------------
  # - Object initialization
  #    actor : Actor
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 180, 320, 300)
    @actor = actor
    @column_max = 1
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # - Acquisition of skill
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # - Refreshment
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills_stock.size
      skill = $data_skills[@actor.skills_stock[i]]
      if skill != nil
        @data.push(skill)
      end
    end
    # If the number of items is not 0, it draws up bit map, drawing all item
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # - Drawing of item
  #    index : Item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if not @actor.skill_set?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # - Help text renewal
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  end
end

ส่วนอันนี้ตั้งชื่อว่า Window_SkillSet
Code:
#==============================================================================
# * Window_SkillStock
#------------------------------------------------------------------------------
# เน€เธ™ยƒเน‚ย‚เธŒเน‚ย‚เธŒIn the skill picture and the battle picture, it is the window which indicates the
# summary of the skill which can be used.
#==============================================================================

class Window_SkillSet < Window_Base
  #--------------------------------------------------------------------------
  # - Object initialization
  #    actor : Actor
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(320, 180, 320, 300)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # - Acquisition of skill
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # - Refreshment
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skill_slot
            if @actor.skills[i]!=nil
                skill = $data_skills[@actor.skills[i]]
                @data.push(skill)
      else
                @data.push("null")
            end
    end
    # If the number of items is not 0, it draws up bit map, drawing all item
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # - Drawing of item
  #    index : Item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    self.contents.font.color = normal_color
    x = 4
    y = index  * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
        if skill != "null"
            bitmap = RPG::Cache.icon(skill.icon_name)
            opacity = self.contents.font.color == normal_color ? 255 : 128
            self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
            self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
            self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
        else
            self.contents.draw_text(x + 28, y, 204, 32, "_______________________", 0)
        end
  end
  #--------------------------------------------------------------------------
  # - Help text renewal
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  end
end

ส่วนอันนี้ตั้งชื่อว่า Scene_SetSkill ควรเอาไว้ใต้วินโดว์สองอันบน
Code:
#==============================================================================
# * Window_Header
#------------------------------------------------------------------------------
# เน€เธ™ยƒเน‚ย‚เธŒเน‚ย‚เธŒIn the skill picture and the battle picture, it is the window which indicates the
# summary of the skill which can be used.
#==============================================================================
class Window_Header < Window_Base
    def initialize(text,x)
        super(320*x, 128, 320, 52)
        self.contents = Bitmap.new(width - 32, height - 32)
    @text = text
    refresh
    end
 
  def refresh
    self.contents.clear
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.contents.draw_text(-32, -16, 320, 52, @text,1)
  end
end
#==============================================================================
# * Window_Exit
#------------------------------------------------------------------------------
# เน€เธ™ยƒเน‚ย‚เธŒเน‚ย‚เธŒIn the skill picture and the battle picture, it is the window which indicates the
# summary of the skill which can be used.
#==============================================================================
class Window_Exit < Window_Selectable
    def initialize
        super(320-75, 320-50, 150, 100)
    self.z = 9999
    @column_max = 1
    @item_max = 2
    refresh
    self.index = 0
    end
 
  def refresh
    self.contents = Bitmap.new(width - 32, row_max * 32)
    self.contents.clear
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.contents.draw_text(4, 0, 100, 32, "Clear Skill",1)
    self.contents.draw_text(4,32,100,32,"Exit",1)
  end
end
#==============================================================================
# * Scene_SetSkill
#------------------------------------------------------------------------------
# เน€เธ™ยƒเน‚ย‚เธŒเน‚ย‚เธŒIt is the class which processes the skill picture.
#==============================================================================

class Scene_SetSkill
  #--------------------------------------------------------------------------
  # - Object initialization
  #    actor_index : Actor index
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # - Main processing
  #--------------------------------------------------------------------------
  def main
    # Acquiring the actor
    @actor = $game_party.actors[@actor_index]
    # Drawing up the help window, the status window and the skill window
    @help_window = Window_Help.new
        @stockhead_window = Window_Header.new("Stock",0)
        @sethead_window = Window_Header.new("Set",1)
    @status_window = Window_SkillStatus.new(@actor)
    @skillstock_window = Window_SkillStock.new(@actor)
    @exit_window = Window_Exit.new
        @skill_window = Window_SkillSet.new(@actor)
    # Help window association
    @skillstock_window.help_window = @help_window
    @skillstock_window.active = true
    @exit_window.active = false
    @exit_window.visible = false
    # Transition execution
    Graphics.transition
    # Main loop
    loop do
      # Renewing the game picture
      Graphics.update
      # Updating the information of input
      Input.update
      # Frame renewal
      update
      # When the picture changes, discontinuing the loop
      if $scene != self
        break
      end
    end
    # Transition preparation
    Graphics.freeze
    # Releasing the window
    @help_window.dispose
    @status_window.dispose
    @skillstock_window.dispose
        @skill_window.dispose
    @stockhead_window.dispose
        @sethead_window.dispose
    @exit_window.dispose
  end
  #--------------------------------------------------------------------------
  # - Frame renewal
  #--------------------------------------------------------------------------
  def update
    # Renewing the window
    @help_window.update
    @status_window.update
    @skillstock_window.update
        @skill_window.update
    @exit_window.update
    # When the skill window is active,: Update_skill is called
    if @skillstock_window.active
      update_skill
      return
    end
    # When the exit window is active, update_exit is called
    if @exit_window.active
      update_exit
      return
    end
  end
  #--------------------------------------------------------------------------
  # - When frame renewal (the skill window is active)
  #--------------------------------------------------------------------------
  def update_exit
    # The B when button is pushed
    if Input.trigger?(Input::B)
      # Performing cancellation SE
      $game_system.se_play($data_system.cancel_se)
      @skillstock_window.active = true
      @exit_window.active = false
      @exit_window.visible = false
      return
    end
    # When C button is pushed
    if Input.trigger?(Input::C)
      case @exit_window.index
      when 0
        @actor.clear_skill
        $game_system.se_play($data_system.decision_se)
        @skillstock_window.refresh
              @skill_window.refresh
        @skillstock_window.active = true
        @exit_window.active = false
        @exit_window.visible = false
      when 1
        # Change to menu screen
        $scene = Scene_Menu.new(1)
      end
    end
  end
  #--------------------------------------------------------------------------
  # - When frame renewal (the skill window is active)
  #--------------------------------------------------------------------------
  def update_skill
    # The B when button is pushed
    if Input.trigger?(Input::B)
      # Performing cancellation SE
      $game_system.se_play($data_system.cancel_se)
      @skillstock_window.active = false
      @exit_window.active = true
      @exit_window.visible = true
      return
    end
    # When C button is pushed
    if Input.trigger?(Input::C)
      @skill = @skillstock_window.skill
            if @actor.skill_set?(@skill.id)
        $game_system.se_play($data_system.cancel_se)
                @actor.remove_skill(@skill.id)
            else
                if @actor.skills.size< @actor.skill_slot
          $game_system.se_play($data_system.decision_se)
                    @actor.set_skill(@skill.id)
                else
                    $game_system.se_play($data_system.cancel_se)
                end
            end
            @skillstock_window.refresh
            @skill_window.refresh
      return
    end
    # The R when button is pushed
    if Input.trigger?(Input::Z)
      # Performing cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To the following actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Change to another skill picture
      $scene = Scene_SetSkill.new(@actor_index)
      return
    end
    # The L when button is pushed
    if Input.trigger?(Input::Y)
      # Performing cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To actor before
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Change to another skill picture
      $scene = Scene_SetSkill.new(@actor_index)
      return
    end
  end
end

จากนั้นอันนี้ เป็น Scene_Menu อันใหม่ ถ้าเกิดอยากหาวิธีเรียกเองโดยไม่ใช้เมนูนี้ก็ถามได้จ้า
Code:
#==============================================================================
# * Window_SkillCommnad
#------------------------------------------------------------------------------
# เน€เธ™ยƒเน‚ย‚เธŒเน‚ย‚เธŒIn the skill picture and the battle picture, it is the window which indicates the
# summary of the skill which can be used.
#==============================================================================
class Window_SkillCommand < Window_Selectable
    def initialize
        super(0, 0, 160, 100)
    self.z = 9999
    @column_max = 1
    @item_max = 2
    refresh
    self.index = 0
    end
 
  def refresh
    self.contents = Bitmap.new(width - 32, row_max * 32)
    self.contents.clear
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.contents.draw_text(4, 0, 100, 32, "Set",1)
    self.contents.draw_text(4,32,100,32,"Use",1)
  end
end
#==============================================================================
# * Scene_Menu
#------------------------------------------------------------------------------
# ใ€€It is the class which processes the menu screen.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # - Object initialization
  #    menu_index : Cursor initial position of command
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # - Main processing
  #--------------------------------------------------------------------------
  def main
    # Drawing up the command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @skillcommand_window = Window_SkillCommand.new
    @skillcommand_window.visible = false
    @skillcommand_window.active = true
    # When party number of people 0 is
    if $game_party.actors.size == 0
      # Nullifying the item, skill, equipment and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # In case of saving prohibition
    if $game_system.save_disabled
      # Saving is made invalid
      @command_window.disable_item(4)
    end
    # Drawing up the play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    # Drawing up step several windows
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    # Drawing up the Goldwyn dough
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Drawing up the status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Transition execution
    Graphics.transition
    # Main loop
    loop do
      # Renewing the game picture
      Graphics.update
      # Updating the information of input
      Input.update
      # ใƒ•ใƒฌใƒผใƒ ๆ›ดๆ–ฐ
      update
      # When the picture changes, discontinuing the loop
      if $scene != self
        break
      end
    end
    # Transition preparation
    Graphics.freeze
    # Releasing the window
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @skillcommand_window.dispose
  end
  #--------------------------------------------------------------------------
  # - Frame renewal
  #--------------------------------------------------------------------------
  def update
    # Renewing the window
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    @skillcommand_window.update
    # When the command window is active,: Update_command is called
    if @command_window.active
      update_command
      return
    end
    # When the status window is active,: Update_status is called
    if @status_window.active
      update_status
      return
    end
    # When the status window is active,: Update_status is called
    if @skillcommand_window.active
      update_skill
      return
    end
  end
  #--------------------------------------------------------------------------
  # - When frame renewal (the skill command window is active)
  #--------------------------------------------------------------------------
  def update_skill
    # The B when button is pushed
    if Input.trigger?(Input::B)
      # Performing cancellation SE
      $game_system.se_play($data_system.cancel_se)
      # The command window is made active
      @command_window.active = true
      @skillcommand_window.active = false
      @skillcommand_window.visible = false
      return
    end
    # When C button is pushed
    if Input.trigger?(Input::C)
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # The status window is made active
        @skillcommand_window.active = false
        @status_window.active = true
        @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # - When frame renewal (the command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # The B when button is pushed
    if Input.trigger?(Input::B)
      # Performing cancellation SE
      $game_system.se_play($data_system.cancel_se)
      # Change to map picture
      $scene = Scene_Map.new
      return
    end
    # When C button is pushed
    if Input.trigger?(Input::C)
      # When party number of people with 0, it is command other than saving and game end
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Performing buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # It diverges at cursor position of the command window
      case @command_window.index
      when 0  # Item
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # Change to item picture
        $scene = Scene_Item.new
      when 1  # Skill
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # The status window is made active
        @command_window.active = false
        @skillcommand_window.visible = true
        @skillcommand_window.active = true
      when 2  # Equipment
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # The status window is made active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # Status
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # The status window is made active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # Saving
        # In case of saving prohibition
        if $game_system.save_disabled
          # Performing buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # Change to saving picture
        $scene = Scene_Save.new
      when 5  # Game end
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # Change to game end picture
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # - When frame renewal (the status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # The B when button is pushed
    if Input.trigger?(Input::B)
      # Performing cancellation SE
      $game_system.se_play($data_system.cancel_se)
      # The command window is made active
      @command_window.active = true
      @skillcommand_window.visible = false
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # When C button is pushed
    if Input.trigger?(Input::C)
      # It diverges at cursor position of the command window
      case @command_window.index
      when 1  # Skill
        # When conduct restriction of this actor is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Performing buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # Change to skill picture
        case @skillcommand_window.index
        when 0
                  $scene = Scene_SetSkill.new(@status_window.index)
        when 1
                  $scene = Scene_Skill.new(@status_window.index)
        end
      when 2  # Equipment
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # Change to equipment picture
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # Status
        # Performing decision SE
        $game_system.se_play($data_system.decision_se)
        # Change to status picture
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end
                  
                  

Credit: Mako
boyhit
boyhit
Admin
Admin

ชื่อเล่น : เเอล
ความฝัน : ศิลปิน
จำนวนข้อความ : 1130
เครดิต : 3356
วันที่สมัคร : 09/10/2011
คะเเนนน้ำใจ : 11
เพศ : Male อายุ : 24
เหรียญรางวัล : [Script] ติดตั้งสกิลเป็นสล็อท Medalhead2

https://raccoongame-rpg.thai-forum.net

ขึ้นไปข้างบน Go down

[Script] ติดตั้งสกิลเป็นสล็อท Empty Re: [Script] ติดตั้งสกิลเป็นสล็อท

ตั้งหัวข้อ by boyhit Fri Oct 28, 2011 7:53 am

อันนี้เป็นภาพการทำงานของ Script นี้ค่ะ

เมนูเวลาเลือก Skill จะมีคำสั่งให้เลือกอีกดังนี้
[Script] ติดตั้งสกิลเป็นสล็อท Clip-1


พอเลือก USE ก็จะเป็นตามปกติ แต่ในภาพนี้เรายังไม่ได้เซ็ทสกิลอะไรเลย
[Script] ติดตั้งสกิลเป็นสล็อท Clip_2-1

พอเลือกเซ็ทก็จะเป็นหน้าจอดังนี้
[Script] ติดตั้งสกิลเป็นสล็อท Clip_3
การควบคุมในหน้าจอนี้มีดังนี้
Page Up - เลื่อนรายชื่อสกิลขึ้นหนึ่งหน้า
Page Dwn - เลื่อนรายชื่อสกิลลงหนึ่งหน้า
S - เปลี่ยนตัวละครไปทางซ้าย
D - เปลี่ยนตัวละครไปทางขวา
Enter - ติด/ปลด สกิล
Esc - เีรียกเมนูย่อย


[Script] ติดตั้งสกิลเป็นสล็อท Clip_4
กดเอนเทอร์เพื่อเลือกสกิลที่จะเข้า หากกดเอนเทอร์ที่ชื่อสกิลที่สีมันทึบๆ จะเป็นการถอดสกิลออก

[Script] ติดตั้งสกิลเป็นสล็อท Clip_5
กดปุ่ม Esc เพื่อเรียกเมนูย่อยมา Clear Skill คือ ถอดทุกสกิลที่ติดตั้งออก เพื่อติดตั้งใหม่หมด และ Exit คือ กลับไปหน้าเมนูหลัก

[Script] ติดตั้งสกิลเป็นสล็อท Clip_6
พอติดสกิลแล้วกลับมาดูในหน้าจอใช้สกิล จะพบว่ามีสกิลที่เราติดตั้งเรียบร้อยแล้ว



ในโค้ดนี้จำนวนช่องสูงสุดที่ติดสกิลได้คือ 8 ช่อง ถ้าอยากเปลี่ยนตรงนี้ให้ไปแก้ไขได้ใน Game_Actor
ตรง

CODE
@skill_slot = 8


เปลี่ยนเป็นเลขอื่นแทน แต่ถ้าเกิน 8 มันจะเกินหน้าจอนั้นน่อ ยังไงก็ถ้าจะให้เกิน 8 ก็คงต้องแก้ interface เองหมดเลยแหละนะ 5555+


ถ้าอยากให้จำนวนช่องที่ใส่ได้มีการพัฒนาตามเลเวล ก็ให้แก้ตรงนี้
CODE
attr_reader :skill_slot # Skill slot number

เป็น
CODE
attr_accessor :skill_slot # Skill slot number



แล้วเวลาอยากแก้จำนวนก็ให้เรียกใช้โค้ด
CODE
$game_actors[รหัสตัวละคร].skill_slot = จำนวนช่อง # Skill slot number



เท่า
นี้แหละจ้า กับวิธีใช้ ระบบนี้ดีมากๆทำให้เกมมีการวางแผนมากขึ้น สามารถ
customize ตัวละครได้ ถ้าผนวกกับบอสที่มีลูกเล่นมากๆจะยิ่งดี [Script] ติดตั้งสกิลเป็นสล็อท Smile

รายละเอียดเพิ่มเติม
- ใช้ร่วมกับคำสั่งเรียนรู้สกิล/ลบสกิล ของโปรแกรม Rmxp ได้ โดยการเรียนรู้/ลบออก นั้น จะเป็นการ เรียนรู้หรือลบออกเฉพาะสกิลใน SLOT เท่านั้น
- พอมาเขียนตรงนี้ถึงได้รู้ว่ามีบั๊ก....
เอานี่
CODE
#--------------------------------------------------------------------------
# - Skill is forgotten
# skill_id : Skill ID
#--------------------------------------------------------------------------
def forget_skill(skill_id)
@skills_stock.delete(skill_id)
if skill_set?(skill_id)
@skills.delete(skill_id)
@skills.sort!
end
end


ไป
แทน def forget_skill(skill_id) ของเก่าเน่อ ปัญหาที่เกิดขึ้นคือ
ถ้าเราติดสกิลนึง แล้วลบสกิลนั้นออกจากสต็อก
สกิลนั้นจะยังคงอยู่ในส่วนที่เราติดตั้ง และเราจะไม่มีวันถอดสกิลนั้นออกได้
เหอๆ

Credit: Mako
boyhit
boyhit
Admin
Admin

ชื่อเล่น : เเอล
ความฝัน : ศิลปิน
จำนวนข้อความ : 1130
เครดิต : 3356
วันที่สมัคร : 09/10/2011
คะเเนนน้ำใจ : 11
เพศ : Male อายุ : 24
เหรียญรางวัล : [Script] ติดตั้งสกิลเป็นสล็อท Medalhead2

https://raccoongame-rpg.thai-forum.net

ขึ้นไปข้างบน Go down

ขึ้นไปข้างบน

- Similar topics

 
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ