Glad you liked it
I made a small add-on to it that should help you out later on.
#==============================================================================
# ** RPG::Skill Module
#------------------------------------------------------------------------------
# This module handles skill information.
#==============================================================================
module RPG
class Skill < UsableItem
#--------------------------------------------------------------------------
# * Check if a skill cannot be removed
#--------------------------------------------------------------------------
def unremovable?
return self.note.include?("UNREMOVABLE")
end
#--------------------------------------------------------------------------
# * Make array of actors that can remove skills
#--------------------------------------------------------------------------
def removable_by?
self.note[/REMOVABLE_BY: (.*)/]
# Return false if match is nil or collected array of ID's
return $1 == nil ? false : $1.split.collect! {|id| id.to_i}
end
end
end
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# This class performs the skill screen processing.
#==============================================================================
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@viewport = Viewport.new(0, 0, 544, 416)
@help_window = Window_Help.new
@help_window.viewport = @viewport
@status_window = Window_SkillStatus.new(0, 56, @actor)
@status_window.y = 112
@status_window.viewport = @viewport
@skill_window = Window_Skill.new(0, 112 + 56, 544, 304 - 56, @actor)
@skill_window.viewport = @viewport
# Create Command Window
@command_window = Window_Command.new(544, ["Use Skill", "Remove Skill"], 2)
@command_window.draw_item(1, !@actor.skills.empty?)
@command_window.y = 56
@command_window.visible = true
@command_window.active = true
# Create Prompt Window
@prompt_window = Window_Command.new(544, ["Yes", "No"], 2)
@prompt_window.y = 56
@prompt_window.visible = false
@prompt_window.active = false
@target_window = Window_MenuStatus.new(0, 0)
# Selection mode
@selection_mode = "Use"
hide_target_window
@skill_window.active = false
# Wait for input flag
@wait_for_input = false
# Update Help Display
update_help_display
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
alias tds_skill_remove_scene_skill_terminate terminate
def terminate
tds_skill_remove_scene_skill_terminate
dispose_menu_background
@command_window.dispose
@prompt_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
# Update Help Display
update_help_display
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
# Update command window
@command_window.update
# Update Prompt Window
@prompt_window.update
if @wait_for_input
if Input.trigger?(Input::B) or Input.trigger?(Input::C)
Sound.play_decision
@prompt_window.visible = false
@prompt_window.active = false
@command_window.active = @actor.skills.empty? ? true : false
@command_window.visible = true
@skill_window.active = @actor.skills.empty? ? false : true
@wait_for_input = false
return
end
elsif @command_window.active
update_command_selection
elsif @prompt_window.active
update_prompt_selection
elsif @skill_window.active
update_skill_selection
elsif @target_window.active
update_target_selection
end
end
#--------------------------------------------------------------------------
# * Update Prompt Window selection
#--------------------------------------------------------------------------
def update_prompt_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@prompt_window.visible = false
@prompt_window.active = false
@command_window.active = false
@command_window.visible = true
@skill_window.active = true
elsif Input.trigger?(Input::C)
case @prompt_window.index
when 0 # Yes
Sound.play_decision
@actor.forget_skill(@skill_window.skill.id)
@help_window.set_text(sprintf("%s has forgotten the skill: %s", @actor.name, @skill_window.skill.name))
@skill_window.index = 0
@skill_window.refresh
@wait_for_input = true
@command_window.draw_item(1, !@actor.skills.empty?)
@prompt_window.active = false
@prompt_window.visible = false
@command_window.visible = true
return
when 1 # No
Sound.play_decision
@prompt_window.visible = false
@prompt_window.active = false
@command_window.active = false
@command_window.visible = true
@skill_window.active = true
end
end
end
#--------------------------------------------------------------------------
# * Update Command Window selection
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
elsif Input.trigger?(Input::C)
case @command_window.index
when 0 ; @selection_mode = "Use"
when 1
return Sound.play_buzzer if @actor.skills.empty?
@selection_mode = "Remove"
end
@skill_window.index = 0
Sound.play_decision
@command_window.active = false
@skill_window.active = true
end
end
#--------------------------------------------------------------------------
# * Update Help Window Display Information
#--------------------------------------------------------------------------
def update_help_display
# Return if wait for input is true
return if @wait_for_input
# If Prompt Window is active
if @prompt_window.active
@help_window.set_text("Are you sure you want to remove this skill?")
return
end
# If command window is active
if @command_window.active
case @command_window.index
when 0 # Use Skills
@help_window.set_text("Use Selected Skill")
when 1 # Remove Skills
@help_window.set_text("Remove Selected Skill")
end
return
end
# If Skill window is active
if @skill_window.active
case @selection_mode
when "Use"
@help_window.set_text(@skill_window.skill == nil ? "" : @skill_window.skill.description)
when "Remove"
@help_window.set_text("Choose a skill to remove")
end
return
end
end
#--------------------------------------------------------------------------
# * Update Skill Selection
#--------------------------------------------------------------------------
def update_skill_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@skill_window.active = false
@command_window.active = true
return
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
elsif Input.trigger?(Input::C)
case @selection_mode
when "Use"
@skill = @skill_window.skill
if @skill != nil
@actor.last_skill_id = @skill.id
end
if @actor.skill_can_use?(@skill)
Sound.play_decision
determine_skill
else
Sound.play_buzzer
end
when "Remove"
return Sound.play_buzzer if @skill_window.skill.unremovable?
# Actor Remove Array
actor_remove = @skill_window.skill.removable_by?
# If Skill removal by character is not false
if actor_remove != false
return Sound.play_buzzer if !actor_remove.include?(@actor.id)
end
Sound.play_decision
@skill_window.active = false
@command_window.active = false
@command_window.visible = false
@prompt_window.index = 1
@prompt_window.visible = true
@prompt_window.active = true
return
end
end
end
end
By adding these things to a skills note box you will prevent removal.
UNREMOVABLE
The above will prevent removal by all characters.
REMOVABLE_BY: # # # # #
# = Actor ID by the database.
The above will prevent removal of the skill unless it's ID is included in the notebox.
Example:
REMOVABLE_BY: 1 2 3
The example above means that only actors 1 2 and 3 can remove the skill.
Enjoy and have a nice day.