#============================================================================ # Skill Trees Ace v2.0 / Config # By Emerald # HEAVILY inspired by Basic(?) - Skill Trees of Awesome by Leongon #---------------------------------------------------------------------------- # You're free to use the script for any game, as long as you give credits #---------------------------------------------------------------------------- # Version History # 0.5 -> Started the script. Added all basic functions. However, as of now # requirements aren't shown in the info window. # 0.6 -> Bug fixes for leveling skills and information window. # 0.6b-> Yet another bugfix. # 1.0 -> Added more customization on how to display skill levels on their icons. # Also added an option which, if the menu command is used, allows you to # select an actor first. # 1.0b-> Small glitch fixed regarding switching between actors. # 1.0c-> 'nother small glitch fixed regarding switching between actors. Also # fixed a mistake made in previous version. # 1.0d-> Changed something regarding forgetting previously learned skills, to # avoid problems. # 1.1a-> Bugfix time. Solved a few issues. # 1.1b-> Bugfix patch #2. Possible first version without window bugs... # 1.1c-> Bugfix patch #3. Fixed a slight problem with the requirements. # 1.1d-> Bugfix patch #4. Fixed another slight problem with the requirements. # 1.1e-> Bugfix patch #5. Fixed yet another problem with the requirements and # also made the skill tree selection box disappear as soon as the scene # starts. # 1.2a-> Changed how almost all the methods in Game_Actor where structured. # Removed some "skills with 1 level" issues in the process. Also split # skill learning up in 3 categories, changeable with LEARN_MODE. # Removed a few tree skill reset related bugs too. # 1.2b-> Small typo fix. Also fixed an issue with leveling skills in LEARN_MODE # 1 and 2 in which an already learnt skill would accidentally be forgotten. # 1.2c-> Fixed an issues in which an wrong actor learned the selected skill and # used up his/her points and an issue where the skill trees selection # window would be activated while the skill tree window should be active. # 1.3 -> Added an option to make trees based on class ID instead of actor ID. # 1.4a-> Made fixes for the standard config, a deleted portion of the script, # switching between actors and the trees selection window. Also added # the requirements to the standard info window. # 1.4b-> Small bugfix for cursor input. # 1.4c-> Added TP cost display. Also solved a small bug regarding switch # requirements display. Also fixed a small bug with actor IDs. # 1.5a-> Fixed requirements display of tree skills (the required used information # of the skill at its final level when its level was 0). # Also added the ability to the standard window to scroll the descriptions. # This allows you to use WAAAAY longer descriptions, they even beat the # regular help window ^^. # 1.5b-> Fixed a bug which didn't erase older skills upon leveling them. # 1.5c-> Added some precaution methods for when an actor doesn't have skill trees. # 1.5d-> Fixed a small bug regarding scrolling text and next level display. # 2.0 -> Heavy clean-up of the script, classes instead of actors now function properly. #---------------------------------------------------------------------------- # This is a script which I felt very needed for games where character # customization is important. Note that this is a pretty hard to use script, # so read the instructions thoroughly! # # INSTRUCTIONS: # # Just as always, put this script between Бе Materials and Бе Main.... If we # scripters just got a penny for everytime we say this... # # The rest of the instructions are seperated in different sections. Read them # thoroughly!! # # Information near the parts of the config where they matter: # 1. Standard Module Constants * note that all the vocab for the requirements is # still below Section 6 * # # 2. Tree Points Table # 3. Objects # 4. Trees # 5. Trees Per Actor # # Information in the instructions: # 6. Script Calls and others # # Information for the information window can be found at the bottom of the # configurations! #---------------------------------------------------------------------------- # SECTION 6 / SCRIPT CALLS AND OTHERS #---------------------------------------------------------------------------- # To add Tree Points, use: # $game_actors[actor_id].tree_points += x # $game_actors[actor_id].total_tree_points += x # Where actor_id is the id of the actor for which the skill_points are meant # and x is the amount received. Note that the total_tree_points should also # receive the SAME amount as it is a variable used when RESETING TREES!! # # To add Tree Points to individual trees, use: # $game_actors[actor_id].tree_points -= x # $game_actors[actor_id].points_per_tree[tree_id] += x # Where actor_id has the same meaning as above, tree_id is the id of the tree # to add the points to and x is the amount of ppoints. The tree_points is used # in order to prevent adding points which the actor has just gained. Else, use # $game_actors[actor_id].total_tree_points += x. # # To reset a tree, use: # $game_actors[actor_id].est_reset_tree(tree_id) # $game_actors[actor_id].est_reset_all_trees # The first is for only a single tree, the second for ALL trees. For tree_id, # put the ID of the tree to reset. # # $game_actors[actor_id].est_skill_maxed?(skill_object, tree_id) # to check if the actor with actor_id has maxed the SKILL OBJECT with skill_object # as IDENTIFIER. Tree_id is the tree containing the SKILL OBJECT. # # $game_actors[actor_id].est_skill_level(skill_object, tree_id, different_trees_too?) # this returns the skill level of the SKILL OBJECT with skill_object as identifier. # tree_id is the ID of the tree containing the SKILL OBJECT. If different_trees_too? # is set to true, the actor may have learned the skill in a different tree for # the skill level to go up by 1. # # Use SceneManager.call(Scene_SkillTrees) to call the Skill Trees scene. # # INFORMATION_WINDOW # This script always shows a window to the right of the tree. You can edit the # contents of this window at the end of the configurations. HOWEVER, you need # to be able to script to do this!! # #---------------------------------------------------------------------------- # REQUIREMENT VARIABLES #---------------------------------------------------------------------------- # POINTS_REQUIREMENT_1 and POINTS_REQUIREMENT_ELSE # Text to display when skill points are required ("points" requirement). # _1 is the singular form, and _ELSE the plural. # [_points] will be replaced by the required amount of points, so # "Finally, [_points] points" with the requirement ["points", 7] becomes # Finally, 7 points # # POINTS_IN_TREE_REQUIREMENT_1 and POINTS_IN_TREE_REQUIREMENT_ELSE # Works the same as POINTS_REQUIREMENT, only for the "tree_points" requirement. # An additional parameter for this string is [_tree] which will be replaced by # the name of the tree in which the player should have the set amount of points. # So "Have [_points] points in [_tree]" with ["tree_points", 0, 15] becomes # Have 15 points in Ubar Tree # # SKILL_AT_LVL_REQUIREMENT_1 and SKILL_AT_LVL_REQUIREMENT_ELSE # Works the same as POINTS_IN_TREE with [_tree] being replace by the name of # the required skill (at its current level), [_skill]. # This string is for "tree_skill_level". # # LEVEL_REQUIREMENT # All the strings for every possible case with "level". The sign corresponds # to case in the "level" requirement. Only constant is [_level], which is # obviously replaced by the required level. # # ["level", "!=", 5] with standard settings gives: # Level anything but 5 # # SKILL REQUIREMENT # String for "skill" requirement. Only constant is [_skill], which is replaced # by the skill's name. # "[_skill] learned" with ["skill", 1] and skill 1 called Black End gives: # Black End learned # # SWITCH_REQUIREMENT and VARIABLE_REQUIREMENT # These two work exactly the same, with the exception of the constants. # The both have [_id], which is replaced by the ID of the switch/variable, but # variables also have [_var] which becomes the amount according to the # requirements (which the variable must be equal to, or whatever). # Every sentence is according to their ID, and if their ID is missing, the # first one will be used (0 => ...), which is usually "Something must have # happened..." #---------------------------------------------------------------------------- # HEAVILY inspired by Basic(?) - Skill Trees of Awesome by Leongon #---------------------------------------------------------------------------- # If you have any issues with this script, contact me at # http://www.rpgmakervxace.net/index.php?/ #============================================================================ # # CONFIGURATION # #============================================================================ module EME module SKILL_TREES #===================# # REGARDING # # MENU # #===================# USE_MENU_COMMAND = true # If set to true, a command in the menu will appear which links you to the Skill Trees scene. MENU_VOCAB = "Skill Trees" # Name of the menu command. Only use if USE_MENU_COMMAND is true. FIRST_SELECT_ACTOR = true # Forces the player to pick an actor when entering the scene from the menu. #===================# # REGARDING # # NFORMATION WINDOW # #===================# TREE_POINTS_VOCAB = "SP" # Name of the points which you can use to level skills. MP_COST_VOCAB = "MP Cost" # Name of the MP Cost of the skill. TP_COST_VOCAB = "TP Cost" # Name of the TP Cost of the skill. CURRENT_TREE_POINTS_VOCAB = "SP in " # Text which is displayed after the amount of skill points which have been spent in the current tree. SKILL_LEVEL_VOCAB ="Skill Level" # Name of the skill levels. REQUIREMENTS_VOCAB = "Requirements" # Title of the requirements block. POINTS_REQUIREMENT_1 = "[_points] Skill Point" POINTS_REQUIREMENT_ELSE = "[_points] Skill Points" POINTS_IN_TREE_REQUIREMENT_1 = "[_points] SP in [_tree]" POINTS_IN_TREE_REQUIREMENT_ELSE = "[_points] SP in [_tree]" SKILL_AT_LVL_REQUIREMENT_1 = "[_points] SP in [_skill]" SKILL_AT_LVL_REQUIREMENT_ELSE = "[_points] SP in [_skill]" LEVEL_REQUIREMENT = { "=" => "Level equal to [_level]", ">" => "Level higher than [_level]", "<" => "Level below [_level]", ">=" => "Level at least [_level]", "<=" => "Level not higher than [_level]", "!=" => "Level anything but [_level]" } SKILL_REQUIREMENT = "[_skill] learned" SWITCH_REQUIREMENT = { 0 => "Something must have happened...", 1 => "Must have eaten the pizza skill" } VARIABLE_REQUIREMENT = { 0 => "Something must have happened...", 1 => "Collected [_var] orbs" } PIXELS_SCROLL_PER_FRAME = 1 # The pixels for the description of skills to scroll per frame. Note that one second equals 60 frames. FRAMES_TILL_SCROLL = 120 # The amount of frames to wait until the descriptions of skills start scrolling. DISPLAY_NEXT_LEVEL = true # If set to true, the information of the skill at its next level will be shown. So, if the Skill's Level is 1 the information of the Skill at level 2 will be shown. # Can be replicated with the multiple tabs add-on. LEVEL_X = 212 # Horizontal position of the level vocab in the information window. SP_X = 212 # Horizontal position of the skill points vocab in the information window. COST_X = 136 # Horizontal position of the skill cost vocab in the information window. #===================# # REGARDING # # SKILLS AND POINTS # #===================# LEVEL_DISPLAY_TYPE = 2 # How the levels of the skills are displayed on their icons. # 0 = No display. # 1 = Current level only. # 2 = Current level and max level. TABLE_TREE_POINTS = false # Gain points according to a table. See Tree Points Table for more info. INDIVIDUAL_LEVEL_POINTS = false # Do the actors gain individual amounts of Tree Points on level up, yes or no. Doesn't apply for TABLE_TREE_POINTS. =begin To use the above variable, its value has to be changed to a Hash with keys for all the actors that should have their individual setting, for example: INDIVIDUAL_LEVEL_POINTS = { 0 => 2, 1 => 3, } Actors whose ID is not in the Hash will use the value for 0 instead. =end TREE_POINTS_PER_LEVEL = 2 # Amount of Tree Point received on level up. Make it an # array ( [] ) with the amounts according to actor IDs if INDIVIDUAL_LEVEL_POINTS # is true. NOTE THAT the first element is for actor ID 0, NOT 1!!! REMOVE_POINTS_ON_LEVEL_DOWN = true # If set to true, points will be removed from the current amount of Tree Points if the actor's level goes down. # BEST USED IN COMBINATION WITH RESETS!! LEARN_MODE = 1 # Affects how you can gain skill levels. If 0, you must have learned # the skill by putting a point in it in the same tree. If 1, you must have learned # the skill by putting a point in it in any tree. If 2, you can also have learned # the skill outside of skill trees. CLASSES_INSTEAD_OF_ACTORS = false # Affects if trees are based on actors or on classes. false for # actors, true for classes. NOTE THAT, if you change it to classes, Trees_Per_Actor # don't work on actor_ids, but on class_ids. Also note that if an actor changes # class, you could best use a reset to make sure the player has all the points # back and hasn't learned skills which aren't in the new trees. Ask for help # if you don't know where to use the reset. #---------------------------------------------------------------------------- # SECTION 2 / TREE_POINTS_TABLE #---------------------------------------------------------------------------- # This section contains tables with points which actors gain on level up if # TABLE_TREE_POINTS is set to true. # # The table 0 => [...] is for every actor WITHOUT an individual table. Else, # the key (key => [...]) should be equal to the actor_id. # # The values within the table are the amount of tree points gained for every # NEXT LEVEL!! So the first amount is gained upon reaching level 2, the second # amount upon reaching level 3 etc. #---------------------------------------------------------------------------- Tree_Points_Table = { 0 => [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 1 => [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3] } #---------------------------------------------------------------------------- # SECTION 3 / OBJECTS #---------------------------------------------------------------------------- # Probably the hardest one... # In this section, you create the objects that make up a tree. These can be # either skills, or 'arrows'. Arrows are just icons which will be grayed out # if their child skill is unavailable. # # Syntax: # ARROWS # Identifier => ["arrow_object", icon_index, child_skill] # Identifier = a 'name' to easily identify the object. It is used to build trees # in the next section, and therefore must be unique. However, it can be whatever # you want it to be. Even an array. # # "arrow_object" = the type of the object. Must be exactly "arrow_object" if you # want to make it an ARROW OBJECT. # # icon_index = INDEX of the ICON that is used by the object. # # child_skill = SKILL OBJECT which determines if this arrow should be GRAYED OUT # or NOT. Use the identifier of the SKILL OBJECT as value for this one. Note that # required amount of points doesn't count! (at least, not the first one) # # # SKILLS # Identifier => ["skill_object", [skill_1, skill_2, etc...], [requirements_first_skill], [requirements_second_skill], etc.....] # Identifier = exact same as for the ARROW OBJECTS. # # "skill_object" = exact same as "arrow_object", but identifies SKILL OBJECTS. # # skill_1, 2, etc... = the IDs of the SKILLS at this object's different LEVELS. # can be as many as you want. Icon will be taken from the skill, and is grayed # out if requirements don't apply (except for the first COSTS requirement). # # requirements_first_skill = an ARRAY with the different REQUIREMENTS for the # skill which belongs to this requirements. The requirements are respective with # the skills. So: # [skill_1, skill_2, skill_3], [requirements_skill_1], [requirements_skill_2], [requirements_skill_3] # # You can have as many of the following types of requirements as you want, but # you MUST have at least one of the first type: # # Tree Points, ["points", amount_needed] # amount_needed = amount of points required. # NOTE that the VERY FIRST of this type of requirements is the cost to level the # skill. # # Points in a certain tree, ["tree_points", tree_id, points_needed] # tree_id = the tree_id of the tree in which the actor must have the needed # points. If it is the first tree, tree_id = 0, second tree, tree_id = 1, third # tree, tree_id = 2. # points_needed = the points required in the specified tree. # # Skill Object at certain level, ["tree_skill_level", skill_object, required_level] # skill_object = the identifier of the object which should have the required level. # required_level = can't be more obvious. 0 is unlearned. Note that the skill level # should be equal to OR HIGHER THAN this value. # # Required level, ["level", case, required_level] # case = in which manner should the level be required? "=" (equal to), ">" # (greater than), ">=" (greater than, equal to), "<" (less than), "<=" (less than # equal to), "!=" (everything BUT) # # Skill learned, ["skill", skill_id] # skill_id = ID of the skill which the actor must have learned. # NOTE THAT THIS ONE can also be skills NOT learned by skill trees!! AND IT'S A # SINGLE SKILL! # # Switch on certain value, ["switch", switch_id, key] # switch_id = again, obvious.... # key = either true or false, the switch must be equal to this. # # Variable, ["variable", variable_id, case, amount] # variable_id = ... # case = same cases as with REQUIRED LEVEL. #---------------------------------------------------------------------------- Objects = { # Arrow Objects "arrow_down_begin" => ["arrow_object", 18, "test_skill_1"], "arrow_down_end" => ["arrow_object", 18, "test_skill_2"], :example_arrow => ["arrow_object", 18, "phantom_skill"], # Skill Objects "ubar_skill" => ["skill_object", [1], [["points", 1], ["tree_points", 0, 1], ["tree_points", 1, 1], ["tree_points", 2, 1]]], "pizza_skill" => ["skill_object", [2, 3, 4], [["points", 1]], [["points", 1], ["level", "!=", 99], ["points", 1], ["tree_points", 0, 1], ["tree_points", 1, 1], ["tree_points", 2, 1]], [["points", 5], ["tree_skill_level", "ubar_skill", 1], ["switch", 1, true]]], "test_skill_1" => ["skill_object", [26], [["points", 1]]], "test_skill_2" => ["skill_object", [27, 28], [["points", 1]], [["points", 1], ["level", "<", 15]]], "phantom_blade" => ["skill_object", [126, 127, 128, 129], [["points", 1]], [["points", 1], ["level", ">=", 4]], [["points", 1], ["level", ">=", 7]], [["points", 1], ["level", ">=", 10]]], #"phantom_blade" => ["skill_object", [127, 128, 129], [["points", 1]], [["points", 1]], [["points", 1]]], "phantom_skill" => ["skill_object", [1], [["points", 5], ["tree_skill_level", "phantom_blade", 2]]] } #---------------------------------------------------------------------------- # SECTION 4 / TREES #---------------------------------------------------------------------------- # Trees are build up from rows and identifiers. Note that every row has 7 # spots for objects. Doesn't matter what the objects are. # # Syntax: # Identifier => [object, object, object, object, object, object, object, # object, object, object, object, object, object, object] # Identifier = the 'name' of the tree. This must be individual and is used to # sort the trees for the actors(next section). Can be a string, number, symbol, # whatever.... As long as it is identical and you use the exact same identifier # in the next section. # # object = the IDENTIFIER of the object. Every tree has rows of 7 OBJECTS. The # amounts of rows if infinite. If you want to leave an spot blank, use nil. #---------------------------------------------------------------------------- Trees = { "test_tree" => ["phantom_blade" , :example_arrow, "phantom_skill", nil, nil, nil, nil], "supar_tree" => ["test_skill_1", "arrow_down_begin", "arrow_down_end", "test_skill_2", nil, nil, nil], "cute_tree"=> ["test_skill_1" , nil, nil, nil, nil, nil, nil, nil, "arrow_down_begin", nil, nil, nil, nil, nil, nil, nil, "arrow_down_end" , "test_skill_2", nil, nil, nil] } #---------------------------------------------------------------------------- # SECTION 5 / TREES PER ACTOR #---------------------------------------------------------------------------- # The eassiest out of them all. Note that EVERY ACTOR should have an array # here. # # Syntax: # Actor_id => [tree_1, tree_2, tree_3, "tree_name_1", "tree_name_2", "tree_name_3"] # Actor_id = obvious.... # # tree_1...3 = the IDENTIFIER of the tree as used in Trees. So, can be a string, # variable, symbol, whatever.... Leave nil for no tree. # # "tree_name_1...3" = NAME of the tree as displayed within the scene. Must be # a string. #---------------------------------------------------------------------------- Trees_Per_Actor = { 1 => ["supar_tree", "cute_tree", "test_tree", "Ubar Tree", "POWAR", "Hello"], 2 => ["test_tree", "supar_tree", nil, "Ubar Tree 2", "MOAR", ""], 3 => ["supar_tree", "test_tree", "cute_tree", "wow", "it's", "epic"] } end end