ID:146333
 
For my Leveling system when i hit a phbag or speed bag my Exp doesnt increase


mob
Stat()
stat("Level:",lvl)
stat("Exp:",exp)
stat("Exp Needed:",expn)
proc
lvlcheck()
if(usr.exp >=usr.expn)
usr.lvl +=1
usr.exp = 20
usr.expn = usr.expn * 2


i even tried

mob
Stat()
stat("Level:",lvl)
stat("Exp:",exp)
stat("Exp Needed:",expn)
proc
lvlcheck()
if(usr.exp >=usr.expn)
usr.lvl +=1
usr.exp = 20
usr.expn = usr.expn * 2


Nothing works,How can i fix this?
Govegtos wrote:
For my Leveling system when i hit a phbag or speed bag my Exp doesnt increase

You have to add the increase in experience in the proc that is called when you hit a "phbag" / "speed bag". :)

~Sinyc.
In response to Sinyc
What would be the coding or var or proc is that because this is my first time doing a leveling system
In response to Govegtos
also remove the usr. in the proc. You're abusing it read . here and here for more info.

EDIT: this won't help you with your 'problem' though.

EDIT2: something forces me to explain.. but you don't realise how easy it is. Just put the proc somewhere in the training proc/verb I.E:
bj
Weight
icon='blah.dmi'
icon_state="blah"
verb/lift()
usr.lvlcheck()// this is it..
usr.exp+=rand(1,2)//adds random exp. either 1 or 2
//ungh..if you don't even know how to call a proc..then(no offence) you're very bad coder...


O-matic
In response to O-matic
eg

obj
SpeedBag
icon = 'weight-objs1.dmi'
icon_state = "speed"
density = 1
verb
SpeedBag()
set name = "Speed-Bag"
set category = "Training"
set src in oview(1)
if(usr.flight == 1)
usr << "Not while flying."
if (usr.resting==1)
usr<<"Not while resting"
if(usr.flight == 0 && usr.resting==0)
if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speedhit",src)
flick("weight-training-right", usr)
usr.random = rand(1,3)
if(usr.random == 1)
usr.move = 1
usr.stamina-=1
usr.icon_state = ""
usr.maxpowerlevel += 10
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
if(usr.random == 3)
usr.move = 1
usr.stamina-=1
usr.lvlcheck()// this is it..

usr.exp+=rand(1,2)
usr.icon_state = ""
usr.maxpowerlevel += 50
usr.meditate = 0
usr.FlightLearn()
usr.KiTechLearn()
usr.AuraTechLearn()
usr.FocusLearn()
else
usr.maxpowerlevel += 0

else
usr << "You are too week to continue!."


Is that correct?
In response to Govegtos
WOAH WOAH WOAH, can you say macro heaven?

obj
SpeedBag
icon = 'trainobj.dmi'
icon_state = "sb1"
density = 1
verb
Attack()
set name = "Attack"
set category = "Train"
set src in oview(1)
if(usr.flyoff == 1)
usr << "Not while flying."
return
if (usr.meditate==1)
usr<<"Not while meditating"
return
if(usr.dir == 4)
if(usr.hittingbag==0)
usr.hittingbag = 1
flick("bag", usr)
usr.icon_state = ""
usr.exp += 1
usr.random = (rand(1,40))
sleep(5)
usr.hittingbag = 0
if(usr.random == 3)
usr<<"You feel stronger"
usr.strength += 1
usr.levelcheck()
else
usr << "You are not facing the bag."
Just add your procs and fiddle around with other stuff, BUT none the less it will stop allow some control over macros
In response to Govegtos
Govegtos wrote:
Is that correct?

Yeah, it could work.
In response to Govegtos
Govegtos wrote:
Is that correct?

No it isn't. Ripping zeta isn't correct. Not to mention you never taking people's advice with things like usr and boolean variables.