Posts: 70
Threads: 15
Joined: Nov 2012
no i get that what I mean is where do I put the zero in this script
$scene = Scene_SkillTree.new( actor_index [, from_map ])
I mean do I write
$scene = Scene_SkillTree.new( actor_index = 0 [, from_map ])
really really sorry to keep being a pain.
Posts: 24
Threads: 3
Joined: Feb 2015
$scene = Scene_SkillTree.new( actor_index = 0 [, from_map ])
Or
$scene = Scene_SkillTree.new( 0 [, from_map ])
If you haven't already, download the demo and extract the event script from there by simply opening the demo in the rmxp editor and copying thr event used to open it there.
Posts: 11,228
Threads: 648
Joined: May 2009
Well, more accurately (assuming you are using it in a menu and not from a map, either:
Code:
$scene = Scene_SkillTree.new( 0 )
or
But if you are working with a map event, so your skill tree shows up because you talked to some map NPC, try either:
Code:
$scene = Scene_SkillTree.new( 0, true )
or
Code:
skilltree( 0, true )
The actor_index value indicates which member is selected in your party (0 =the first or party leader, 1 = the second, etc....). You would normally just go with the syntax
$scene = Scene_SkillTree.new(@status_window.index) within a menu just as you would
$scene = Scene_Skill.new(@status_window.index), assuming you this system to a custom menu ... and seeing how @status_window.index is the actor_index.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 70
Threads: 15
Joined: Nov 2012
oh thank god I can finally bring up the skill tree now just one more question if I wanted to make it so the player can only get skill points from items left around the map how would I do that?
Posts: 11,228
Threads: 648
Joined: May 2009
The typical syntax to add skillpoints that can be spent will either be:
Code:
$game_party.actors[actor_index].skillpoints += value
Going by the members within the party...
or
Code:
$game_.actors[ID].skillpoints += value
If you want to specify the actual actor in your actor database.
Now you're looking to make it so items can bestow skill points? That can be done, but it needed a little work.
*COUGH COUGH COUGH* This little script, placed below the Skill Tree system, can actually let you make some items grant skill points to the user or users (if you have the item work on a single actor or the party).
I cranked it out fast, but hey... it works.
Code:
module Item_Points
POINTS = {}
# THE LIST OF ITEMS
# =================
POINTS[33] = 25 # Makes my demo's ITEM #33 (the book) bestow 25 points
end
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs item screen processing.
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
alias skilltree_addon_target update_target
def update_target
# Check to make sure enough items...
@effected = false
@effected = true if $game_party.item_number(@item.id) > 0
# Perform the call
skilltree_addon_target
# Don't bother unless actually in use and enough items
return unless Input.trigger?(Input::C)
return unless @effected
# If target is all
if @target_window.index == -1
for i in $game_party.actors
i.skillpoints += Item_Points::POINTS[@item.id]
end
end
# If single target
if @target_window.index >= 0
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
target.skillpoints += Item_Points::POINTS[@item.id]
end
end
end
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 70
Threads: 15
Joined: Nov 2012
still getting those syntax errors how do I make it so the script add points to character with the actor index=0 in my game I only have the one character which can use the skill tree.
I have been trying.
$game_party.actors[ actor_index = 0].skillpoints += 1
thank again we will get my skill trees working in the end :)
Posts: 11,228
Threads: 648
Joined: May 2009
When someone describes the syntax of a statement, they include parameter values that are replaced. Even the default scripts work like that. So the 'Game_Actor' initialize method in the default scripts that read:
Code:
def initialize(actor_id)
super()
setup(actor_id)
end
... When you load the 2nd actor, the value of actor_id is set to the value 2. When RPGMaker XP passes the value of 2 into the method 'using' the actor_id value as a placeholder, it treats the method as...
Code:
def initialize(2)
super()
setup(2)
end
So when I said the syntax read as
Code:
$game_party.actors[actor_index].skillpoints += value
.... you replace both the 'actor_index' value with 0 and the value applied.
So if you ONLY want to apply points to the lead party member, use...
Code:
$game_party.actors[0].skillpoints += 4
(where this one is applying 4 points)
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 70
Threads: 15
Joined: Nov 2012
THANK YOU THANK YOU this is just what I needed
Posts: 449
Threads: 18
Joined: Sep 2015
I'm using this script in my game and one of my skilltree has recently reached a 5th row and now the skilltree seems to be buggy.
When calling the script and selecting the skill tree it immediately highlights the last skill in row 5 and will not let me move freely about the skill tree.
It just happens in that skilltree with the 5th row. Everything else works fine.
Posts: 11,228
Threads: 648
Joined: May 2009
It could be the configured data. *shrugs* You could try creating a totally new skill tree (for another character or something) and do a start-over from scratch... for that tree. See if a fresh re-draw of the tree does the trick, then use it to replace the buggy one.
*Sigh* It's a tendency to have issues and bugs crop up when one must manually configure complex systems. I so wish to make systems with built-in editors that plug away your values so it is error free. It is my dream... Ahh... one day....
EDIT: Should see a skill tree a friend made. It would drive the poor guys at SquareEnix insane... looks like the goofball ring thing from Final Fantasy X.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links