ID:158028
 
After a lengthy discussion with a very very appriciated friend, he finally drilled into me the way to make multidimentional lists.
Now I'm left with another problem,
At runtime, I want these lists to be made, but the name of the list will be player inputted, how, if possible, can you make a var, or list, with a name specified at runtime?
You wouldn't necessarily create a new variable. However, you could create your own list which functions similar to the vars list variable, and it could handle your own virtual variables.
atom
var/virtualVars

proc/setVar(varName, value)
if(varName in vars)
vars[varName] += value
else
if(!virtualVars)
virtualVars = new
virtualVars[varName] = value

proc/getVar(varName)
if(varName in vars)
return vars[varName]
if(varName in virtualVars)
return virtualVars[varName]
return 0

proc/incrementVar(varName, amount)
if(varName in vars)
vars[varName] += amount
else
if(!virtualVars)
virtualVars = new
virtualVars[varName] += amount

mob/deity
verb/createNewStatistic(statName as text, amount as num)
setVirtualVar(varName, amount)

verb/grantStatistic(statName in virtualVars, amount as num, mob/M as mob)
M.setVirtualVar(statName, amount)

verb/createMagicScroll(targetStatToChange as text, userStatToUse as text, multiplier as num, scrollName as text, scrollDesc as text)
var/obj/customScroll/S = new
S.name = scrollname
S.desc = scrollDesc
S.affects = targetStatToChange
S.usesStat = userStatToUse
S.multiplier = multiplier
S.Move(src)

obj/customScroll/S
icon = 'customScroll.dmi'
var
affects; usesStat; multiplier

verb/use(mob/target as mob in oview())
target.incrementVar(affects, usr.getVar(usesStat)*multiplier)

Something along those lines, for example. Though, with that, it introduces all sorts of problems, such as "What about when you're using that to make a special scroll that physically damages and you reduce health down to or less than 0, it doesn't kill you."