ID:726838
 
(See the best response by MasterSpectra.)
Code:
http://www.mediafire.com/?pinyobxk5nrbzko


Problem description:
Above is a link to 3 code i supply to show you which areas i need help on and advice.

I never made a post before but i got desperate after not being able to figure it out how to fix this stuff.

I'm a coder from Hitman reborn.

And I play many games on byond and one game that always stick in my mind is bleach shinizu.

Why? Because Of The Leveling System.
They had Control over how far someone can level but not putting a limit on them.

Basically, The problem is on my game. for some reason player are able to skips levels.

49-60 etc. The codes are suppose to delete exp from when it goes to .levelagain

But sometime it doesn't or it never does.
and maybe that why its an issue, but when i look at it i see nothing wrong.

And for advice, I like to ask Do you know a organize way to keep Monster in the same pace as the Chacater, Like you can beat these monster at these level, then get to these monster when ur stronger.


What system is the best for balance leveling.
Log? Skills Point? increase state as level<(Which lead back to level proc bug so cant do that)

In the .rar file I include.
Training - Which is my training proc for the game
Monster - the monster hp and strenght
BS - The Base Code

If you read all of this and answer i thank you cause i wrote this at 4:26am.

Thanks in advance

Let's take this one step at a time. Using the <dm></dm> tags, provide the code that controls when a person gains skills, a level, and loses exp.

It would be easier for you to provide the code on the forums than to have us download it. You'd never when that link may go down, thus disabling one from using it for future references.
Ok I'm just happy that someone reply :)!

mob/var
skilllevel=1
skillpoints=50
majoratribute=10000
minoratribute=500
critchance=5
chancein=0.1
mob/proc/levelup()
if(usr.exp>=usr.maxexp)
levelagain
usr.level+=1
usr.exp-=usr.maxexp
usr.skillpoints+=50
if(usr.level==10)
world << "<b>[usr] has reached level 10! You Feel A Warm Feeling inside your body - Gain SkillPoints"
usr.maxexp+=50
usr.skillpoints+=100
if(usr.level==30)
world << "<b>[usr] has reached level 30! You Feel A Strong Burning.Gain SkillPoints"
usr.maxexp+=100
usr.skillpoints+=100
if(usr.level==50)
world << "<b>[usr] has reached level 50!"
usr.maxexp+=200
usr.skilllevel=2
usr.majoratribute=450
usr.minoratribute=15
usr.chancein=0.1
usr.skillpoints+=100
if(usr.flamet=="Unknown")
if(usr.skygg)
flamet="Sky"
var/obj/Dskyring/B = new/obj/Dskyring
B.loc = usr
if(usr.stgg)
flamet="Storm"
var/obj/Dstring/B = new/obj/Dstring
B.loc = usr
if(usr.tgg)
flamet="Thunder"
var/obj/Dtring/B = new/obj/Dtring
B.loc = usr
if(usr.rgg)
flamet="Rain"
var/obj/Drring/B = new/obj/Drring
B.loc = usr
if(usr.mgg)
flamet="Mist"
var/obj/Dmring/B = new/obj/Dmring
B.loc = usr
if(usr.cgg)
flamet="Cloud"
var/obj/Dcring/B = new/obj/Dcring
B.loc = usr
if(usr.dgg)
flamet="Eclipse"
var/obj/Ddring/B = new/obj/Ddring
B.loc = usr
if(usr.sugg)
flamet="Sun"
var/obj/Dsuring/B = new/obj/Dsuring
B.loc = usr
if(usr.level==100)
world << "<b>[usr] has reached level 100 You Gain Enough Power Controll a sub flame!"
usr.maxexp+=20000
switch(input("Choose a Dying Will Sub Atribute", text) in list ("Cloud", "Eclipse", "Mist", "Storm", "Sun", "Thunder","Rain","Sky"))
if("Cloud")
usr.scgg=1
usr.subflamet="Cloud"
if("Eclipse")
usr.sdgg=1
usr.subflamet="Eclipse"
if("Mist")
usr.smgg=1
usr.subflamet="Mist"
if("Storm")
usr.sstgg=1
usr.subflamet="Storm"
if("Sun")
usr.ssugg=1
usr.subflamet="Sun"
if("Thunder")
usr.sutgg=1
usr.subflamet="Thunder"
if("Rain")
usr.srgg=1
usr.subflamet="Rain"
if("Sky")
usr.sskygg=1
usr.subflamet="Sky"
if(usr.level==150)
usr.skilllevel=3
usr.majoratribute=100
usr.minoratribute=5
usr.maxexp+=20000
usr.chancein=0.1
if(usr.level==200)
world << "<b>[usr] has reached level 200! You have gain some state boost"
usr.maxexp+=30000
if(usr.level==250)
world << "<b>[usr] has reached level 250!"
usr.maxexp+=50000
if(usr.exp>=usr.maxexp)
goto levelagain
mob/verb
Level_Up()
set category = "Training"
skills
if(usr.skillpoints)
switch(input("You have [usr.skillpoints] where would you like to spend some?", text) in list ("Stamina", "Dying Will", "Dying Will Power", "Defense", "Strength", "Speed", "Critical Damage Chance", "I wish to save them"))
if("Stamina")
switch(input("Stamina directly increases your Health it will cost [usr.skilllevel] skill points to increase your stamina by [usr.majoratribute], do you wish to spend [usr.skilllevel] skill points on Stamina?", text) in list ("Yes", "No"))
if("Yes")
var/nQty = input(usr, "How many points do you wish to spend?") as null|num
if (nQty == null)
nQty = 0
if(nQty < 0)
nQty = 0
if(usr.skillpoints<(usr.skilllevel*nQty))
usr <<"<B>Sorry you do not have enough skill points to level up your Stamina"
goto skills
usr.skillpoints-=(usr.skilllevel*nQty)
usr.maxhealth+=(usr.majoratribute*nQty)
usr.health=usr.maxhealth
if(usr.skillpoints>0)
goto skills
if("No")
goto skills
if("Dying Will")
switch(input("More Dying Will allows you to use your special abilities more often it will cost [usr.skilllevel] skill points to increase your Dying Will by [usr.majoratribute], do you wish to spend [usr.skilllevel] skill points on Dying Will?", text) in list ("Yes", "No"))
if("Yes")
var/nQty = input(usr, "How many points do you wish to spend?") as null|num
if (nQty == null)
nQty = 0
if(nQty < 0)
nQty = 0
if(usr.skillpoints<(usr.skilllevel*nQty))
usr <<"<B>Sorry you do not have enough skill points to level up your Dying Will"
goto skills
usr.skillpoints-=usr.skilllevel*nQty
usr.MDyingWill+=usr.majoratribute*nQty
usr.DyingWill=usr.MDyingWill
if(usr.skillpoints>0)
goto skills
if("No")
goto skills
if("Dying Will Power")
switch(input("Dying Will Power directly increases your special abilities damage it will cost [usr.skilllevel] skill points to increase your Dying Will Power by [usr.minoratribute], do you wish to spend [usr.skilllevel] skill points on Dying Will Power?", text) in list ("Yes", "No"))
if("Yes")
var/nQty = input(usr, "How many points do you wish to spend?") as null|num
if (nQty == null)
nQty = 0
if(nQty < 0)
nQty = 0
if(usr.skillpoints<(usr.skilllevel*nQty))
usr <<"<B>Sorry you do not have enough skill points to level up your Dying Will Power"
goto skills
if((usr.mdef*0.5+usr.Mstr*0.5)<usr.mDWP)
usr<<"<B>Your DWP is to strong! Train Your other stats to train this further!"
goto skills
usr.skillpoints-=usr.skilllevel*nQty
usr.mDWP+=usr.minoratribute*nQty
usr.DWP=usr.mDWP
if(usr.skillpoints>0)
goto skills
if("No")
goto skills
if("Defense")
switch(input("Defense directly decreases damage to your Health from Most attacks it will cost [usr.skilllevel] skill points to increase your defense by [usr.minoratribute], do you wish to spend [usr.skilllevel] skill points on defense?", text) in list ("Yes", "No"))
if("Yes")
var/nQty = input(usr, "How many points do you wish to spend?") as null|num
if (nQty == null)
nQty = 0
if(nQty < 0)
nQty = 0
if(usr.skillpoints<(usr.skilllevel*nQty))
usr <<"<B>Sorry you do not have enough skill points to level up your Defense"
goto skills
if((usr.mDWP*1.1+usr.Mstr*1.1)<usr.mdef)
usr<<"<B>Your Defense is to strong! Train Your other stats to train this further!"
goto skills
usr.skillpoints-=usr.skilllevel*nQty
usr.mdef+=usr.minoratribute*nQty
usr.def=usr.mdef
if(usr.skillpoints>0)
goto skills
if("No")
goto skills
if("Strength")
switch(input("Strength directly increases your Damage with physical oriented attacks it will cost [usr.skilllevel] skill points to increase your strength by [usr.minoratribute], do you wish to spend [usr.skilllevel] skill points on Strength?", text) in list ("Yes", "No"))
if("Yes")
var/nQty = input(usr, "How many points do you wish to spend?") as null|num
if (nQty == null)
nQty = 0
if(nQty < 0)
nQty = 0
if(usr.skillpoints<(usr.skilllevel*nQty))
usr <<"<B>Sorry you do not have enough skill points to level up your Strength"
goto skills
if((usr.mdef*0.5+usr.mDWP*0.5)<usr.Mstr)
usr<<"<B>Your Strenght is to strong! Train Your other stats to train this further!"
goto skills
usr.skillpoints-=usr.skilllevel*nQty
usr.Mstr+=usr.minoratribute*nQty
usr.str=usr.Mstr
if(usr.skillpoints>0)
goto skills
if("No")
goto skills
if("Critical Damage Chance")
switch(input("Critical Damage Chance directly increases your chane that an attack will deal Critical damage it will cost [usr.skilllevel+1] skill points to increase your Critical chance by [usr.chancein]%, do you wish to spend [usr.skilllevel+1] skill points on Critical Chance?", text) in list ("Yes", "No"))
if("Yes")
var/nQty = input(usr, "How many points do you wish to spend?") as null|num
if (nQty == null)
nQty = 0
if(nQty < 0)
nQty = 0
if(usr.skillpoints<(usr.skilllevel*nQty))
usr <<"<B>Sorry you do not have enough skill points to level up your Critical Chance"
goto skills
if(usr.critchance==100)
usr <<"<B>You Already Have Max Crit Chance!! Please Spend Your Skill Points on Somthing Else"
goto skills
usr.skillpoints-=usr.skilllevel*nQty
usr.critchance+=usr.chancein*nQty
if(usr.critchance>100)
critchance=100
if(usr.skillpoints>0)
goto skills
if("No")
goto skills
if("Speed")
switch(input("Speed directly increases how fast your charecter can move, it will cost [usr.skilllevel] skill points to increase your speed by one one-hundredth of a second, do you wish to spend [usr.skilllevel] skill points on Speed?", text) in list ("Yes", "No"))
if("Yes")
var/nQty = input(usr, "How many points do you wish to spend?") as null|num
if (nQty == null)
nQty = 0
if(nQty < 0)
nQty = 0
if(usr.skillpoints<(usr.skilllevel*nQty))
usr <<"<B>Sorry you do not have enough skill points to level up your Critical Chance"
goto skills
if(usr.walkdelay<=1)
usr <<"<B>You Already Have Max Speed!! Please Spend Your Skill Points on Somthing Else"
goto skills
usr.skillpoints-=usr.skilllevel*nQty
usr.walkdelay-=nQty/100
if(usr.walkdelay<1)
usr.walkdelay=1
if(usr.skillpoints>0)
goto skills
if("No")
goto skills
if("I wish to save them")
return



And for the secound part that where player spend theres skills point. Any idea on how to make it managable how much they increase states maybe by 5,10,20, etc
first of all make all usr = src and instead of usr.exp-=usr.maxexp

do usr.exp = 0
:P I'll try that whybe.
i mean src.exp = 0 well the same thing praticly
In response to Whybe
Best response
Unless you say that:

Experience: 99
Max_Exp: 100

You gain 10 exp from a monster kill.

Means your exp lands on 109. That would mean that the last 9 will be reduced to 0.

But I agree, resetting the experience to 0 is a good idea to avoid a few bugs.
first time helping :P
Tried src.exp but it wasn't compitable enough but i recheck all the exp. user.exp etc. to see if theres any thing that would bug it gonna test out now.
vote for me if it works :D
Its so so fixs.
So?....umm is there anything wrong with my leveling proc