Help - Search - Members - Calendar
Full Version: Basic? - Skill Trees - of Awesome v1.22 (07-Jul-2011 chinese version)
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
Pages: 1, 2, 3, 4, 5, 6
leongon
vx script skill tree talent system

Basic Skill Trees of Awesome

Version: 1.22
Author: Leongon
Release: July 04 2010
Last Actualization: February 19 2011
Exclusive: at RPG RPG Revolution
Requires: Some experience, this is not noob friendly. Being able to read instructions.

Chinese translation of 1.22v by DeathKing: Thread - Script
(Thank you DeathKing for making this for chinese, and for giving me proper credit there)


Introduction
Finally the most common feature from the MMORPGs now into VX: Skill Trees. I'm very proud of this one.

This script allow you to create talent skills that can be upgraded by spending points on a unique skill-tree for each actor.
wink.gif

Features
  • Highly configurable system.
  • Choose which classes can access each tree.
  • Up to three trees per hero.
  • Seven columns with unlimited rows object tree grid-like system.
  • Skills with many levels as you want.
  • Skills can require actor minimum level, and other skill with a minimum amount of points, before enabling it to spend points on.
  • Choose hero level where start gaining skill points on.
  • Setup script works very like Tankentai's action sequences building.
  • Easy commands for use in event script calls, that allow to reward extra skill points, to open directly an actor's skill tree, to reset trees, and more... all with three ways of targeting the actor: by party position, by name and by actor database index.
  • Easy managing of tree system's way-o-work and graphics.
  • Arrows file that you can edit as you like.
  • And lot more! Check the History section below for the latest features.

Screenshot

More screenshots, actually games.
The Scheme


A game from vinilodeon



Script
I heavily recommend you to play the demo and pick the things from it while you see how everything works. But if you are skilled then take directly the script and files here.
Main script is splitted in two:
Setup v1.22:
Click to view attachment
Core v1.22:
Click to view attachment
Arrows file:
This must be named SkillTree.png inside the Graphics/System folder of your proyect. Edit it at your will, but keep the positions or you'll need to rearrange the list in the script too. Note that you can add more arrows to it below, just don't change the width of the image.
Click to view attachment
Background Images:
If you keep Imageback Mode enabled, you must have images matching the unique names of your trees in Graphics/System folder.
ARMS.png --------------------- MAGE_FROST.png
Click to view attachmentClick to view attachment

DEMO 1.22 is up.
More than a demo... A Tutorial Game:
(Includes my newer Main Menu Manager v1.1 script)
Download Skill Trees Tutorial Game v1.22

Customization
At the beginning of the Setup script, you can handle the visual and working aspects of the system. Each option is described there.
Read the Setup script's instructions!
You get the best results building the tree like this:
Grid Example

johnnydangerous66 courtesy.

Or also you can use only the arrow's end and have four skills per row, Is up to you.


Compatibility
This is made to work with 24x24 icons, so you can get trouble if using different icon sizes.
Skill points gaining may not work correctly if you use a script that directly changes default functions for actor level up or actor skills learning as this system work over those.
Skill Trees itself should not collide with anything else nor any other script.

Including access to skill trees from the menu:

Option 1 - For default main menu. But you hardly will be using only this script that adds more commands to the main menu, so better jump to next option...
Click to view attachment
Option 2 - For my Main Menu Manager script I added the code already, just remove the # there.

Option 3 - For Sky's Menu Edit you can use this code:
CODE
[ST_setup::ST_menu, Scene_SkillTree.new(@index), true],

Option 4 - For Main Menu Melody you can use this code in the "Lunatic Mode - Menu Command - Imported Scripts" section:
CODE
:skilltree => [   nil,    nil,  true, nil, ST_setup::ST_menu, "Scene_SkillTree"],
...and put :skilltree in the "Menu Command" section.

Ask me if you need guidance for using this in another menu management script.

Installation
Install Core script below Setup script, both above main. Put the SkillTree.png image in Graphics/System folder, read carefully each section of the Setup script and create your skill trees.

History
v1.0
- Release.
v1.1
- Changed skill_points to st_points to prevent issues with other scripts.
- Added actor level in data window.
- Added full management of language used.
- No requirements shown if skill is maxed.
- Now can require points spend on same tree. (WoW - like)
- Now can use images on main tree background. (WoW - like)
- Now can scale actor level requirement with each point spent on skill. (Diablo 2 - like)
- Now can require two parent skill objects. (Diablo 2 - like)
v1.11
- Bug Fix.
v1.2
- Included the list of commands in the Setup script header.
- Now "ST_command::show" can define if exit to menu, or force exit to map, for better eventing possibilities.
- Now can show skill level over the icons.
- Now can ask for confirmation on spending points.
- Now can disable gaining skill point on level up.
- Now can switch between 8 different preset windows distribution with a game-variable.
- Now can switch between 3 different cursor system for the tree selection. Animated, steady or no cursor but name colouring.
v1.21
- Bug fix.
v1.22
- Minor bug fix.
- Now allow actors without skill trees in your party.
- Optional pop-up warn window for actors without skill trees.

Please report any bug you find.

Terms and Conditions
Free use on commercial and non-commercial proyects, just give credit.
Don't post the script, the demo or the system files outside www.rpgrevolution.com
If you want to share this, use a link to here.

Credits
Leongon

F.A.Q.
Teh Frequently Asked Questions of Awesome.
Q: I get a "undefinied method '[]' for nil:NilClass" error, what's wrong?
A: Check if you stated an object name in the skill tree building section that does not exist in the arrow or skill's object building sections.

Q: Why I can only spend one point in a skill even when it's max level is more than 1?
A: Each level of each skill object is a different skill in the database. If you added only the first ID level for a skill object, you'll be maxing it at level one even if you stated that it's max level is more than one.

Q: Why I can't spend any point in certain skill?
A: Make sure you not set the skill as it's own parent requirement to be learned.

Q: But is not better to make a growing curve with only one base skill?
A: I wanted each skill level to be able to do unique new things for my game, and some things like common events, states, etc. can't be "curved", and setting that data for each level of each skill object will end into excessive data input for this script. I prefer database burning this time.

Q: Only three skills per row is the only possible for this script?
A: No. You have seven slots per row to put a skill, arrow or an empty space on. How you use it is up to you. If you use only arrow ends you can put four skills per row, or if you don't use horizontal or diagonal arrows at all, you can use all seven slots for skill objects.

Q: Why you don't used the skills notefield for this system? You are a fag.
A: To much data to track in a small window like the notefield, I want to leave it for other scripts that need less data input.
Litchi
why would you use tankentai style path control when you already know how to use notetags? that's moving a step backwards, a big step backwards
leongon
And your eventing powers pwn scripts too?

First check all what this script do, all the info that each skill contains for requirements and other skills, and then tell me if is best using notetags or building objects in a setup script.
Litchi
I took a quick look at it already and will still say that notetags would be much better.

Here's a quick example of your [1, nil, 5, 5, 1, 2, 3, 4, 5], example

<skill tree>
reqlvl: 1
dadskill: 0
maxlvl: 5
childreqlvl: 5
idlvl1: 2
idlvl2: 3
</skill tree>

Dont think your all that just because you can script and I cant. We're the ones who use your scripts and we're the ones who care about them since they're vital to our games. it makes more difficult to use by making things ultra complicated like tankentai style action build sequencing.
nighthawk282
So, played through your demo. Very nicely done. Although I'm not sure I enjoyed being stabbed with a pencil. smile.gif I've been toying around with your script for about an hour, and I must say, once I got the hang of what all the commands did, I was thoroughly impressed. I can see that this system could actually become very deep, and I plan to keep playing with it to my heart's content. I have some fairly big ideas for it, we'll see if it can live up to them. Again, well done with the script. smile.gif

@Litchi: I'm not really sure you could equal the full fuctionality of this script using notetags. There's quite a lot here. I mean, if you wanted to attempt it, you could go right ahead, maybe I'm wrong. But I know that I personally don't feel like trying to mimic this script that way, and anyone who wants a skill tree would probably able to navigate their way through the script setup to get the results they wanted. Once you start playing with it, you realize it isn't all that complicated. And I'm no scripter, to clarify. Couldn't script my way out of an empty room. tongue.gif
leongon
@Litchi:
You, for only one skill data and for only one script usage, filled a notetag with 9 lines and you ommited 3 id levels, ommited arrow graphics control, ommited tree objects positioning.

You know how many levels has Diablo II for each tree skill? I thinked a bit on the future, and a bit in the posibilities the users of this will want to reach. And definitively they will not be using only this script, and not only a few skills per tree.

Finally I didn't made it to be like Tankentai's action sequence building, it just end like it. Was the best option for a truck of data that a system like this requires.

@nighthawk282:
You beated me in the demo :s?
Litchi
except the number of lines used for notetags doesn't matter. Theres unlimited lines you can enter in the notetag box.
leongon
You are an idiot if you really want to fill up each skill notefield with all that data, and all the data you ommited, rather than put it all in only one place for a single script system. The limitless of the notefield lines does not make it's window bigger to be able to track high ammount of different data for many different scripts.

Your eventing powers totally pwn scripts Litchi.
SojaBird
Ah nice biggrin.gif
Now I know where you need that help for smile.gif

wink.gif Awsome system for what I can see of the screens!!


Greatzz,
SojaBird.
Litchi
Your totally missing the point.
leongon
I really want to add compatibility with your NMI, hope you can make it auto-use the actor selection soon :3
leongon
If someone extremely noob can't get the hang on how this works, always can use the other similar system that is around here:

http://www.rpgrevolution.com/forums/index....showtopic=40820

Is lot more simple than mine, it has no upgradeable skill levels, limited number of skills, no line graphic customization, only one tree per actor, no easy commands, directly openning of tree only by party member index, no reset, etc... but it uses skill notefield as it does not handle too much data. So I recommend you to use that one if can't handle mine.
Magic Pancake
Hello leongon,

I must admit you created a very awesome script right there. I have only one question:

The script was created for RMVX. Could you please make the script compatible to RMXP? Because this is the best skill-tree-script I have ever seen and it would be a shame if one can not use it on RMXP.

Greetings
Magic Pancake
Kread-EX
You've become really good in a short period of time, you know. I have just two remarks:

- It's a little weird to see two cursors glowing in the tree scene. You change the category with L/R and there is a cursor on the current tab. And at the same time, there is the cursor on the skill icon.
What I did for a skill tree I made is make select the tab first and the skill after. Or you could keep your current system but colouring the tab font or display an icon before the active tab.
It's just that two cursors blinking are a little disturbing.

- It's no big deal, but usually, global variables are used in last resort. You can just share objects between the scene and windows without using them.

Anyway, it's the nicest skill tree I've seen for public use. I think a certain 'scripter' should try to follow your example.
leongon
@Magic Pancake:
Sorry but I don't know XP at all, I just started in RPG maker with VX version a few months ago.

@Kread-EX:
For the two cursors... well, I thinked first about making a selection first and did it, but I don't like how it ended, so changed it to work all at same time. I'll try to change the color of the selected tab if I make other version after 1.1 that is ready, should be nice.

About the global variables... I agree, and I know I'm still doing unnecessary things, and making the script code very dirty. This take about the 100 percent of my actual capability on scripting, and I'm very happy that it WORKS fine for now. As I learn more, maybe can remake them in the future.

Anyway, thank you dude for the advice, and specially for the nice words.



PD: New v1.1 on first post. I don't have more ideas to add, so is the final release until someone came with some nice ideas.
Somel

Hey dude, great script. Really easy to configure too.

Btw, in the demo the images used by the script appear before the battles, i don't know if it is supposed.

As for suggestions, i think it would be nice to have a feature where a skill that requires more than one skill point in order to learn it ( that would allow to more flexibility of the system ).

Kudos.
leongon
Whoa! Thanks for the bug report...
Fixed! Just replace the core script if you don't want to download the demo again..



I'll take note of your suggestion too, along with gaining more than 1 point per level, sound like good additions.
new
how do i make this compatible with KGC Custom Menu Command? i duno how to make it available in the menu.

btw, great scripts.

i just saw that you need to make multiple copies of the skill, i thought they had their own curves when you level them up.
so in the skill database you need to make level 1 frost, level 2 frost, level 3 frost and so on.
leongon
Yup, I saw other systems using only one skill with a curve in damage and Mp, but I made this script for my game, and definitively I'm not using only damage and mp in my skills, so I decided to do it to be each level a new skill that can do unique new things like different state changes, icon, description, elements, common events, etc... Lot of database usage, but is what I need.

I'll see if I can find that KCG script to give you the hint to put this on it. Stay tuned.

<edit>
Well, for what the instructions tell, this should work in "Lunatic Mode - Menu Command - Imported Scripts" section:
CODE
206 => [   nil,    nil,  true, ST_setup::ST_menu, "Scene_SkillTree"],


then put the 206 in "how to set up the MENU_COMMANDS order" section.
new
works now, what you searched was KGC+YF custom menu, hehe. had to switch to that from the orig KGC custom menu.

yeah, i think having no curves for skills would bring more potential to each level up of the skill. curves go for lazy people.

i have a question, do you know any scripts, to increase the number off hits? case for example in my skill tree
it goes from 1 hits, 2 hits, 3 hits. by hits i mean, the skill is animated n times, so for n = 3, like firebolt level 3, the firebolt shoots down 3 times,
or are you suggesting that, since i can make each copy of new skills, i make individual animations for each. is that better?
leongon
I can't understand exactly what you are asking for.
If it's for some function to repeat the skill animation n times, well, is something that this script can't do. This script only manages the learning system, not what the skills do. I don't know any script for that, so try the request forum, maybe someone knows or can make it.
new
what i was trying to say is that the next level of the skills are better done because the script doesnt use curves.
example: fire bolt level 1 base dmg 150 mp cost 6 hit 1 => fire bolt level 1 base dmg 300 mp cost 12 hits 2.
and i was just asking if you know any scripts that increases a skill's target, which ii think i could use yerd custom target skills to increase number of hits of a skill.

is this the line to disable imageback? and set it to false? i get error when i replace that number value with "false"
ST_imageback = 250
leongon
ST_imageback = false ...not "false", but you found a bug. I'll fix it.

Done! Replace only the Core script if you don't want to download the demo again.
new
i have question, how do you make it so learning skills also require items. you know in WoW, or other MMOs, you need to buy skill book from NPC, before you can start putting skill points to it.
leongon
I don't know any game that works that way, so I can't guide you.

This script can work exactly as WoW or almost like Diablo II, I made it with that goal, and in WoW are no book that teach you something in the skill trees. If you have system suggestions make them more detailed please, I have not played every game on earth, you know tongue.gif
new
oh, it wasnt in WoW? how about AION? you buy skill manuals from NPC or stigma stones dropped by mosnters, rather than use skill points, to level up skills in the skill tree. AION has new features not in WoW.

hmm, if its not, its okay. Diablo style is still cool, hehe.
leongon
I don't know those games, but you can make an item with the command to reward skill points.
Use this common event script:
CODE
y = $game_party.last_target_index
ST_command::reward(0,y)

You'll need to set the item Growth Effect to whatever but none, so it can be used.
johnnydangerous66
I'm just posting here to say thank you. I don't think you're getting half the credit you deserve for making this script. This is what people have been requesting since RPG Maker VX (or any RPG Maker for that matter) was released. Every week or so you see someone requesting a "Diablo 2 skill tree script", and usually the only reply they get is a cynical "learn to event!!!!" from a moderator or someone pretending to be a moderator.

This script is thorough (yet simple), easy to customize, and aesthetically pleasing. It's fast and has a very "sleek" feel to it. I like it a lot.

This is a landmark project, and I applaud you. I'm not sure why some of the first comments made here were so snotty...seriously, this is incredible. Your effort is truly appreciated. I for one will be using this script extensively. If I have any suggestions I'll be sure to post them here.

Thank you leongon.
leongon
There are people around that simply are against Tankentai SBS, and for those seeing that this script setup is tankentai-like, turns it into a target to attack. At least that is the main reason to dislike this system, cuz, even if I stated that is "not noob friendly" is definitively not complicated at all.

Thank you for your nice words, Johnny.


PD: I'll be releasing the 1.2 soon, It can show the points spended over the icons, rearrange the windows in eight preset different positions, and a few more things.
FlyingPenguin
I really like this script, but I am having problems with it. I have copied the scripts into my game, set up the skill trees and everything; but when I go into the talents menu to the skill tree, and try and switch the current selected tree, it comes up with the following error:

Script 'Leongon SkillTree Core' line 208: NoMethodError occurred.

undefined method '[]' for nil:NilClass

I tried it in your demo and it works fine, but when I change any of the skill trees, it comes up with this error. Am I doing something wrong? Or could it be a compatibility error? Let me know if you need me to list the scripts I am using in this game.
leongon
Show me a copy of your skill tree setup script.
Legion Saga
One thing I suggest is a Confirmation Window, where if the player chooses a skill to upgrade he will be asked if its he's final decision... that avoids player from pressing confirm button by mistake smile.gif
all in all its a great cool script happy.gif (I'll be using this to my project) Cookiez for you *credits*
johnnydangerous66
QUOTE (Legion Saga @ Jul 22 2010, 09:42 PM) *
One thing I suggest is a Confirmation Window, where if the player chooses a skill to upgrade he will be asked if its he's final decision... that avoids player from pressing confirm button by mistake smile.gif
all in all its a great cool script happy.gif (I'll be using this to my project) Cookiez for you *credits*


This is a great suggestion, and it would only take a few lines of code to accomplish this. Mistakes can be corrected, though, by a calling the script. Perhaps you could have an NPC "reset" everything for a price?

Also, Leo, though it is obvious in your notes, I thought I'd reiterate here for others, with regard to skill-tree setups:

CODE
# There are 7 slots per row, being 1, 4 and 7 for skill objects, while 2,3,5   #
# and 6 are for arrow objects. Rows have no max limit, you have the first one  #
# for skills, next two are for arrows and so.


This means there are designated positions for skills and arrows in any particular tree. It's like a "grid". I overlooked this at first and placed five skills on the same row. This lead to no-method calls that were trying to get names from arrow objects.

A healthy suggestion to your instructions: Prior to editing the script, recommend users to "draw" their grids on some paper, or using a spreadsheet program, or anything. This would give them a visualization of what the tree (or "grid" rather) should look like. They'd just have to remember that at most they'll only have seven columns, with however many rows they need for other skills. I have attached a sample of a 7x7 mock-up skill tree so people can get a visualization of what I mean.

I'll also agree with another poster that the blinking cursor on the skill tree name should instead be "static", just for aesthetic reasons.

Excellent script. Definitely one of the best out there. Tons of possibilities.
leongon
I'm not english native, so giving good and clear instructions is not easy for me. That grid image is perfectly self-explanatory on how the tree must be build, i'll include it on the first post if you don't mind. However, the placing for skill and arrows are only a suggestion, the arrows are made by halves making two to complete one arrow, that leaves space for two complete arrows and three skills per row. If the object data are correct should not give errors even if they are misplaced on the grid, or you use different amount of skills per row, cuz I made the cursor to jump only between skill objects, ignoring arrows and empty spaces.

For the two cursors, well, now are two people agreeing that is ugly, so I'll be changing that, or made it optional.

I like the system to be straight and fast, but I think I can add an optional confirmation window for spending SP, it should not be too hard.

Thanks for your suggestions and support.
FlyingPenguin
Here is my setup script:

CODE
module ST_setup
################################################################################
# * Setup * #
# Basic? - Skill Tree - of Awesome v1.0 #
################################################################################
# Author: Leongon #
# Contact: carlos_gon47@hotmail.com (or PM leongon on the board below) #
# Licence: Free for commercial and non-commercial proyects, just credit. #
# Share: Exclusive for www.rpgrevolution.com #
# If you want to share it outside give a link only, please. #
################################################################################
# This is my very first big non-so-basic script, and I'm very proud of how it #
# got done, almost exactly what I wanted to accomplish when I start writing it #
# about a week ago. #
# ---------------------------------------------------------------------------- #
# As the name says, this script introduces the very popular function from most #
# MMORPGs: Skill Trees, or talent trees if you prefer, for your heroes. #
# #
# You need to work only in this one, the Core manages the info you give here #
# and builds the system. #
################################################################################
# Instructions # #
################ #
# #
# This works pretty much like Tankentai's action sequences building. You'll #
# need to create objects that you must organize at the end in the final trees. #
# I put descriptions and syntax in each sections to help you on understanding #
# how to build your trees. So read each carefully. #
# #
# If you don't understand this, play the Tutorial, is almost a game more than #
# a demo, and it will carry you around all this script posibilities, and teach #
# you how to use them. #
# #
# If you still need guidance, find bugs or have ideas, reply on the thread. #
# I will answer everything that is not already explained here, the thread or #
# in the tutorial, if I'm still around. (One never knows what the life have #
# for fate) #
# #
################################################################################




#------------------------------------------------------------------------------#
# * General Settings * #
# #
# Here you can easily control some of the most direct aspects of visualization #
# and way-of-work of the system. #
#------------------------------------------------------------------------------#
ST_first_skill_point = 1 # Actor lvl where start gaining skill-points at. #
ST_zero_sp_color = 10 # (0-31) Color for zero skill points. #
ST_skillname_color = 14 # Color for selected skill's name. #
ST_vocal = "Skill Points" # Currency name. #
ST_arrow_hue = 0 # (0 - 360) This is the color variance of the #
# arrow's graphics. #
ST_arrow_disabled = 70 # Transparency for disabled arrow objects. #
ST_skill_disabled = 128 # Transparency for disabled skill objects. #
ST_menu = "Talents" # Vocal for the menu selection. Will be used on #
# menu access to the skill trees. #
# ---------------------------------------------------------------------------- #


ST_arrow = [ # Don't touch.
#------------------------------------------------------------------------------#
# * Arrow Graphics List * #
# #
# You don't need to touch this section unless you change the arrow's order in #
# the SkillTree.png file. #
#------------------------------------------------------------------------------#
# "GraphicName", #
"A_l_st", # To left line, start. #
"A_r_st", # To right line, start. #
"A_ver_st", # Vertical line, start. #
"A_ver", # Vertical line. #
"A_hor", # Horizontal line. #
"A_ver_end", # Vertical line, end. #
"A_l_end", # To left line, end. #
"A_r_end", # To right line, end. #
"A_ver_w_diag_r", # Vertical line with right diagonal branch. #
"A_ver_w_diag_l", # Vertical line with left diagonal branch. #
"A_diag_r_st", # Diagonal to right line, start. #
"A_diag_r_abo_cor", # Diagonal to right upper chunk. #
"A_diag_r_bel_cor", # Diagonal to right lower chunk. #
"A_diag_r", # Diagonal to right line. #
"A_diag_r_end", # Diagonal to right line, end. #
"A_diag_l_st", # Diagonal to left line, start. #
"A_diag_l_abo_cor", # Diagonal to left upper chunk. #
"A_diag_l_bel_cor", # Diagonal to left lower chunk. #
"A_diag_l", # Diagonal to left line. #
"A_diag_l_end", # Diagonal to left line, end. #
] # Don't touch. #
#------------------------------------------------------------------------------#


ST_object = { # Don't touch.
#------------------------------------------------------------------------------#
# * Creating Arrow Objects * #
# #
# Here you build arrow objects for each tree. Each arrow fragment must be #
# created as a unique arrow object, that way they can have requirements to be #
# enabled. #
#------------------------------------------------------------------------------#
# #
# "ArrowObject" - Is the unique name for that arrow object. #
# "arrow_object" - Identifier, use always "arrow_object". #
# "arrow" - Is the graphic name from Arrow Graphics List section. #
# "dadskill" - Father Skill Object name. The skill object that conditions #
# this arrow object. #
#------------------------------------------------------------------------------#
# "ArrowObject" => ["arrow_object", "arrow", "dadskill"],

"DSsSS" => ["arrow_object", "A_ver_st", "DualSlash"],
"DSsRC" => ["arrow_object", "A_diag_r", "DualSlash"],
"DSeSS" => ["arrow_object", "A_ver_end", "DualSlash"],
"DSeRC" => ["arrow_object", "A_diag_r_end", "DualSlash"],
"RCsFF" => ["arrow_object", "A_diag_r", "RagingCut"],
"RCeFF" => ["arrow_object", "A_diag_r_end", "RagingCut"],
"SSsTS" => ["arrow_object", "A_ver_st", "SpinningSlash"],
"SSeTS" => ["arrow_object", "A_ver_end", "SpinningSlash"],
"SSsSS" => ["arrow_object", "A_diag_r", "SpinningSlash"],
"SSeSS" => ["arrow_object", "A_diag_r_end", "SpinningSlash"],
"MF_1b1" => ["arrow_object", "A_ver_st", "MF_1"],
"MF_1b2" => ["arrow_object", "A_ver_end", "MF_1"],
"MF_4_1" => ["arrow_object", "A_ver_st", "MF_4"],
"MF_4_2" => ["arrow_object", "A_ver_end", "MF_4"],
"WA_1_1" => ["arrow_object", "A_ver_st", "WA_1"],
"WA_1_2" => ["arrow_object", "A_ver_end", "WA_1"],

# #
#------------------------------------------------------------------------------#


#------------------------------------------------------------------------------#
# * Creating Skill Objects * #
# #
# Here you build skill objects for each tree. They contain the info regarding #
# their levels and requirements to be enabled, and for enabling other skill #
# objects. #
#------------------------------------------------------------------------------#
# #
# "SkillObject" - Is the unique name for that skill object. #
# reqlvl - Is the actor needed level for that object to be enabled. #
# "dadskill" - Father skill Object name. The skill object that conditions #
# this skill object. #
# maxlvl - Is the maximum skill points spendable on this skill object. #
# childreqlvl - Is the necessary ammount of points in this skill object to #
# allow spending points in skills linked to this one. #
# idlvl... - Are the Skill IDs for each level of that skill. #
# -----------------------------------------------------------------------------#
# "SkillObject" => [reqlvl, "dadskill", maxlvl, childreqlvl, idlvl1, idlvl2,...],

"DualSlash" => [1, nil, 3, 0, 1, 2, 3],
"PowerStrike" => [1, nil, 3, 0, 4, 5, 6],
"PreciseBlow" => [1, nil, 3, 0, 9, 10, 11, 12, 13],
"KillShot" => [1, nil, 3, 0, 7, 8, 9],
"QuickBurst" => [1, nil, 3, 0, 19, 20, 21, 22, 23],
"ClusterMissile" => [1, nil, 3, 0, 24, 25, 26],
"Fireball" => [1, nil, 3, 0, 10, 11, 12],
"RagingCut" => [10, "DualSlash", 3, 3, 28, 29, 30],
"SpinningSlash" => [10, "DualSlash", 3, 3, 31, 32, 33],
"FlamingFury" => [25, "RagingCut", 1, 3, 34],
"TornadoStrike" => [25, "SpinningSlash", 1, 3, 35],
"ShockSlash" => [25, "SpinningSlash", 1, 3, 36],

} # Don't touch. #
#------------------------------------------------------------------------------#


ST_tree_build = { # Don't touch.
#------------------------------------------------------------------------------#
# * Tree Building * #
# #
# Here you build each skill tree using the previous set'd skill and arrow #
# objects. #
# #
# There are 7 slots per row, being 1, 4 and 7 for skill objects, while 2,3,5 #
# and 6 are for arrow objects. Rows have no max limit, you have the first one #
# for skills, next two are for arrows and so. #
#------------------------------------------------------------------------------#
# #
# "TREE_NAME" - Is the tree unique name. #
# "obj..." - Skill or Arrow Object name from the previous sections. #
# For empty slot use nil. #
# -----------------------------------------------------------------------------#
# "TREE_NAME" => [ obj 1, obj 2, obj 3, obj 4, obj 5, obj 6, obj 7]

"BLADE" => ["DualSlash", nil, nil, nil, nil, nil, nil,
"DSsSS", "DSsRC", nil, nil, nil, nil, nil,
"DSeSS", nil, "DSeRC", nil, nil, nil, nil,
"SpinningSlash", nil, nil, "RagingCut", nil, nil, nil,
"SSsTS", "SSsSS", nil, nil, "RCsFF", nil, nil,
"SSsTS", nil, "SSeSS", nil, nil, "RCeFF", nil,
"TornadoStrike", nil, nil, "ShockSlash", nil, nil, "FlamingFury",],

"SMASH" => ["WA_1" , nil, nil, nil, nil, nil, nil,
"WA_1_1", nil, nil, nil, nil, nil, nil,
"WA_1_2", nil, nil, nil, nil, nil, nil,
"WA_2" ],
"MELEE" => ["MF_1" ,"MF_1a1","MF_1a2", "MF_2", nil, nil, "MF_4",
"MF_1b1", nil, nil, nil, nil, nil,"MF_4_1",
"MF_1b2", nil, nil, nil, nil, nil,"MF_4_2",
"MF_3" , nil, nil, nil, nil, nil, "MF_5"],

} # Don't touch. #
#------------------------------------------------------------------------------#


ST_class_assign = { # Don't touch.
#------------------------------------------------------------------------------#
# * Asigning Skill Trees to Classes * #
# #
# Here you set the available trees for each class. Max of 3 trees per class. #
# If less, use nil. #
#------------------------------------------------------------------------------#
# #
# ClassID - Is the class id, d'oh. #
# "TREE..." - Are the tree's unique names from Tree Building section, #
# this class have available. #
# "Display..." - Are the displayed name for that skill tree. Ex: Having #
# "Protection" tree for Warriors and Paladins in WoW. #
#------------------------------------------------------------------------------#
# ClassID => ["TREE_1", "TREE_2", "TREE_3", "Display 1", "Display 2", "Display 3"],

9 => ["BLADE", "SMASH", "MELEE", "Blade", "Smash", "Melee"],

} # Don't touch. #
#------------------------------------------------------------------------------#


#------------------------------------------------------------------------------#
end # of Skill Tree's setup script. #
#------------------------------------------------------------------------------#



I don't see what could cause the problem. The first skill tree shows up just fine, with all the skills and everything, but when I try and switch to the other trees, it comes up with that error message.

P.S. I do not have skills set up for the other trees, could that mess things up?
leongon
You have trees with unexisting skill objects:

CODE
"SMASH"      => ["WA_1"  ,     nil,     nil,     nil,     nil,     nil,     nil,
                  "WA_1_1",     nil,     nil,     nil,     nil,     nil,     nil,
                  "WA_1_2",     nil,     nil,     nil,     nil,     nil,     nil,
                  "WA_2" ],
"MELEE"      => ["MF_1"  ,"MF_1a1","MF_1a2",  "MF_2",     nil,     nil,  "MF_4",
                  "MF_1b1",     nil,     nil,     nil,     nil,     nil,"MF_4_1",
                  "MF_1b2",     nil,     nil,     nil,     nil,     nil,"MF_4_2",
                  "MF_3"  ,     nil,     nil,     nil,     nil,     nil,  "MF_5"],


Make the Class assign like:

CODE
9 => ["BLADE", nil, nil, "Blade", nil, nil],


Til you finish setting it up.
FlyingPenguin
Ok, thanks! I had forgotten to delete those out of the other skill trees. sweat.gif
It works perfectly now!
leongon
v1.2
With many new features, including many of those you people have suggested. Check the first post.

I feel like this script is my master piece *_*
wifflefish
I love it! A work of art! I've been looking for something like this for a long time. Thanks a lot!
johnnydangerous66
Leo, feel free to use that "grid" image I posted as an example in your first post! happy.gif Your English is very good, from what I can tell. I've been living in China for over a year now (teaching English, no less), so I know how it feels to struggle with a foreign language. If you have any trouble writing instructions, I'll be happy to "clarify" certain parts for you. Oh, and I really enjoyed the demo! laugh.gif

It seems I am experiencing considerable lag now that I've added up to 300 skills to my database. I have many, many more to go, too. I'm wondering if the lag is because my laptop sucks or if we can do something to clean up the code. I'll be taking a look at this... cool.gif
leongon
The skill tree scene is lagging? Tell me to see what can I do.

Would be great if you can clarify instructions that are strange. I did my best, so I really can't tell if something is still hard to understand tongue.gif
johnnydangerous66
QUOTE (leongon @ Jul 23 2010, 09:41 PM) *
The skill tree scene is lagging? Tell me to see what can I do.

Would be great if you can clarify instructions that are strange. I did my best, so I really can't tell if something is still hard to understand tongue.gif


It begins to lag once you have learned lots of skills. For example, I have a character who can learn 13 skills in one tree. Each skill can be upgraded 5 times. Once she's upgraded a few skills, it begins to lag and my computer starts overheating a bit. laugh.gif

I also have a few bugs with the 1.2 version:

1) If you enter "false" for the background picture in the customization script, the game crashes. This can probably be fixed by cutting

CODE
    @back_img.x = @skilltree_window.x
      @back_img.y = @skilltree_window.y


and pasting it inside

CODE
if ST_setup::ST_imageback != false
      tree_name = ST_setup::ST_class_assign[@actor.class_id]
      @back_img = Sprite.new
      @back_img.bitmap = Bitmap.new("Graphics/System/" + tree_name[@tree_index])
      @back_img.opacity = ST_setup::ST_imageback
      @back_img.viewport = @viewport
  end


2) If you make a skill tree, and the spot in the furthest top-left area (that is, the first "square" of the grid) is *not* occupied by a skill, but rather a nil pointer, the game crashes with a no method error (it's trying to find the "name" of a skill, when there is none). I tested this by moving skills to and from that first area. When a skill was there, the game didn't crash.

EDIT: The problem seems to be the script wanting to init the cursor index at 0. We should instead init the cursor at the first skill in the array. I'm thinking something like this would work:

CODE
    @actor.tree_skills.each_with_index do |part, i|
      if !part.nil?
        self.index = i
        break
      end
    end


Or something similar to that.

To illustrate bug #2, I have attached a picture. I hope it helps.

Otherwise it seems to be going quite well. wink.gif
leongon
Ha ha, I was expecting some bugs, the more features and changes make more hard to check if everything is ok xD

Fixed them both. Replace just the Core.

Thanks for reporting.
johnnydangerous66
Awesome! This version works great so far. No problems besides the lag I talked about earlier.

Feature request: Allow up to three "parent" skills. In my game, I have a guy who can learn three types of weapons. If he masters all three of them, a powerful mastery skill is unlocked.

Hopefully this shouldn't be too much of a hassle to integrate with the current system. wink.gif Thanks!
leongon
Nope, is not hard at all. But having three parents, is kinda weird still in this age. ph34r.gif Will be noted for a future upgrade.
dorky106
Is 3 Columns the max amount that can be used with this script?
leongon
QUOTE (dorky106 @ Jul 25 2010, 11:40 PM) *
Is 3 Columns the max amount that can be used with this script?

7
DNova1202
This script is amazing! Thank you for this!
Memille
Thank you that's very usefull wink.gif
Adrien.
I have a question.
As far as I know I am doing this right.

MF_# is a skill while MF_#_# is a arrow poiting from the skill to the next, so for example MF_1 (Fire skill points to...) MF_1_2 (arrow down) MF_2 (Flame spell)

see:

CODE
"MAGE_FROST" => ["MF_1" , nil, nil, nil, nil, nil, nil,
"MF_1_2", nil, nil, nil, nil, nil, nil,
"MF_2", nil, nil, nil, nil, nil, nil,
"MF2_3", nil, nil, nil, nil, nil, nil,
"MF_3", nil, nil, nil, nil, nil, nil],


but upon running this I get the following error in attachment Click to view attachment

am I doing this wrong? I just want to go from MF_1 -> 2 -> 3
Also if i assign 15 points for testing why can i only spend one before its maxed:

CODE
"SkillObject" => [reqlvl, treepts, "dad", "mom", maxlvl, childreqlvl, idlvl1, idlvl2,...],

"MF_1" => [1, 0, nil, nil, 3, 3, 1], # this is the one i care most about only lets me spend 1 point before its "maxed"
"MF_2" => [5, 3, "MF_1", nil, 3, 3, 2],
"MF_3" => [10, 3, "MF_1", "MF_2", 3, 3,3],
"MF_4" => [1, 0, nil, nil, 5, 5, 14, 15, 16, 17, 18],
"MF_5" => [10, 0, "MF_4", nil, 5, 5, 19, 20, 21, 22, 23],
"WA_1" => [1, 0, nil, nil, 3, 3, 24, 25, 26],
"WA_2" => [1, 0, "WA_1", nil, 5, 0, 27, 28, 29, 30, 31],


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.