Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skil Sorting
#1
Skill Sorting
by hima
Aug 1 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Features
  • 3 ways to sort your skill 1.) By ID 2.) By skill type in the description or 3.) By icon.
  • Pretty easy to customize.
Screenshots

Example of sorting by icon.

[Image: skill_sort.jpg]



Script

Code:
#==============================================================================
# * Hima's Skill Sorting v. 1.0
#------------------------------------------------------------------------------
#     This script will allow you to sort skill in skill selection screen in the way
#    you want. Three keys of sorting are offered in this script, which are skill type in description,
# skill icon, or id - which is RMXP default key sort.
#
# contact : ninomiya_mako@hotmail.com
#==============================================================================
module HIMA_SKILLSORT
    #--------------------------------------------------------------------------
  # - Customize Point -
    # SORT_TYPE     - Choose how would you like to sort skills. NAME means that skill type is shown in the descriptiion
    #                         - ICON mean skill type is shown by skill icon. And ID, if you want to sort it by default.
    #    SKILL_TYPE - This will be used if SORT_TYPE is NAME. Input the name of skill's types in the oder of
    #                             how you would like to sort skills.
    #    ICON             - This will be used if SORT_TYPE is ICON. Input the icon picture name in the order of how
    #                             you would like to sort skills.
  #--------------------------------------------------------------------------
    SORT_TYPE    =    "NAME"
    SKILL_TYPE = ["[Attack]","[Support]","[Etc.]"]
    SKILL_ICON = ["044-Skill01","045-Skill02","046-Skill03","047-Skill04","048-Skill05","049-Skill06","050-Skill07"]
end

class Game_Actor < Game_Battler
    def skill_sort
        temp_array =    []
        case HIMA_SKILLSORT::SORT_TYPE
          when "NAME"
            size = HIMA_SKILLSORT::SKILL_TYPE.size
            when "ICON"
            size = HIMA_SKILLSORT::SKILL_ICON.size
            when "ID"
                return
        end #case
        for i in 0..size
            for j in 0..@skills.size
                skill_id = @skills[j]
                case HIMA_SKILLSORT::SORT_TYPE
                    when "NAME"
                        pass_condition = $data_skills[skill_id].description.include?(HIMA_SKILLSORT::SKILL_TYPE[i])
                    when "ICON"
                        pass_condition = $data_skills[skill_id].icon_name == (HIMA_SKILLSORT::SKILL_ICON[i])
                end #case
                temp_array.push(skill_id) if pass_condition
            end
        end
        @skills = temp_array.clone
    end
    
    alias the_original_learning_skill learn_skill
  def learn_skill(skill_id)
    the_original_learning_skill(skill_id)
    skill_sort
  end
end


Instructions
- Copy and paste this script above Main, name it "Hima_Skill_Sorting"
- Change keyword in "SORT_TYPE" to sort in the way you want as follows:
1.) NAME : to sort skill by special tag in description
2.) ICON : to sort skill by icon
3.) ID : to sort skill by id, this is rmxp default.

- SKILL_TYPE : group of tag or keyword that must be included in each skills description, if you choose NAME in the above.



Code:
SKILL_TYPE = ["tag 1","tag 2","tag 3,...]



- SKILL_ICON : name of icon file, in the order that you want to sort them.

Compatibility
No known issues.

Terms and Conditions
If you use this script or post it elsewhere, please give me credit in your game. I'd be happy to know if someone really use my script :)
}




Users browsing this thread: