ID:1698758
 
Code:
mob/var
Level= 1
Exp= 0
Nexp= 100
HP= 1000
MaxHP= 1000
Str= 100
Def= 50
Energy= 500

mob
Stat()
statpanel("[src]'s Stats")
stat("Level:","[src.Level]")
stat("EXP:","[src.Exp]/[src.Nexp]")
stat("Health:","[src.HP]/[src.MaxHP]")
stat("Strength:","[src.Str]")
stat("Defense:","[src.Def]")
stat("Chakra:","[src.Energy]")

mob/proc/GainEXP(n)
src.Exp+= n
if(src.Exp>= src.Nexp)
src.Level_Up()

mob/proc/Level_Up()
src.Level++
src << "You're now Level [src.Level]!"
src.MaxHP*= 2.78
src.HP= src.MaxHP
src.Nexp= src.Nexp*2.75


Problem description:

when I compile, I have no errors, but when I test the game, I set up a Train verb to automatically gain exp+ per click on the verb... but for some reason... when the exp reaches Nexp, it won't level up automatically like it should... can anyone explain?

The Experience just keeps raising and raising.
put src.exp-=src.nexp in levelup proc


can i be hokage
Can i suggest something to you? Don't you think it's better to put if(src.EXP >= src.Nexp) in Level_UP() instead of GainEXP() and call LevelUP each time GainEXP() is called?
I tried both ways. Neither or worked. The Exp still just keeps raising.
Mind showing the Train Verb?
All I have for the verb is
Train()
Exp+= 25

that is a problem right?
No wonder. You don't have GainExp(25), therefore it's not calling the Level_UP() proc stopping you from leveling.
I just figured that out. >_= src.Nexp with the other codes under the train, it worked. xD lesson learned. I will be posting some more if help needed though thanks.
nvm i dont want hokage
zagros5000 you can be hokage when the game is completed. I just started coding things in so it'll be awhile before it's complete. I got the login with character select in, it saves when you quit. And now I finally got the leveling in. I have a lot to do yet before anything. But will keep you in mind for hokage position. Friend me on here.