Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Rocco on Sun 05/02/2006 22:09:16

Title: Wrong value when increasing float (SOLVED)
Post by: Rocco on Sun 05/02/2006 22:09:16
unfortunatly, i guess i encounter a bug,
who makes my intention much more difficult.

example code:

float test = 0.0;
player.Say("Value before %d", test);
test += 0.1;
player.Say("Value after %d", test);


this generates values like 1038457954
Title: Re: BUG: float += float
Post by: Kweepa on Sun 05/02/2006 22:19:28
%d is used to print ints.
Use %f to print floats.
The first print statement works because 0 int is the same internal representation as 0 float.
Title: Re: BUG: float += float
Post by: Rocco on Sun 05/02/2006 22:28:07
ohh ok, sorry.
this means the strange behavior is in my script (and not in the floats).
thxÃ,  :)