Re: [Stupid newbie coder] Question

From: Nuku Nuku (backdoor@wam.umd.edu)
Date: 05/21/96


> > xp_percent = GET_EXP(ch) / titles[(int) GET_CLASS(ch)][GET_LEVEL(ch)+1].exp;
> >
> > xp_percent should be the approx, percentage of xp the character has
> > gotten for his next level.  I've gotten all sorts of errors, done all
> > sorts of fixes, but for some reason, i always get < .1
> >
> > What's wrong with it?
> 
> If you are using the circle cumulative experience method, say they have
> 10000 exp, and 11,000 is required for the next level...  you need to
> subtract the exp they have for their current level first:
> 
> float xp_percent;
> xp_percent = (GET_EXP(ch)-titles[(int)GET_CLASS(ch)][GET_LEVEL(ch)]) /
>               titles[(int)GET_CLASS(ch)][GET_LEVEL(ch)+1];

gcc -c -g -O -Wall -fno-strict-prototypes  act.informative.c
act.informative.c: In function `do_score':
act.informative.c:674: warning: array subscript has type `char'
act.informative.c:675: invalid operands to binary /
act.informative.c:633: warning: `xp_percent' might be used uninitialized 
in this
 function
*** Error code 1
make: Fatal error: Command failed for target `act.informative.o'
Current working directory /var/circle30bpl11/src
*** Error code 1
make: Fatal error: Command failed for target `all'

I had originally gotten through this by a big case statement, assigning 
an integer according to what class it was.  Anyway, im completely stuck.
thanks:)



This archive was generated by hypermail 2b30 : 12/18/00 PST