ID:161091
 
mob/proc LevelCheck()
if(src.Exp>=src.Nexp)
src<<" You gained a level!"
src.Level+=1
src.MaxHP+=rand(1,5)
src.MaxMP+=rand(1,5)
src.Str+=rand(3,5)
src.Def+=rand(2,5)
src.HP=src.MaxHp
src.MP=src.MaxMP
src.Exp=src.Exp-src.Nexp
src.Nexp*=2
this is my leveling proc i want to have it so it gives more stats as you go higher any one know how to do it?
Easy.

mob/proc LevelCheck()
if(src.Exp>=src.Nexp)
if(src.level >= 10)//change the number to whatever you want, the higher the number the more time it takes until you get better training
src<<" You gained a level!"
src.Level+=1
src.MaxHP+=rand(1,5)
src.MaxMP+=rand(1,5)
src.Str+=rand(3,5)
src.Def+=rand(2,5)
src.HP=src.MaxHp
src.MP=src.MaxMP
src.Exp=src.Exp-src.Nexp
src.Nexp*=2

if(src.Exp>=src.Nexp)
if(src.level >= 11)//so when a player is higher then level 11 give them better boosts.
src<<" You gained a level!"
src.Level+=1
src.MaxHP+=rand(5,10)//higher hp bonus
src.MaxMP+=rand(5,10)//higher maxmp bonus
src.Str+=rand(6,10)//higher str bonus
src.Def+=rand(4,10)/higher def bonus
src.HP=src.MaxHp//You could change the numbers in the rand to what you want.
src.MP=src.MaxMP
src.Exp=src.Exp-src.Nexp
src.Nexp*=2
In response to Element Hero creator
That would be a lot of work depending how often the leveling up bonuses change and how high a level his players can go.
In response to Element Hero creator
dude when i put this code

mob/proc LevelCheck()
if(src.Exp>=src.Nexp)
if(src.level >= 10)//change the number to whatever you want, the higher the number the more time it takes until you get better training
src<<" You gained a level!"
src.Level+=1
src.MaxHP+=rand(1,5)
src.MaxMP+=rand(1,5)
src.Str+=rand(3,5)
src.Def+=rand(2,5)
src.HP=src.MaxHp
src.MP=src.MaxMP
src.Exp=src.Exp-src.Nexp
src.Nexp*=2

if(src.Exp>=src.Nexp)
if(src.level >= 11)//so when a player is higher then level 11 give them better boosts.
src<<" You gained a level!"
src.Level+=1
src.MaxHP+=rand(5,10)//higher hp bonus
src.MaxMP+=rand(5,10)//higher maxmp bonus
src.Str+=rand(6,10)//higher str bonus
src.Def+=rand(4,10)/higher def bonus
src.HP=src.MaxHp//You could change the numbers in the rand to what you want.
src.MP=src.MaxMP
src.Exp=src.Exp-src.Nexp
src.Nexp*=2

it gives me 23 problems
its says

loading DBZ SAIYANS REBORN.dme
npc.dm:3: Inconsistent indentation.
npc.dm:4: Inconsistent indentation.
npc.dm:5: Inconsistent indentation.
npc.dm:6: Inconsistent indentation.
npc.dm:7: Inconsistent indentation.
npc.dm:8: Inconsistent indentation.
npc.dm:9: Inconsistent indentation.
npc.dm:10: Inconsistent indentation.
npc.dm:11: Inconsistent indentation.
npc.dm:12: Inconsistent indentation.
npc.dm:13: Inconsistent indentation.
npc.dm:16: Inconsistent indentation.
npc.dm:17: Inconsistent indentation.
npc.dm:18: Inconsistent indentation.
npc.dm:19: Inconsistent indentation.
npc.dm:20: Inconsistent indentation.
npc.dm:21: Inconsistent indentation.
npc.dm:22: Inconsistent indentation.
npc.dm:22:error: def: expected end of statement
npc.dm:23: Inconsistent indentation.
npc.dm:24: Inconsistent indentation.
npc.dm:25: Inconsistent indentation.
npc.dm:26: Inconsistent indentation.

DBZ SAIYANS REBORN.dmb - 23 errors, 0 warnings (double-click on an error to jump to it)
In response to Junior197
Lol read the errors, Im DEFINITLY no coder pro ( let alone beginner) but even I know that. You indents/spaces are wrong
Just erase the tabs in each line, and remake em so they are placed correctly under their parent.
In response to ShadowPrince2008
LOL PLEASE TELL ME A LEVELING CODE THAT WORKS.
In response to Omega747
IM A BEGINNER I DONT KNOW HOW TO DO THAT.PLEASE EDIT MY CODE AND SEND IT TO ME.PLEASE PLEASE
In response to Junior197
I believe he means you'll want to develop some type of formula for getting better gains as you gain more levels instead of statically changing the benefits for each level, and I agree. What you should do is decide on a formula that fits your game. You don't want players to gain too quick, but gaining too slow will not make a real difference. A simple example would be to add 1 to your range for every 10 levels.

mob/proc/MyLevelUpProc()
if(exp_needed >= exp)
level++
var/range_modifier = round(level / 10)

health += rand(1, 5) + range_modifier
magic += rand(1, 5) + range_modifier
strength += rand(3, 5) + range_modifier
defense += rand(2, 5) + range_modifier

exp -= exp_needed
exp_needed *= 2

spawn() // Just in case they have enough exp to level up again.
MyLevelUpProc()
In response to YMIHere
The leveling proc is already good enough for him, YMI. Also, do note that his problem at the moment is not the leveling, it's the fact, I seriously believe, he just copy pasted the leveling code and didn't look at it.

He has to fix the spaces. He has to delete all the tabs/spaces, and then insert them accordingly. If he doesn't know how to do that, he has to read the DM Guide, and the other guides.

~Duper
In response to Duper
Duper wrote:
The leveling proc is already good enough for him, YMI.

I beg to differ. Setting up a separate clause for each level is not a great idea. It may be workable for a low level cap game, but in general it's just not a good idea.

Also, do note that his problem at the moment is not the leveling, it's the fact, I seriously believe, he just copy pasted the leveling code and didn't look at it.

True, that could be explained, but when it came from the other suggestion (aside from the missing newline) I didn't bother to confuse him with an unneeded explanation. I just provided a better alternative.

He has to fix the spaces. He has to delete all the tabs/spaces, and then insert them accordingly.

No, he has to not go with the idea that means his level up proc gains 10 lines for every level that can be gained.

If he doesn't know how to do that, he has to read the DM Guide, and the other guides.

By all means tell him to read the guide (by the way Junior, I do suggest you read it, indentation is covered in the first two chapters), but don't defend a snippet with a bad design.
In response to Junior197
How about no.
In response to YMIHere
I meant "for him". Not for the rest of us.

I meant identation. He has to fix the identation errors. That's what I meant with the tabs/spaces.

I'm not defending the snippet. I'm saying it's good for him, but not for the rest of us. It's just an example, and he seems to be relatively new, so he mustn't have any big projects in mind.
In response to Duper
Duper wrote:
I'm not defending the snippet. I'm saying it's good for him, but not for the rest of us. It's just an example, and he seems to be relatively new, so he mustn't have any big projects in mind.

Its not a good snippet no matter how big or small a project is, or how new a person is. Using bad programming principles is never okay.
In response to YMIHere
Instead of using spawn and calling it again, wouldn't it be better to use while() in place of the if()?
In response to Jeff8500
Indeed, definitely.