ID:155127
 
what I have is a basic skill tree divided into 3 types Mage, Oger, and Knight what I am wanting to do is make it to where each specific race gets their designated skill tree verb IE Mage gets the mage skill tree Oger gets the oger tree etc.... here are the verbs i have set up thus far

mob
verb
SkillTree_Oger()

if(Skill_Tree)
for(var/I in client.images) if(I)
del I
client.eye = src
Skill_Tree = 0
return
src << "Now Viewing the Skill Tree."
Skill_Tree = 1
client.eye = locate (7,7,2)
Refresh_Skilltree()
mob
verb
SkillTree_Knight()

if(Skill_Tree)
for(var/I in client.images) if(I)
del I
client.eye = src
Skill_Tree = 0
return
src << "Now Viewing the Skill Tree."
Skill_Tree = 1
client.eye = locate (8,30,2)
Refresh_Skilltree()
Have a completely new mobs for each class
mob
knight
//stuff
ogre
//more stuff

Basically all you have to do is swap the client.mob to a different mob when you want to change the class.
mob/var/Tree = "Knight"// Or ogre/whatever

mob/verb/Skill_Tree()
call(text2path("/mob/proc/[usr.Tree]_Tree")) (args)

mob/proc/Knight_Tree()
//skill tree stuff


This should call the related proc using the call() proc and a text var, provided you name things properly.
i have no clue, why am i even posting here?
In response to Robertbanks2
Robertbanks2 wrote:
>
> mob/var/Tree = "Knight"// Or ogre/whatever
>
> mob/verb/Skill_Tree()
> call(text2path("/mob/proc/[usr.Tree]_Tree")) (args)
>
> mob/proc/Knight_Tree()
> //skill tree stuff
>

This should call the related proc using the call() proc and a text var, provided you name things properly.

Ok so with this I will not need the previous 2 verbs for oger and knight
In response to Kira22x1
What that does is call the appropriate proc, you still need the 3 procs to exist, but this condenses them into 1 universal verb that will work for all classes.
In response to Robertbanks2
K as long as i cant see my mage tree when I am a oger and vise versa
In response to Robertbanks2
Ok I am only testing this on one and it compiles fine but when i go to load the Tree I get this

runtime error: bad proc
proc name: Skill Tree (/mob/verb/Skill_Tree)
usr: Test\' (/mob)
src: Test\' (/mob)
call stack:
Test\' (/mob): Skill Tree()


Here is what i have on the proc side of things

mob
proc
SkillTree_Oger()
set category = null
if(Skill_Tree)
for(var/I in client.images) if(I)
del I
client.eye = src
Skill_Tree = 0
return
src << "Now Viewing the Skill Tree."
Skill_Tree = 1
client.eye = locate (8,30,2)
Refresh_Skilltree()


and here is the tree var

mob/var/Tree = "Oger"


I know i am missing something but as far as i can see every thing looks fine
In response to Kira22x1
You aren't actually showing the Skill_Tree() proc that the error is referencing.
In response to Robertbanks2
OK so how would I get it to show the skill tree proc if you dont mind me asking a stupid question a
In response to Kira22x1
You copy paste the verb that decides which proc to call into the reply box.
In response to Robertbanks2
Thank you I got it