Skill Limit

Discussion in 'RGSS3 Script Requests' started by Greensburg, Aug 26, 2013.

  1. Greensburg

    Greensburg Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    Spanish
    Sorry to bother you guys, but I ran into a little inconvenience today.

    I was using the Crystal Engine Move Limit script and it worked wonders...except that it made my game crash sometimes after entering a 2nd forced battle, the weird part being that it didn't happen every time I played, which makes it all the more annoying. It's probably due to a conflict with other scripts (I have some YEA and Yanfly going on under it), but I chose to get rid of that one since it required me to install it's own engine (it isn't a standalone).

    Browsing through the web I found this neat little snippet...but for vanilla VX >_<.

    #----------------## FC Skill Limit ## Version 1.0 ##------------------------------------------------------------------------------## This script allows you to limit the size of your actors' skill sets. When an# actor knows more than a specified number of skills at the end of a battle,# a new window appears, prompting the actor to forget enough skills to bring him# back within the limit.## Version History:# 1.0 - 01/09/2011 - Started and finished.## Known Bugs:# - I have not tested this with levels or skills you gain outside of battle.# Chances are, learning too many skills outside of battle will not cause # anything to happen immediately, but the next time you win a battle, it might# ask you to delete some.# - I have also not tested this script with any other script, other than the # defaults. At all. Sorry if there are any problems.## Future Updates:# - Make it work for non-battle levels and skills.# - Compatibility with other scripts, should there be issues.## Overwrites:# - Game_Actor: display_level_up# - Scene_Battle: battle_end## Contact Info:# - Send me an email at fridgecrisis@gmail.com if you have questions or # comments.##------------------------------------------------------------------------------## Instructions#------------------------------------------------------------------------------## Paste into a new page in the Materials section. The only custom pieces of this# script are listed and described in the FC::SKLM section below. Edit them to # your liking.#------------------------------------------------------------------------------#module FC module SKLM SKILL_SIZE = 4 # This is the maximum number of skills you want your actors to be have. VOCAB_SKILLS = "skills" # Change this if you want skills to be called something else, like "moves" # or "abilities". endend#------------------------------------------------------------------------------## STOP EDITING!!!#------------------------------------------------------------------------------#class Game_Actor < Game_Battler def display_level_up(new_skills) $game_message.new_page text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level) $game_message.texts.push(text) for skill in new_skills text = sprintf(Vocab::obtainSkill, skill.name) $game_message.texts.push(text) if self.skills.size > FC::SKLM::SKILL_SIZE text = sprintf("But #{self.name} already knows #{FC::SKLM::SKILL_SIZE} #{FC::SKLM::VOCAB_SKILLS}!") $game_message.texts.push(text) $game_message.new_page end end end endclass Scene_Battle < Scene_Base def battle_end(result) if result == 2 and not $game_troop.can_lose call_gameover else $game_party.clear_actions $game_party.remove_states_battle $game_troop.clear if $game_temp.battle_proc != nil $game_temp.battle_proc.call(result) $game_temp.battle_proc = nil end unless $BTEST $game_temp.map_bgm.play $game_temp.map_bgs.play end for i in $game_party.members.reverse if i.skills.size > FC::SKLM::SKILL_SIZE $scene = Scene_SkillSwap.new(i) swapping = true end end $scene = Scene_Map.new unless swapping == true @message_window.clear Graphics.fadeout(30) end $game_temp.in_battle = false end endclass Scene_SkillSwap < Scene_Base def initialize(actor) @actor = actor end def start @help_window = Window_Help.new @skill_window = Window_Skill.new(0, 112, 544, 304, @actor) @skill_window.active = true @skill_window.help_window = @help_window @yesno_window = Window_Command.new(100, ["Yes", "No"]) @yesno_window.openness = 0 @yesno_window.active = false @yesno_window.x = 222 @yesno_window.y = 168 @message_window = Window_Base.new(0, 56, 544, 56) @message_window.create_contents @message_window.contents.draw_text(0, 0, 528, 24, "#{@actor.name} has more than #{FC::SKLM::SKILL_SIZE} #{FC::SKLM::VOCAB_SKILLS}! Choose #{@actor.skills.size - FC::SKLM::SKILL_SIZE} to forget.", 1) create_menu_background end def terminate @help_window.dispose @skill_window.dispose @yesno_window.dispose @message_window.dispose end def update @help_window.update @skill_window.update @yesno_window.update @message_window.update if @yesno_window.active update_yesno_window elsif @skill_window.active update_skill_window end end def update_yesno_window if Input.trigger?(Input:: Sound.play_cancel @message_window.create_contents @message_window.contents.draw_text(0, 0, 528, 24, "#{@actor.name} has more than #{FC::SKLM::SKILL_SIZE} #{FC::SKLM::VOCAB_SKILLS}! Choose #{@actor.skills.size - FC::SKLM::SKILL_SIZE} to forget.", 1) @skill_window.active = true elsif Input.trigger?(Input::C) Sound.play_decision if @yesno_window.index == 0 @actor.forget_skill(@skill.id) process_end elsif @yesno_window.index == 1 @message_window.create_contents @message_window.contents.draw_text(0, 0, 528, 24, "#{@actor.name} has more than #{FC::SKLM::SKILL_SIZE} #{FC::SKLM::VOCAB_SKILLS}! Choose #{@actor.skills.size - FC::SKLM::SKILL_SIZE} to forget.", 1) @skill_window.active = true end @yesno_window.active = false @yesno_window.close @yesno_window.index = 0 end end def update_skill_window if Input.trigger?(Input::C) Sound.play_decision @skill = @skill_window.skill @skill_window.active = false @yesno_window.active = true @yesno_window.open @message_window.create_contents @message_window.contents.draw_text(0, 0, 528, 24, "Forget #{@skill.name}?", 1) end end def process_end if @actor.skills.size > FC::SKLM::SKILL_SIZE @message_window.create_contents @message_window.contents.draw_text(0, 0, 528, 24, "#{@actor.name} has more than #{FC::SKLM::SKILL_SIZE} #{FC::SKLM::VOCAB_SKILLS}! Choose #{@actor.skills.size - FC::SKLM::SKILL_SIZE} to forget.", 1) @skill_window.refresh @skill_window.active = true return end for i in $game_party.members if i.skills.size > FC::SKLM::SKILL_SIZE $scene = Scene_SkillSwap.new(i) return end end $scene = Scene_Map.new end end#------------------------------------------------------------------------------## END#------------------------------------------------------------------------------
    (credits to Fridgecrisis)

    So...I guess I'm asking for a conversion of some sort? I've tested it and the only thing it does so far is informing me I have over X skills after the battle ends, not doing anything to replace them.
     
    Last edited by a moderator: Aug 26, 2013
    #1
  2. Greensburg

    Greensburg Veteran Veteran

    Messages:
    32
    Likes Received:
    6
    First Language:
    Spanish
    Bump
     
    #2
  3. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,068
    Location:
    Toronto
    First Language:
    English
    I think you should ask for help with your crashing problem rather than asking someone to write a completely new script.
     
    #3
  4. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    I believe there's another Ace skill limit script in the master list...
     
    #4

Share This Page