Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: placyd on Fri 29/02/2008 20:04:12

Title: Character speed with a non-integer number
Post by: placyd on Fri 29/02/2008 20:04:12
Is there a way to set the character speed to a non-integer number, like 1,5?
Because my character walks too slow with the speed of 1, but walks too fast with the speed of 2. I can enter 1.5, but the speed doesn't change.
Title: Re: Character speed with a non-integer number
Post by: on Fri 29/02/2008 22:42:26
Speed is always a whole integer, but I am surprised that you consider 2 "to fast"- what are you using as a main character, a snail in a wheelchair? (no offence)
Title: Re: Character speed with a non-integer number
Post by: Gilbert on Sat 01/03/2008 01:58:58
Since V2.72, AGS actually supports walking/moving speed that is a fraction, if you put a negative number, say -2, the speed is equivalent to 1/2, so you can make your characters/objects move slower if you wish.

UNFORTUNATELY,  it doesn't support speed like 1.5, 2.3, etc. (partially because of how moving/pathfinding/etc. is done in the engine), so what you want to have can't be done directly at the moment.
Title: Re: Character speed with a non-integer number
Post by: placyd on Sat 01/03/2008 11:10:57
 ;D No, it's not a snail in a wheelchair, just a man.
Thanks for the answers, pity that I can't set this, but speed 1 maybe will be good for me.
Title: Re: Character speed with a non-integer number
Post by: Emerald on Sat 01/03/2008 15:34:43
You could set a SkipUntilCharacterStops(cChar) command
so that when you press a certain key, the game skips to the point when the character stops moving (like in The Longest Journey).
Title: Re: Character speed with a non-integer number
Post by: Radiant on Sun 02/03/2008 09:56:09
This is a hack, but you can use SetGameSpeed () to compensate.
Title: Re: Character speed with a non-integer number
Post by: Mikey on Mon 03/03/2008 16:24:19
why dont you just rescale the background?
Title: Re: Character speed with a non-integer number
Post by: subspark on Mon 03/03/2008 22:36:23
Nobody has asked why you need such an incremental adjustment to movement speed. If your trying to footsync, then I suggest you use the techniques presented in this thread:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=33099.0 (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=33099.0)

Or you could have a read of the Wiki which has an article dedicated to jerky motion. I'm not sure if this is your issue but I've mentioned it anyway.

http://americangirlscouts.org/agswiki/Graphics%2C_Characters%2C_Text_%26_Rooms#Jerky_character.2Fsprite_animation (http://americangirlscouts.org/agswiki/Graphics%2C_Characters%2C_Text_%26_Rooms#Jerky_character.2Fsprite_animation)

Cheers,
Paul.