Skills as Objects in Developer Help
|
|
I'm trying to make a list of skills as Objects. I need them as objects so I can click on them to do multiple things. These will show in the statpanel with their skill number beside them, but for now, Im having problems.
Here's my Notes/Errors/Code.
Notes
#######################
-I didn't put all the errors in because they just repeated the same thing over and over but with different weapon skills.
#######################
Errors
#######################
test1.dm:551:error:obj:undefined var
test1.dm:551:error:skills:undefined var
test1.dm:551:error:attack:undefined var
test1.dm:551:error:knife:undefined var
test1.dm:551:error:obj:undefined var
test1.dm:551:error:skills:undefined var
test1.dm:551:error:attack:undefined var
test1.dm:551:error:bluntshort:undefined var
test1.dmb - 86 errors, 0 warnings (double-click on an error to jump to it)
#######################
Code
#######################
//**** This is the objects that represent the skills ****
obj/skills
var/skillnum = 0//The skill number, this changes as you get better.
var/skilltick = 0
//----------------------
attack
verb/Practice()
//will add code later.
verb/Description()
//will add code later.
//----------------------
knife
name = "Knife"
Description()
src<<"Skill: Knife -> Utilize small piercing and slashing weapons like Dagger's and Sai's in melee combat."
Practice() //This will attempt to increase a characters skill.
src<<"\red *** Do not move until Practice is completed or you forfit any potential learning.***"
//more code to come
bluntshort
//more code about this weapon skill
//*************
//* **** This is the code where I am trying to allow the player to choose what skill and how many points they have available to add to it and then put those into the object and add it to the players inventory. Once in the inventory they do not have the same verbs as other objects and are not treated as something tangible.***** */
mob/creating_character
base_save_allowed = 0
Login()
spawn()
src.CreateCharacter()
proc/CreateCharacter()
//lots of code here but not relivant
var/list/askillsfull = list((new obj/skills/attack/knife), (new obj/skills/attack/bluntshort) //I did not put all the object skills in this list. I only show the ones that are related to the errors I showed above to simplify things. It it works for more than 1 thing, it will work for more.
poolpoints=atk // atk is a number that was declaired earlyer in the program.
do
var/list/choices=new
var/obj/O
for(O in askillsfull)
choices["[O]"]=O
var/skillX=input(src,"What do you want to Learn?","Learn","Nevermind") in choices
var/skillX=input(src, help_text, prompt_title) in choices
if(skillX=="Nevermind") return
O=choices[skillX]
default_value = 0
var/numX
do//make sure player chooses a proper amount of points into the skill they chose.
if(poolpoints > 0)
i = 0
poollist = list(0)
while (i <= poolpoints)
poollist += i
i++
help_text = "How many points will you put to [skillX]? It must have at least 10 points in it. You have [poolpoints] points to spend."
numX = input(src, help_text, prompt_title, default_value) in poollist
while (numX > 0 && numX < 10 || (poolpoints-numX)<10 && (poolpoints-numX)>0)
poolpoints -= numX
askillsfull[O]=numX
O=new O.type // create a new object of this type
O.loc=usr
while(poolpoints > 0)// If there are points left, let player choose another skill.
#######################</10></10>
|
When using type paths in DM, they start with a (back?)slash.