ID:180740
 
I'm tring to get leveling to work...this is what I thoght of:

var/list/fighterLevels = list(100, 2000, 4000, 8000, 16000)

mob/
var/list/expLevelList
var/exp
var/level
var/savefile="player.sav"
expLevelList
level = 1
New()
..()
usr.expLevelList = 100
usr << "You gained [++exp]!"

proc/AddExperience(myAmount)
exp += myAmount
if(exp >= expLevelList[level+1])
usr << "You are now level[++level]!"
var/max_HP
max_HP += 3
var/max_shield
max_shield += 3
var/max_iq
max_iq += 3
var/max_dexterity
max_dexterity += 3
var/max_armor
max_armor += 3

but no message shows saying you are now level #...in fact nothing happens and I have no errors or warnings...
proc/AddExperience(myAmount)
exp += myAmount
if(exp >= expLevelList[level+1])
usr << "You are now level[++level]!"
var/max_HP
max_HP += 3
var/max_shield
max_shield += 3
var/max_iq
max_iq += 3
var/max_dexterity
max_dexterity += 3
var/max_armor
max_armor += 3

but no message shows saying you are now level #...in fact nothing happens and I have no errors or warnings...

Declaring the vars max_HP, max_shield, etc., within the proc makes them local to the proc they're in... in other words, at the end of the proc, the vars disappear. You need to declare them as vars of the mob, not the proc.