ID:165593
 
Code:


Problem description:
um can i just have like the base code for a game with a leveling up system... i tried to get one from a lib but when i did it i had 130 errors..

This is as basic as it gets, my friend.

proc/Levelup()
if(exp>=maxexp)
level+=1
exp=0
maxexp*=2
src<<"You have gained a level!"


You can change how much max experience they get per level, I just didn't feel like using a proper equation since I don't know how you want it. That should feed you with a little knowledge of how a basic leveling system would work.
In response to Muyoine Guyinne
Muyoine Guyinne wrote:
This is as basic as it gets, my friend.

proc/Levelup()
> if(exp>=maxexp)
> level+=1
> exp=0
> maxexp*=2
> src<<"You have gained a level!"

You can change how much max experience they get per level, I just didn't feel like using a proper equation since I don't know how you want it. That should feed you with a little knowledge of how a basic leveling system would work.

This is actually kinda bad, as the player may get enough experience to level up twice at once.

Lummox JR has a proper example on his BYONDscape article: (Dream Tutor:)For the Math of It