Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Sun Nov 12, 2006 9:39 pm   

Maybe a bug? [1.15]
 
I'm not sure if this is a bug or bad code, but here we go.

I have a trigger to capture my experience, the action of the trigger is.
#var exp %1
#math exp2 %1-@EXP
#MATH EXPTONEXTLVL {%db(@LVLEXP,@LVLNEXT)}-@EXP
#add expgain @exp2


I display in my status window my current exp, how much exp i've gained since the last time i've checked, how much exp until my next level, and grand total counter of exp i've gathered since i logged in.

the problem is the exp gain variable keeps showing that I just gained whatever my current exp is, and won't update. Also the exp gained from the last time i've checked always stays 0.

The here is how the trigger works in zmud (which faults even more in cmud):
#math exp2 %1-@exp
#var exp %1
#math ExpToNextLvl (%db( @LvlExp, %eval( @Lvl + 1)) - @exp)
#add expgain @exp2


So is this a bug? or just bad code? And if it's code, how can I clean it up?
_________________
Yama
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Nov 13, 2006 8:23 pm   
 
There is currently a bug in the %db function that is treating the result as a string. This should be fixed soon.
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Mon Nov 13, 2006 10:59 pm   
 
*nod* I won't spend too many hours thinking of an alternative then.

This version is light years ahead of the 1.00-1.01 releases, keep up the good progress.
_________________
Yama
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Nov 13, 2006 11:35 pm   
 
The current work-around is to put %int around the %db function:

#math ExpToNextLvl (%int(%db( @LvlExp, %eval( @Lvl + 1))) - @exp)
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Tue Nov 14, 2006 2:17 pm   
 
If that's the same as changing the variable type from autotype to integer, that will work too.
_________________
Yama
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net