Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

edit skills script

I'd like this script to be edited please

Code:
#==============================================================================
# ** Module Skills
#==============================================================================
module Skills
  # Just include the Skillss you want to have in the array, they'll be displayed
  # in the order you place them in the array
  Database_Skills = ["Fire"]
  # The Switches are assigned to the actors in the array, means the first 
  # variable in the array is assigned to the first actor in the Database_Skills array
  Switches = [8]
  # ID of the maps that are teleported to
  Skills = [3]
  # Text that shows up if you want to release a Skills
  Release = "Are you sure you wish to learn this Skill?"
  # Text that shows up if a character / Skills is not available
  Not_Available = "Not Available"
end
#==============================================================================
# ** Scene_Release
#==============================================================================

class Scene_Skill_Gain
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @skill_left = Window_skill_Left.new
    @dummy_window = Window_Base.new(170, 129, 400, 64)
    @dummy_window.contents = Bitmap.new(@dummy_window.width - 32, @dummy_window.height - 32)
    @dummy_window.contents.draw_text(4, 0, 360, 32, Skills::Release)
    @command_window = Window_Command.new(160,["Yes", "No"])
    @command_window.active = false
    @command_window.visible = false
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 240 - @command_window.height / 2
    @command_window.z = 150
    @dummy_window.z = 150
    @dummy_window.visible = false
    # Make sprite set
    @spriteset = Spriteset_Map.new
    refresh
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @skill_left.dispose
    @command_window.dispose
    @dummy_window.dispose
    # Dispose of sprite set
    @spriteset.dispose
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if @old_index != @skill_left.index
      @old_index = @skill_left.index
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @command_window.update
    @skill_left.update
    refresh
    if @skill_left.active
      skill_update
    elsif @command_window.active
      command_update
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when skill window is active)
  #--------------------------------------------------------------------------
  def skill_update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to Map screen
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_switches[Skills::Switches[@skill_left.index]] != true
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @skill_left.active = false
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def command_update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @skill_left.active = true
      @command_window.active = false
      @command_window.visible = false
      @dummy_window.visible = false
      @command_window.index = 0
      return
    end
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        @skill_left.active = true
        @command_window.active = false
        @command_window.visible = false
        @dummy_window.visible = false
        @command_window.index = 0
      when 0
        #Learn Skills
        id = Skills::Skills[@skill_left.index]
        $game_party.actors[0].learn_skill(id)
        $scene = Scene_Map.new
        $game_map.autoplay
      end
    end
  end
end
#==============================================================================
# * Window_skill_Left
#==============================================================================

class Window_skill_Left < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(215, 0, 210, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @index = 0
    @item_max = Skills::Database_Skills.size
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = Color.new(0, 0, 0)
    self.contents.draw_text(3, 1, 150, 32, "Realm Name:")
    self.contents.draw_text(5, -1, 150, 32, "Realm Name:")
    self.contents.draw_text(3, -1, 150, 32, "Realm Name:")
    self.contents.draw_text(5, 1, 150, 32, "Realm Name:")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 150, 32, "Realm Name:")
    for i in 0...Skills::Database_Skills.size
      y = i * 32
      @name = $game_switches[Skills::Switches[i]] == true ? Skills::Database_Skills[i] : Skills::Not_Available
      self.contents.draw_text(4, y + 32, 150, 32, "#{@name}")
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(0, @index * 32 + 32, self.width - 32, 32)
  end
end

What i'd like, before it asks you if you want to learn the skills, it asks what party member you'd like to learn the skill

So it brings up a window in the middle of the screen which has the following options

Party Member 1's Name
Party Member 2's Name (If there is a second one)
Party Member 3's Name (If there is a third one)
Party Member 4's Name (If there is a fourth one)
All

If the player selects the first one, the first party member gains the skill, same with 2,3 and 4. If they select all, then all of them gain that skill

After they have selected the member, it then asks if your sure you want them to learn it

Thank you to anyone who helps. If you need more info let me know
 
i don't think it would be easier to do it via events, since you can't have more than 4 choices at once, ann trying to set an event up when you get over 50 kills would be a nightmare
 
Hi Desbrina,

I've edited your script so now it will show a window where you can choose which party member you wish to learn the skill.  I also added a new dummy window for the "choose party member" window. The window will display a text saying something like: "Which hero should learn the skill?".

Although, i didn't add the "All" choice in the "choose party member" window, i wasn't really sure on how to make all of the party members learn the skill, although i think i can fix it later, tonight, when i have more time. ^^

Anyways, here is the script:
Code:
#==============================================================================
# ** Module Skills
#==============================================================================
module Skills
  # Just include the Skillss you want to have in the array, they'll be displayed
  # in the order you place them in the array
  Database_Skills = ["Fire", "Ice"]
  # The Switches are assigned to the actors in the array, means the first 
  # variable in the array is assigned to the first actor in the Database_Skills array
  Switches = [8, 8]
  # ID of the maps that are teleported to
  Skills = [7, 10]
  # Text that shows up if you want to release a Skills
  Release = "  Are you sure you wish to learn this Skill?"
  Release_Two = "        Which hero should learn the skill?"
  # Text that shows up if a character / Skills is not available
  Not_Available = "Not Available"
end
#==============================================================================
# ** Scene_Release
#==============================================================================

class Scene_Skill_Gain
  def initialize(actor_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
  @Actor1 = $game_party.actors[0].name if $game_party.actors.size > 0 
  @Actor2 = $game_party.actors[1].name if $game_party.actors.size > 1 
  @Actor3 = $game_party.actors[2].name if $game_party.actors.size > 2 
  @Actor4 = $game_party.actors[3].name if $game_party.actors.size > 3
    @skill_left = Window_skill_Left.new
    @dummy_window = Window_Base.new(120, 129, 400, 64)
    @dummy_window.contents = Bitmap.new(@dummy_window.width - 32, @dummy_window.height - 32)
    @dummy_window.contents.draw_text(4, 0, 360, 32, Skills::Release)
    @dummy_window_two = Window_Base.new(120, 129, 400, 64)
    @dummy_window_two.contents = Bitmap.new(@dummy_window_two.width - 32, @dummy_window_two.height - 32)
    @dummy_window_two.contents.draw_text(4, 0, 360, 32, Skills::Release_Two)
    @command_window = Window_Command.new(160,["Yes", "No"])
    @command_window.active = false
    @command_window.visible = false
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 240 - @command_window.height / 2
    @command_window.z = 150
  if $game_party.actors.size == 1
    @command_windowt = Window_Command.new(160,[@Actor1])
  end
  if $game_party.actors.size == 2
    @command_windowt = Window_Command.new(160,[@Actor1, @Actor2])
  end
  if $game_party.actors.size == 3
    @command_windowt = Window_Command.new(160,[@Actor1, @Actor2, @Actor3])
  end
  if $game_party.actors.size == 4
    @command_windowt = Window_Command.new(160,[@Actor1, @Actor2, @Actor3, @Actor4])
  end
    @command_windowt.active = false
    @command_windowt.visible = false
    @command_windowt.x = 320 - @command_window.width / 2
    @command_windowt.y = 240 - @command_window.height / 2
    @command_windowt.z = 150
    @dummy_window.z = 150
    @dummy_window.visible = false
    @dummy_window_two.z = 150
    @dummy_window_two.visible = false
    # Make sprite set
    @spriteset = Spriteset_Map.new
    refresh
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @skill_left.dispose
    @command_window.dispose
    @command_windowt.dispose
    @dummy_window.dispose
    @dummy_window_two.dispose
    # Dispose of sprite set
    @spriteset.dispose
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if @old_index != @skill_left.index
      @old_index = @skill_left.index
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @command_window.update
    @command_windowt.update
    @skill_left.update
    refresh
    if @skill_left.active
      skill_update_two
    elsif @command_window.active
      command_update
    elsif @command_windowt.active
      command_update_two
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when skill window is active)
  #--------------------------------------------------------------------------
  def skill_update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to Map screen
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_switches[Skills::Switches[@skill_left.index]] != true
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @skill_left.active = false
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update2 (when skill window2 is active)
  #--------------------------------------------------------------------------
    def skill_update_two
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to Map screen
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_switches[Skills::Switches[@skill_left.index]] != true
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @skill_left.active = false
      @command_windowt.active = true
      @command_windowt.visible = true
      @dummy_window_two.visible = true
      @command_windowt.index = 0
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def command_update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @skill_left.active = true
      @command_window.active = false
      @command_window.visible = false
      @dummy_window.visible = false
      @command_window.index = 0
      return
    end
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        @skill_left.active = true
        @command_window.active = false
        @command_window.visible = false
        @dummy_window.visible = false
        @command_window.index = 0
      when 0
        #Learn Skills
        id = Skills::Skills[@skill_left.index]
        $game_party.actors[@actor_index].learn_skill(id)
        $scene = Scene_Map.new
        $game_map.autoplay
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update2 (when command window is active)
  #--------------------------------------------------------------------------
  def command_update_two
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @skill_left.active = true
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      return
    end
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      case @command_windowt.index
      when 0
      @actor_index = 0
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      when 1
      @actor_index = 1
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      when 2
      @actor_index = 2
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      when 3
      @actor_index = 3
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      end
    end
  end
#==============================================================================
# * Window_skill_Left
#==============================================================================

class Window_skill_Left < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(215, 0, 210, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @index = 0
    @item_max = Skills::Database_Skills.size
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = Color.new(0, 0, 0)
    self.contents.draw_text(3, 1, 150, 32, "Realm Name:")
    self.contents.draw_text(5, -1, 150, 32, "Realm Name:")
    self.contents.draw_text(3, -1, 150, 32, "Realm Name:")
    self.contents.draw_text(5, 1, 150, 32, "Realm Name:")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 150, 32, "Realm Name:")
    for i in 0...Skills::Database_Skills.size
      y = i * 32
      @name = $game_switches[Skills::Switches[i]] == true ? Skills::Database_Skills[i] : Skills::Not_Available
      self.contents.draw_text(4, y + 32, 150, 32, "#{@name}")
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(0, @index * 32 + 32, self.width - 32, 32)
  end
end

I think this is what you wanted, if not, tell me and i'll change it.
And as i said, later tonight when i have time, i'll try to figure out how to make them all learn the skill. :thumb:

Over and out - Gando
 
The problem wasn't any script, if you look at this line:
Code:
Skills = [7, 1]

These are the skills that are available, but the problem was that in your database, you only have 3 skills.
That's why the players couldn't learn skill number 7, because it doesn't exist.
So either you increase the maximum skills in the database to 7, and make the 7:th the fire skill, or you change this line:
Code:
Skills = [7, 1]

to:
Code:
Skills = [3, 1]

Since the "3" is the id of the "fire" skill in your database. :thumb:

Over and out - Gando
 
Yeah, i figured it out,
You are now able to choose the "all" option.
Here is the updated script:

Code:
#==============================================================================
# ** Module Skills
#==============================================================================
module Skills
  # Just include the Skillss you want to have in the array, they'll be displayed
  # in the order you place them in the array
  Database_Skills = ["Fire", "Heal"]
  # The Switches are assigned to the actors in the array, means the first 
  # variable in the array is assigned to the first actor in the Database_Skills array
  Switches = [8, 9]
  # ID of the maps that are teleported to
  Skills = [3, 1]
  # Text that shows up if you want to release a Skills
  Release = "  Are you sure you wish to learn this Skill?"
  Release_Two = "        Which hero should learn the skill?"
  # Text that shows up if a character / Skills is not available
  Not_Available = "Not Available"
end
#==============================================================================
# ** Scene_Release
#==============================================================================

class Scene_Skill_Gain
  def initialize(actor_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
  @Actor1 = $game_party.actors[0].name if $game_party.actors.size > 0 
  @Actor2 = $game_party.actors[1].name if $game_party.actors.size > 1 
  @Actor3 = $game_party.actors[2].name if $game_party.actors.size > 2 
  @Actor4 = $game_party.actors[3].name if $game_party.actors.size > 3
    @skill_left = Window_skill_Left.new
    @dummy_window = Window_Base.new(120, 129, 400, 64)
    @dummy_window.contents = Bitmap.new(@dummy_window.width - 32, @dummy_window.height - 32)
    @dummy_window.contents.draw_text(4, 0, 360, 32, Skills::Release)
    @dummy_window_two = Window_Base.new(120, 129, 400, 64)
    @dummy_window_two.contents = Bitmap.new(@dummy_window_two.width - 32, @dummy_window_two.height - 32)
    @dummy_window_two.contents.draw_text(4, 0, 360, 32, Skills::Release_Two)
    @command_window = Window_Command.new(160,["Yes", "No"])
    @command_window.active = false
    @command_window.visible = false
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 240 - @command_window.height / 2
    @command_window.z = 150
    @command_window_all = Window_Command.new(160,["Yes", "No"])
    @command_window_all.active = false
    @command_window_all.visible = false
    @command_window_all.x = 320 - @command_window_all.width / 2
    @command_window_all.y = 240 - @command_window_all.height / 2
    @command_window_all.z = 150
  if $game_party.actors.size == 1
    @command_windowt = Window_Command.new(160,[@Actor1, "all"])
  end
  if $game_party.actors.size == 2
    @command_windowt = Window_Command.new(160,[@Actor1, @Actor2, "all"])
  end
  if $game_party.actors.size == 3
    @command_windowt = Window_Command.new(160,[@Actor1, @Actor2, @Actor3, "all"])
  end
  if $game_party.actors.size == 4
    @command_windowt = Window_Command.new(160,[@Actor1, @Actor2, @Actor3, @Actor4, "all"])
  end
    @command_windowt.active = false
    @command_windowt.visible = false
    @command_windowt.x = 320 - @command_window.width / 2
    @command_windowt.y = 240 - @command_window.height / 2
    @command_windowt.z = 150
    @dummy_window.z = 150
    @dummy_window.visible = false
    @dummy_window_two.z = 150
    @dummy_window_two.visible = false
    # Make sprite set
    @spriteset = Spriteset_Map.new
    refresh
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @skill_left.dispose
    @command_window.dispose
    @command_windowt.dispose
    @dummy_window.dispose
    @command_window_all.dispose
    @dummy_window_two.dispose
    # Dispose of sprite set
    @spriteset.dispose
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if @old_index != @skill_left.index
      @old_index = @skill_left.index
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @command_window.update
    @command_window_all.update
    @command_windowt.update
    @skill_left.update
    refresh
    if @skill_left.active
      skill_update_two
    elsif @command_window.active
        command_update
    elsif @command_window_all.active
        command_update_all
    elsif @command_windowt.active
      command_update_two
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when skill window is active)
  #--------------------------------------------------------------------------
  def skill_update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to Map screen
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_switches[Skills::Switches[@skill_left.index]] != true
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @skill_left.active = false
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update2 (when skill window2 is active)
  #--------------------------------------------------------------------------
    def skill_update_two
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to Map screen
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_switches[Skills::Switches[@skill_left.index]] != true
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @skill_left.active = false
      @command_windowt.active = true
      @command_windowt.visible = true
      @dummy_window_two.visible = true
      @command_windowt.index = 0
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def command_update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @skill_left.active = true
      @command_window.active = false
      @command_window.visible = false
      @dummy_window.visible = false
      @command_window.index = 0
      return
    end
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        @skill_left.active = true
        @command_window.active = false
        @command_window.visible = false
        @dummy_window.visible = false
        @command_window.index = 0
      when 0
        #Learn Skills
        id = Skills::Skills[@skill_left.index]
        $game_party.actors[@actor_index].learn_skill(id)
        $scene = Scene_Map.new
        $game_map.autoplay
      end
    end
  end
  #--------------------------------------------------------------------------
  # * command_update_all (when command window one is active)
  #--------------------------------------------------------------------------
  def command_update_all
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @skill_left.active = true
      @command_window.active = false
      @command_window.visible = false
      @dummy_window.visible = false
      @command_window.index = 0
      return
    end
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 1
        @skill_left.active = true
        @command_window.active = false
        @command_window.visible = false
        @dummy_window.visible = false
        @command_window.index = 0
      when 0
        #Learn Skills
        id = Skills::Skills[@skill_left.index]
        $game_party.actors[0].learn_skill(id) if $game_party.actors.size > 0 
        $game_party.actors[1].learn_skill(id) if $game_party.actors.size > 1 
        $game_party.actors[2].learn_skill(id) if $game_party.actors.size > 2 
        $game_party.actors[3].learn_skill(id) if $game_party.actors.size > 3 
        $scene = Scene_Map.new
        $game_map.autoplay
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update2 (when command window is active)
  #--------------------------------------------------------------------------
  def command_update_two
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      @skill_left.active = true
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      return
    end
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      case @command_windowt.index
      when 0
      @actor_index = 0
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      when 1
      if $game_party.actors.size > 1
      @actor_index = 1
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      else
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window_all.active = true
      @command_window_all.visible = true
      @dummy_window.visible = true
      @command_window_all.index = 0
      end
      when 2
      if $game_party.actors.size > 2
      @actor_index = 2
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      else
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window_all.active = true
      @command_window_all.visible = true
      @dummy_window.visible = true
      @command_window_all.index = 0
      end
      when 3
      if $game_party.actors.size > 3
      @actor_index = 3
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window.active = true
      @command_window.visible = true
      @dummy_window.visible = true
      @command_window.index = 0
      else
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window_all.active = true
      @command_window_all.visible = true
      @dummy_window.visible = true
      @command_window_all.index = 0
      end
      when 4
      #make command windowt.active = false
      @command_windowt.active = false
      @command_windowt.visible = false
      @dummy_window_two.visible = false
      @command_windowt.index = 0
      #make command window.active = true
      @command_window_all.active = true
      @command_window_all.visible = true
      @dummy_window.visible = true
      @command_window_all.index = 0
      end
    end
  end
#==============================================================================
# * Window_skill_Left
#==============================================================================

class Window_skill_Left < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(215, 0, 210, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @index = 0
    @item_max = Skills::Database_Skills.size
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = Color.new(0, 0, 0)
    self.contents.draw_text(3, 1, 150, 32, "Skill Name:")
    self.contents.draw_text(5, -1, 150, 32, "Skill Name:")
    self.contents.draw_text(3, -1, 150, 32, "Skill Name:")
    self.contents.draw_text(5, 1, 150, 32, "Skill Name:")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 150, 32, "Skill Name:")
    for i in 0...Skills::Database_Skills.size
      y = i * 32
      @name = $game_switches[Skills::Switches[i]] == true ? Skills::Database_Skills[i] : Skills::Not_Available
      self.contents.draw_text(4, y + 32, 150, 32, "#{@name}")
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(0, @index * 32 + 32, self.width - 32, 32)
  end
end

I tested it and i couldn't find anything wrong with it,
but if you have any problems, just tell me and i'll see if i can fix them! :thumb:

Over and out - Gando
 
To make a new skill available to learn, you need to add stuff to these three lines:
Code:
Database_Skills = ["Fire", "Heal"]
Switches = [8, 9]
Skills = [3, 1]

Database_Skills   -  Here you write the name of the skill.
Switches           - Here you choose which switch you want to have to enable/disable the availability of the skill.
Skills                 - Here is the skills ID in the database.


And for example, if you would like to add the skill "Remedy" you would change these lines to this:
Code:
Database_Skills = ["Fire", "Heal", "Remedy"]
Switches = [8, 9, 9]
Skills = [3, 1, 4]

You add the text "Remedy" in the Database_Skills, this is the text that will be shown.
And in Switches, you add the desired switch you wish to have.
and in Skills you add the id of the skill in the database, and Remedy is number 4 by default.

Hope that helps! :thumb:

Over and out - Gando
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top