The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: Deity on April 08, 2010, 09:15:51 PM

Title: Deity's SkillTree
Post by: Deity on April 08, 2010, 09:15:51 PM
<Deity's SkillTree>
Version: <1.0>
Author: <Deity>
Date: 4,8,2010

Version History




Planned Future Versions

Description


This Script allow you tu use your own individual SkillTree for your Game.

Features


Screenshots

(https://rmrk.net/proxy.php?request=http%3A%2F%2F250kb.de%2Fu%2F100408%2Fp%2FRr8ZYRpUUS8u.png&hash=d95960124c82c09ca828e400f26d0c5781f53c72)
(https://rmrk.net/proxy.php?request=http%3A%2F%2F250kb.de%2Fu%2F100408%2Fp%2Fs80X2MNEDY6c.png&hash=357a2754fc11180aaab48d80febb74ec12100c23)
Settings
(https://rmrk.net/proxy.php?request=http%3A%2F%2F250kb.de%2Fu%2F100408%2Fp%2FG5J3M9b8l9BR.png&hash=cbaf421311f8a699c2a40f4a48dca9b2b06cded9)

Instructions

[/list][/list]
Code: [Select]
# Using:                                                         #
# As first you have to setup the Settings as you wish.           #
# To call the SkillTree you have to write this in the "Call ..." #
# $scene = Scene_SkillTree.new(party_member_id)                  #
# If you use this line:                                          #
# add_skill_points(party_member_id,points)                       #
# the partymember with the id (party_member_id) get points       #
# skillpoints.                                                   #
# Just add the skills an actor can learn as ever in the database.#
# Now you have following notes which you can place into the note #
# of a skill.                                                    #
# <skills> needed_skill_id,needed_skill_id <skills_end>          #
# <costs> skillpoint_costs_to_learn <costs_end>                  #
# <coords> x-coordinate,y-coordinate <coords_end>                #
# If you skip <skills> the script notice that there no skills    #
# which the actor need to learn this skill.                      #
# If you skip <costs> the script give the skill automaticaly     #
# the cost of 1 skillpoint.                                      #
# The coordinates are important so dont skip them.               #
# You have a window of 272*328 pxl to place you skills(icons).   #
# So you can place about 99 Skills in you skilltree              #
# The biggst x-ccordinate you should use is: 244                 #
# The biggst x-ccordinate you should use is: 300                 #

Script


        -  SkillTree v 1.2  *new(With 4 directions.) (http://paste.pocoo.org/raw/1C2HFeLE7F1kLJHHZISw/)
        -  SkillTree v 1.1  *new (http://paste.pocoo.org/raw/25jxwDUxOQkPpRKD488r/)
        -  Bitmap Addon*new (http://paste.pocoo.org/raw/gqy1bX03UGeb8qRxQqz5/)
        - SkillTree v1.0 (http://paste.pocoo.org/raw/199388/)
        - Bitmap Addon (http://paste.pocoo.org/raw/li41t152WackUA0OPTYA/)

Credit



Thanks


Support


I'm active in this forum: http://www.rpgvx.net. Send me a PM or post here to get support.

Known Compatibility Issues
- No known -

Demo


Demo hasnt the newst Version of Script!!!
Demo v1.1 *new (http://dc187.2shared.com/download/12521969/b82912d9/Skilltree_v10_-__engl_.rar?tsid=20100413-092000-70dbb3f6) (2shared)
Demo v1.1 *new (http://www.mediafire.com/?qhgmqwjnxmz) (Mediafire)
Demo v1.0  (http://www.mediafire.com/?njz2gzxlijn)

Author's Notes


If the script will find an user I would like to see my name in the credits. If you use this script and your SkillTree is ready you should maybe show the other members the result so they become impressed. ^^

Sorry for my english if it's impossible to understand it just let me know.

Bye
Deity
Title: Re: Deity's SkillTree
Post by: modern algebra on April 08, 2010, 11:31:55 PM
Wonderful idea Deity. So many people have requested this, and the layout is very pretty.
Title: Re: Deity's SkillTree
Post by: Xzygon on April 09, 2010, 03:43:23 AM
OMG. I LOVE YOU.
WILL YOU MARRY ME?

I've been looking for something like this, as many others have looked, for forever. (Since my first uncompleted game.)
Looks AWESOME. Gonza test it outs now :D
Title: Re: Deity's SkillTree
Post by: Grafikal on April 09, 2010, 04:35:01 AM
nice script
Title: Re: Deity's SkillTree
Post by: Deity on April 09, 2010, 09:51:26 AM
Thanks for your comments.
It's nice to read such things about the script. :D
I've added an idea for the future:
Quote
better control with all 4 directions
Maybe it will work soon. ^^

Code: [Select]
Gonza test it outs now Cheesy
Telll me your results.

Quote
Wonderful idea Deity. So many people have requested this, and the layout is very pretty.
Thank you again. :D

Quote
nice script
Thanks to you too.

Bye
Deity
Title: Re: Deity's SkillTree
Post by: Grafikal on April 09, 2010, 04:36:30 PM
Is there a way to change the type of line that connects the icons, instead of that one pixel red/green line? Maybe a thicker, dotted or some other type of line?
Title: Re: Deity's SkillTree
Post by: Deity on April 09, 2010, 05:45:45 PM
Jes for sure.
But if you maybe know it's hard to draw diagonals which doesn't has the 8 directions. :(
Therefore is the Bitmap-Addon and I would be able to make some options for the drawn lines but when I tested  a line which was taller (2pxl) the line becomes very ugly. :D
If it's important I will write some options for the lines. ^^

Bye
Deity
Title: Re: Deity's SkillTree
Post by: modern algebra on April 10, 2010, 01:13:31 AM
One idea for that might be to simply throw this in underneath:

Code: [Select]
class Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Width for Draw Line
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_bmpadon_wideline_8ik2 draw_line
  def draw_line (x0, y0, x1, y1, colour, w = 1, *args)
    malg_bmpadon_wideline_8ik2 (x0, y0, x1, y1, colour, *args)
    if w > 1
      draw_line (x0 + 1, y0, x1 + 1, y1, colour, w - 1, *args)
    end
  end
end

What it does is simply draw the same line to the right of the original line for however many pixels you specify. You may need to modify the x values of your script in order to keep it centred, but the above method shouldn't make the line look too ugly. It is not optimal by any means though.


Your demo has a little error in it though. You use Variable 1 for collecting extra skill points from the girl, but you don't reset it, and for some reason you pass Variable 1 to Scene_SkillTree when talking to the guy, so if you select a number of skill points over the number of actors in the database and then go talk to the guy, you will get an error. That's just an error with the event setup in the demo though, not the script itself.
Title: Re: Deity's SkillTree
Post by: Deity on April 10, 2010, 01:58:48 AM
My version of an taller line is a bit "bigger":
Code: [Select]
class Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Line
  #    x0, y0 : the coordinates of the start of the line.
  #    x1, y1 : the coordinates of the end of the line.
  #``````````````````````````````````````````````````````````````````````````
  #  This uses Bresenham's algorithm to draw a line
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_line (x0, y0, x1, y1, colour = font.color,width = 1,height = 1,skip = 0)
    # Set boolean for steep lines
    steep = (y1 - y0).abs > (x1 - x0).abs
    if steep
      # Reflect across y=x
      tmp = x0
      x0, y0 = y0, tmp
      tmp = x1
      x1, y1 = y1, tmp
    end
    # If in negative direction
    if x0 > x1
      # Swap initial points
      tmp = x0
      x0, x1 = x1, tmp
      tmp = y0
      y0, y1 = y1, tmp
    end
    ystep = y0 < y1 ? 1 : -1
    deltax = x1 - x0
    deltay = (y1 - y0).abs
    error = deltax / 2
    y = y0
    # Advance by Rows
    lop = skip * height
    for x in x0.to_i...x1.to_i
      if lop == skip * height
        for w in 0...width
          for h in 0...height
            steep ? set_pixel (y+h, x+w, colour) : set_pixel (x+w, y+h, colour)
          end
        end
        lop = 0
      else
        lop += 1
      end
      error -= deltay
      if error < 0
        y += ystep
        error += deltax
      end
    end
  end
end

But I will test your version for sure!

Code: [Select]
Your demo has a little error in it though. You use Variable 1 for collecting extra skill points from the girl, but you don't reset it, and for some reason you pass Variable 1 to Scene_SkillTree when talking to the guy, so if you select a number of skill points over the number of actors in the database and then go talk to the guy, you will get an error. That's just an error with the event setup in the demo though, not the script itself.

Jeah I already mentioned this error but I was to lazy to make a new version of the demo. :(
Thanks for report!!

Damn this 4 direction Curssor Move System is harder as I thought. I've already tested 3 Ideas without succes but my newest idea have potential.(I think.)
I hope I will be able to finisch it. :D

I also want to write an <hide> comment which let the skills become hidden as long there conditions are not sufussed.

If I'm allowed to say this. To lvlup in this Forum seems a bit to easy.
12 Posts and lvl 19. xD

As long
Deity

_______
I've made an Update. :D
Happy testing!
Title: Re: Deity's SkillTree
Post by: ShortStar on April 13, 2010, 01:27:39 AM
That site the download is on is crap.
Title: Re: Deity's SkillTree
Post by: Deity on April 13, 2010, 01:27:29 PM
Can you precise your post? ^^
What ist the "crap"? It doesn't work or you cant find the download? (I've changed it to a direct download.)
But anyway I added a downloadlink from Mediafire.

I thik I won't use the site anymore cause you're not the only one who dislike this page. ^^

Deity
Title: Re: Deity's SkillTree
Post by: ShortStar on April 13, 2010, 05:33:45 PM
I can find A download, but it goes to some software. The text download link I hover over and some other site like that Microsoft search engine site pops up. Speaking of pop ups, there are quite a few of them.

I think maybe one of the ads just says download. I never found the real download out of 3 links to download on that site.
Title: Re: Deity's SkillTree
Post by: Deity on April 13, 2010, 06:05:21 PM
Ok I understood. :)
I hope it wasnt to worse and you had fun while testing.

Deity
Title: Re: Deity's SkillTree
Post by: ShortStar on April 14, 2010, 12:51:20 AM
After trying for several times, I never downloaded it and I just found another script to use. I'm sorry, but sometimes that happens. If the store is closed, you buy from another.
Title: Re: Deity's SkillTree
Post by: Grafikal on April 14, 2010, 01:03:01 AM
Lol, your metaphor is fucking retarded. You're too lazy to read.

If only you had eyes.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi39.tinypic.com%2Fneu5gp.png&hash=76ee4a71d71ca1e2eefc7172516b2a79c7ff2b71)


(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi43.tinypic.com%2F123kyft.png&hash=02ecae32696ec6290429ffb3a797072a4efabd96)
Title: Re: Deity's SkillTree
Post by: Deity on April 14, 2010, 05:43:29 PM
Quote
I'm sorry, but sometimes that happens. If the store is closed, you buy from another.
I laughed while reading this. :D
Don't understand the last line to offensive.

It is sad hat you even didn't try it out when I reuploaded but it's your decision and I accept your decision. ^^


Deity
Title: Re: Deity's SkillTree
Post by: ShortStar on April 14, 2010, 07:10:41 PM
At least you laughed, I was kind of fearing that it would be offensive.

Grafikal... that download button was never on 2shared. In fact its not there now. There is a download button at the bottom, but that is an ad. Speaking of ads, uggg I am getting overwhelmed with them at that site.
Title: Re: Deity's SkillTree
Post by: Grafikal on April 14, 2010, 08:13:29 PM
That was 2 different images, not 1. The first was from 2shared. The second was from MediaFire.
Title: Re: Deity's SkillTree
Post by: modern algebra on April 14, 2010, 10:02:52 PM
Well, the MediaFire download wasn't up at the time he posted, and 2shared is kind of a gross uploading site :P

In any case, it doesn't make much of a difference. But just so you know Deity, you can also upload script demos to RMRK itself by attaching it to your post under the Additional Options feature.
Title: Re: Deity's SkillTree
Post by: Grafikal on April 14, 2010, 10:06:07 PM
I knew that MediaFire wasn't up, I just posted the place of both downloads for reference. I agree that 2shared is ugly, however, I still easily found the download link. It was simple enough to read through the page.

:)
Title: Re: Deity's SkillTree
Post by: modern algebra on April 14, 2010, 10:18:41 PM
true enough
Title: Re: Deity's SkillTree
Post by: hikick10 on May 02, 2010, 05:42:24 PM
Error: Stack level too deep?   ???
Title: Re: Deity's SkillTree
Post by: Deity on May 02, 2010, 06:03:49 PM
I'm sorry but the Demo working fine.
Can you tell me in which line the Error happen?
This error normally hapens if there is any loop with no end but I'm fixing such things imidiently so its just strange. :(


Deity
Title: Re: Deity's SkillTree
Post by: Xzygon on May 02, 2010, 08:27:54 PM
You have 2 of the same script in your project. Delete one.
Title: Re: Deity's SkillTree
Post by: hikick10 on May 04, 2010, 10:02:44 AM
I'll check which line...
Title: Re: Deity's SkillTree
Post by: Deity on May 04, 2010, 11:59:42 AM
Oh Xzygon is on the right track. If you have the same Script two time in the same scriptlist it could cause the error,also. Check it ouf maybe it was just a mistake.

Deity

_______________________________________________
EDIT:
I'm just finished a better controll of the cursor with all 4 directions. I hope you'll like it!
Have fun while testing.

Deity
Title: Re: Deity's SkillTree
Post by: modern algebra on May 12, 2010, 09:37:28 PM
The cursor movement is much more intuitive. Looks great Deity!
Title: Re: Deity's SkillTree
Post by: apoclaydon on June 09, 2010, 01:00:42 AM
great script just one minor question is it possible to make skills unlearnable depending wot direction you go eg
a mage has 2 trees one for offensive and one for defencive. would it be possible to have it so if u choose defencve then u cnt choose from the offencive brance
Title: Re: Deity's SkillTree
Post by: flumi94 on August 01, 2010, 03:47:16 AM
To call the SkillTree you have to write this in the "Call ..."

what does that mean?  :o
Title: Re: Deity's SkillTree
Post by: flumi94 on August 01, 2010, 01:52:34 PM
ah ok i opened the demo....

i have to unpack the thing because i got an error.

now i know how to open demos, thanks.

(i mean to open it to edit and so on, not the game)
Title: Re: Deity's SkillTree
Post by: Infinate X on December 26, 2010, 07:22:09 PM
It's like an improvement of Diablo 2's skill tree! :D

EDIT: I finally found a game to use this this in that I think I'll finish! BTW I search skill tree and my reply is how I found this :D

EDIT2:LOL same smily in both posts
Title: Re: Deity's SkillTree
Post by: phoenixn91 on March 04, 2011, 10:50:49 PM
one question, does it allow learning of passive skills or only active skills?

(active = skills that we can/have to use ; passive = always active, we don't have to use it -e.g.: Standard Defense Up skill-)


Nvm the question o.O found a script for passives that would go with this well
Title: Re: Deity's SkillTree
Post by: Vegassims4 on June 05, 2011, 11:45:29 PM
I having trouble with you skill tree system every time I call the script this pops up.



Script 'Skill Point' line 446: NoMethodError occurred.

undefined method 'learnings'for NilClass:Class

What do I do?
Title: Re: Deity's SkillTree
Post by: kazma on June 16, 2011, 03:02:53 AM
is it possible to set this so you can access the skill-tree from the menu, or do you have to set a call event every time you want to use it?
Title: Re: Deity's SkillTree
Post by: pacdiggity on June 16, 2011, 07:31:20 AM
You could alter your Scene_Menu to include an option for the skill-tree, or better yet, alter Scene_Skill. For example, in the update method of Scene_Skill,
Code: [Select]
if Input.trigger?(Input::X)
  $scene = Scene_SkillTree.new(@actor_index)
end
should work, if you're having trouble doing this just ask me to do a rewrite of the class for you.

LE EDIT:: Alternatively, stick this below the skill tree script, but still above main.
Code: FIX [Select]
class Scene_Skill < Scene_Base
  alias pac_deity_skltr_updsklselect update_skill_selection
  def update_skill_selection
    pac_deity_skltr_updsklselect
    if Input.trigger(Input::X)
      $scene = Scene_SkillTree.new(@actor_index)
    end
  end
end
Title: Re: Deity's SkillTree
Post by: Ghangis24 on July 04, 2011, 07:54:09 PM
Hi! Great, great script! :)

I've included access to the skill tree in my party menu but right now using it only allows you to access the skill tree of the first member in your party. Is there any way I can make it to where once you select the option to access the skill tree, it allows you to choose which character in your party you want to customize?

EDIT: Also, is there a way to add text above a tree? To specify what kind of tree it is? (defense, attack etc,.)

LAST EDIT: Not to keep adding to the problems here (haha) but I get an "comparison of Fixnum with nil failed" error when I go to learn a new ability.
Title: Re: Deity's SkillTree
Post by: Kotone123 on July 21, 2011, 05:39:18 PM
Thankyou Thankyou!! You have no idea how long I've been looking for a script like this, and I cant create my own since I'm still a beginner Scripter.... Wonderful.
Title: Re: Deity's SkillTree
Post by: Xearoth93z on July 25, 2011, 03:55:50 AM
I got a question about adding points to use for multiple characters:

Since you can select which actors get points by using 'add_skill_points(party_member_id,points)', I noticed that the actor_id you have to put in is the ID (actor 001) minus 1 from it, so to add points to Actor 1, you put add_skill_points(0,3)
and I thought that was odd.

and

Is there a way where I can gain points after defeating an enemy and only the people in my party get 'X points'?