ID:170453
 
I'm making an RPG, and I need help on how I would go about making a level up system. I tried using if's and telling it to check if the usr's experience is equal to a certain number, but If the usr jumps right over the required amount, they don't get a level up. For example, let's say you need 5 exp to lvl up. On my game, if they have 4 exp, gain 2 to get 6, they don't get the lvl up because they need 5. I need help.
mob/proc/Level()
if(src.experience >= 5) //If its greater than OR equal too this way if you have 6 you still level.
src.level += 1
//do level up stuff here
In response to Dession
But then wouldn't that mean that everytime you gain experience after that you level up too?
In response to Seraphrevan
Then change their experience back to 0. :)
In response to Hell Ramen
So then, after the lvl up code, would I put
usr.exp = (0)

?
In response to Seraphrevan
Without the "()"s.
In response to Seraphrevan
src.exp = 0...
In response to Seraphrevan
Ugh no usr in proc.
In response to Seraphrevan
C'mon, this is basic 'logic' thinking. You don't need to know how to program to design a system of rules that will let you "do something" "when something is something".

Just work it out, write it down. It's logic.
In response to Elation
He wasn't asking for a system, he was asking for help on his piece of programming, odd thing for this forum, eh?

As for help to Seraphrevan, i'd reccommend looking up info on ==, !=, <=, >= and all the other operators using the nifty F1 function, or ask Wizkidd0123, he's a real 'Wiz' (heh) with operators.

-Thorg
In response to Thorg
Thorg wrote:
He wasn't asking for a system, he was asking for help on his piece of programming, odd thing for this forum, eh?

As for help to Seraphrevan, i'd reccommend looking up info on ==, !=, <=, >= and all the other operators using the nifty F1 function, or ask Wizkidd0123, he's a real 'Wiz' (heh) with operators.

-Thorg

I was referring to this:

"
But then wouldn't that mean that everytime you gain experience after that you level up too?
"
In response to Elation
He was asking a question about the information he was given, maybe even being more specific after getting an answer he didn't expect, but even so, I never noticed that and your comment is valid, if not a little trite.

-Thorg