Chaos Project

RPG Maker => General Discussion => Topic started by: GrimTrigger on March 06, 2013, 01:46:13 pm

Title: A question on movement speed.
Post by: GrimTrigger on March 06, 2013, 01:46:13 pm
Is it possible to modify the movement speed of a  character more than just the (movement speed) option? To expand on this, I find the speed of 3 to be give for slow walking, but 4 seems too fast. I'd love  achieve a 3.5 if possible.

Any way to make that happen?
Title: Re: A question on movement speed.
Post by: KK20 on March 06, 2013, 02:15:32 pm
There's a variable called move_speed in Game_Character. You can change the value to anything really. Since you only want to change the game player's speed, a simple
$game_player.move_speed = 3.5
will do the trick.
Title: Re: A question on movement speed.
Post by: GrimTrigger on March 06, 2013, 02:32:09 pm
O.o it's so simple....how did I not see it....


Thanks !
Title: Re: A question on movement speed.
Post by: Heretic86 on March 11, 2013, 04:33:58 pm
I have to make a note on this.

When the players movement speed is not a whole number (3 or 4, but not decimals, 3.5), you need to expect some Screen Tearing.  That is to say that a lot of graphics will not line up correctly for their positions, so you'll see underneath stacked graphics.  Well, in XP anyway...
Title: Re: A question on movement speed.
Post by: Moshan on March 12, 2013, 02:38:49 am
 Also, is not working with Blizz-abs. If you jump the game will crash.
Title: Re: A question on movement speed.
Post by: Wecoc on March 14, 2013, 08:10:48 am
Quote from: Heretic86 on March 11, 2013, 04:33:58 pm
I have to make a note on this.

When the players movement speed is not a whole number (3 or 4, but not decimals, 3.5), you need to expect some Screen Tearing.  That is to say that a lot of graphics will not line up correctly for their positions, so you'll see underneath stacked graphics.  Well, in XP anyway...


What if you change on Game_Character 2 's update_move:

distance = 2 ** @move_speed

to this?

distance = 2 ** (@move_speed).round


That should work...

Edit: Oups, sorry it's true. I did not check it.
Title: Re: A question on movement speed.
Post by: ThallionDarkshine on March 14, 2013, 11:39:24 am
That would remove the whole point of using floating point values.
Title: Re: A question on movement speed.
Post by: Heretic86 on March 15, 2013, 05:03:42 pm
You might also try changing @move_speed = (int) to @move_speed = (int) * 1.0, which will force it to remain a decimal.

4 is a whole number
4.0 is a decimal

Although the value is the same, the engine recognizes 4.0 as a decimal, which may prevent crashes.
Title: Re: A question on movement speed.
Post by: Wecoc on May 26, 2013, 01:24:22 pm
Sorry for this necro but I was silly there. When I said
distance = 2 ** (@move_speed).round

I wanted to say
distance = (2 ** @move_speed).round


I checked it and it seems to work with 3, 3.5, 4, 4.5, 5 .... no with 3.2, just halfs :( but it's something xD
Title: Re: A question on movement speed.
Post by: Blizzard on May 26, 2013, 06:26:12 pm
.round still returns a float value. Simply convert it to an integer right after that.

distance = (2 ** @move_speed).round.to_i


EDIT: Or if you want to round the moving speed before the power operation.

distance = 2 ** @move_speed.round.to_i