ID:267763
![]() Sep 24 2003, 7:24 am
|
|
Ive imputted a leveling system into my game but the exp just goes over the limit and doesnt do anything please help .
|
mob
proc Levelup() if(src.exp>=src.Max_exp) src.level++ src.exp=0 src.Max_exp*=2 src<<"You gained a level!" src.Statup() else ..() mob proc Statup() src.strength+=1 src.Max_HP+=20 src.HP=src.Max_HP src<<"Your stats increase!" What you gave me just gives me a load of errors this is what I have for a leveling system |
Well you could of told me you had made procs for it already :P
Just put src.Levelup() after all the things that could affect their EXP. ~Ease~ <font size = -3>Everything is at ease with Ease</font> |
When you go up a level, do you reset the experience back to zero, aswell as raising the required experience?
|
mob
proc Levelup() if(src.exp>=src.Max_exp) src.level += 1 src.exp = 0 src.Max_exp *= 2 src << "You gained a level!" src.Statup() else ..() mob proc Statup() src.strength += 1 src.Max_HP += 20 src.HP = src.Max_HP src << "Your stats increase!" your code works properly make sure that whatever your hitting has the usr.Levelup()to check the exp. |
It doesn't seem to matter what I do with the code it just keeps going over the max_exp i think it's more a bug than a code problem but someone moved it into newbie central .
|
The leveling system works but i can code a monster to just give exp and it still wont make it level up .
|
mob
NPC Headthrower name = "Head thrower" icon = 'Head.dmi' HP = 10 Max_HP = 10 strength = 2 exp_give = 5 exp = 5 src.Levelup() money_give = 5 var/mob/PC/P New() . = ..() spawn() Wander() proc/Wander() while(src) var/Found = FALSE for(P in oview(5)) step_towards(src,P) Found = TRUE break if(Found != TRUE) step_rand(src) sleep(10) sleep(5) Bump(mob/M) if(istype(M,/mob/PC)) Attack(M) proc/Attack(mob/M) flick("Head_Attack",src) sleep(2) var/damage = rand(1,strength) M.HP -= damage view(src) << "[src] attacks [M]!" view(src) << "[damage] damage!" M.Death() This is a sample monster the spaces are a bit wrong on this but this i s what i code them like cud this be whats wrong . |
Lauren wrote:
your code works properly make sure that whatever your >hitting has the usr.Levelup()to check the exp. ...If thats in a proc, that should be src.Levelup(), You should find Lummox JRs post on byondscape. |
please help me with this if ne1 knows how to solve it i need help ive put my game on byond 2 find and look at if you can help .
Its called headthowers domain if you need the whole coding i could email me . |
~Ease~
<font size = -3>Everything is at ease with Ease</font>