Skilltree
parent_type = /obj/
icon = 'stree.dmi'
var
reqpoints = 0
tech_obtained = /Skill/
unlocked_skills = list()
Click()
if( (name in usr.Learned_Skills) )
usr << "You have already learned this!"
else if( !(name in usr.Activated_Skills) )
usr <<"This skill is not available at this time."
else if(usr.Skill_Points < reqpoints)
usr << "You don't have the required skill points for this!"
else if( alert("Obtain [name] for [reqpoints] points?","Skill Obtain","Yes","No") == "Yes")
usr << "You have obtained [name]!"
usr.Learned_Skills += name
for(var/A in unlocked_skills)
if( !(A in usr.Activated_Skills) )
usr.Activated_Skills += A
usr.Skill_Points = max(0, usr.Skill_Points - reqpoints)
usr.contents += new tech_obtained
usr.Refresh_Skilltree()
Blank
name = "blank"
icon_state = "tech"
reqpoints = 0
unlocked_skills = list("Defend")
tech_obtained = /Skill/blank
Blank2
name = "blank2"
icon_state = "tech2"
reqpoints = 0
tech_obtained = /Skill/blank
turf
Skilltree
icon = 'stree.dmi'
Background
icon_state = "Background"
Left_Right
icon_state = "Left - Right"
Up_Down
icon_state = "Up - Down"
Skill
parent_type = /obj
blank
Click()
usr << "You clicked [src]"
blank2
Click()
usr << "You clicked [src]"
mob
verb
SkillTree()
if(Skill_Tree)
for(var/I in client.images) if(I)
del I
client.eye = src
Skill_Tree = 0
return
src << "Your view has changed, but you are still in the same spot."
Skill_Tree = 1
client.eye = locate (1,55,3)
Refresh_Skilltree()
proc
Refresh_Skilltree()
for(var/image/I in client.images) if(I && I.tag == "Skilltree")
del I
for(var/Skilltree/S in oview(client.eye) )
if( ! (S.name in Activated_Skills) )
var/image/I = new('Skill Tree.dmi',S.loc,"Unavailable",FLY_LAYER)
I.tag = "Skilltree"
client.images += I
var
Skill_Points = 0
Activated_Skills = list("blank")
Learned_Skills = list()
tmp
Skill_Tree = 0
Stat()
..()
statpanel("Skills")
if(statpanel("Skills"))
stat("Skills You've obtained")
for(var/Skill/S in contents)
stat("",S)
Problem description:
the code compiles with no errors but when someone uses the verb it takes them to a black screen instead of the skill tree any help with this would be a great help please note this is based off of axerob_skilltreedemo I dont claim any rights to this code