A question on movement speed.

Started by GrimTrigger, March 06, 2013, 01:46:13 pm

Previous topic - Next topic

GrimTrigger

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?

KK20

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.





   


   
   


   
   

Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!



Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

GrimTrigger

O.o it's so simple....how did I not see it....


Thanks !

Heretic86

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...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Moshan

 Also, is not working with Blizz-abs. If you jump the game will crash.

Wecoc

March 14, 2013, 08:10:48 am #5 Last Edit: March 15, 2013, 12:49:13 pm by Wecoc
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.

ThallionDarkshine

That would remove the whole point of using floating point values.

Heretic86

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.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Wecoc

May 26, 2013, 01:24:22 pm #8 Last Edit: May 26, 2013, 02:10:03 pm by Wecoc
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

Blizzard

.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
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.