ID:267709
 
in my game, every time you hit a punch-bag, it'll give you about 12 experience, once you get to over 1000 experience, you level up and the experience is reset to 0.(thats what i want it to do)

at the moment all it does is

....................................................!

I think it may be due to the main Login() proc, because i've set the experience and level to 0.

I know its not the greatest of information, but can someone please help me?

-~Evil Guy~-

If you need it to be re-written, or you need some coding in it, tell me.
Punching bags? Bad idea. Really bad idea. Do you know what people will do? They'll make a macro for "punch pbag", place a heavy object on that key, and leave it running for half an hour. Instant level 10,000.

Anyway, it's not realistic. I could punch a bag for hours on end, and not increase my fighting skills one bit. Strength maybe, but not skill. Bags don't tend to dodge a whole lot. =P

You should have a different method of experience. If your game involves killing monsters, give experience for that. If there are quests to do, give experience for those. Or you could use the Hedgerow Hall model, and give experience based on playing time.
In response to Crispy
it will, but at the moment, i want to know why, the experience isn't rising
In response to Evil Guy
Then I want to see your existing code. =P
Suggestion: Limit the experience a person can gain from a punching bag per level. If it takes 1000 experience points to level up the first time, then limit this to 600 or so. It forces people to use some variety in how they build up their character.

This isn't all that hard to handle:
mob
var/list/training
var/exp = 0
var/exp_to_level = 1000
var/level = 1

proc/CheckLevel()
while(exp >= exp_to_level)
++level
exp -= exp_to_level
exp_to_level = round(exp_to_level * 1.5, 1)
// add level-based skills and magic here
src << "You are now at <b>level [level]</b>."
if(training) training.Cut() // reset exp types

proc/GainExp(amount, atom/A)
if(A.explimit >= 0)
if(!training) training = new
var/atype = A.training_type ? (A.training_type) : A.type
amount = min(amount, A.explimit - training[atype])
if(!amount) return
training[atype] += amount
exp += amount
CheckLevel()

atom
var/training_type // set this to a common class or null
var/explimit = 600 // exp limit per level

proc/HitBy(mob/M)

obj/punching_bag
HitBy(mob/M)
M.GainExp(rand(3, 12), src)

mob/critter/puny
training_type = /mob/critter/puny
explimit = 500

rabbit
chipmunk
rat
squirrel
The way I set up this system, each individual object type can have a training limit. You can only get 500 exp points total from killing little woodland creatures on each experience level, or 600 from hitting a punching bag. So on level 1, hitting the bag around a bit and then going out and skewering some critters would be enough to advance you, but later on you have to branch out and do something else.

This should solve some of the design flaws inherent in using training rooms. It'll make your game more interesting to play. If you want you can also extend this system, so for example you might have an experience limit on a specific kind of creature but also on their class, so maybe you can only get up to 200 for killing rabbits, but 500 total for killing small animals.

Lummox JR
In response to Lummox JR
thanks a lot man, thats worked great, i am in your debt.

**i'll forget, that i said that, but make sure you don't for sometime in the future!**