[RMVX ACE] LOOKING FOR A WAY TO SET A MORE SPECIFIC MOVEMENT SPEED

Posts

Pages: 1
I'm looking for a way to set the players movement speed to something between speed 4 and 5. 4 is too slow for me, and 5 is too fast. Is there any way to do this? Maybe with a script call? Thanks!
Marrend
Guardian of the Description Thread
21781
Definitely a script-call. The thing I eventually came up with looks a little something like...

def set_custom_speed(event_id, speed)
  move_route = RPG::MoveRoute.new
  move_route.repeat = false
  move_route.skippable = true
  move_route.wait = false
  
  m = RPG::MoveCommand.new
  m.code = 29
  m.parameters = [speed]
  move_route.list.insert(0, m.clone)
  
  if event_id == 0
    $game_player.force_move_route(move_route)
  else
    $game_map.events[event_id].force_move_route(move_route)
  end
end

...this. While I did perform a look-up in Ace's help file, and referencing Game_Character to obtain the right value for the "m.code" variable, I'll also give thanks to the script call collection concerning move-routes.

*Edit: The event-commands used by my test-event:

Input Number: [0001:num], 2 digits
Script: $game_variables[1] = $game_variables[1] / 10.0
Script: set_custom_speed(0, $game_variables[1])
author=Marrend
Definitely a script-call. The thing I eventually came up with looks a little something like...

def set_custom_speed(event_id, speed)
  move_route = RPG::MoveRoute.new
  move_route.repeat = false
  move_route.skippable = true
  move_route.wait = false
  
  m = RPG::MoveCommand.new
  m.code = 29
  m.parameters = [speed]
  move_route.list.insert(0, m.clone)
  
  if event_id == 0
    $game_player.force_move_route(move_route)
  else
    $game_map.events[event_id].force_move_route(move_route)
  end
end


...this. While I did perform a look-up in Ace's help file, and referencing Game_Character to obtain the right value for the "m.code" variable, I'll also give thanks to the script call collection concerning move-routes.

*Edit: The event-commands used by my test-event:

Input Number: [0001:num], 2 digits
Script: $game_variables[1] = $game_variables[1] / 10.0
Script: set_custom_speed(0, $game_variables[1])



Oh hey, thank you! Sorry, I didn't see the notification for this and I assumed no one responded.

I am getting an issue with this, though. I have the script in my materials, and when I use the script call Script: set_custom_speed(0, $game_variables) it does change the player speed, however regardless of what number I set it to it always changed it to an incredibly low speed. It's almost as if the player sprite is walking in place. Do you know what I could be doing wrong here?

I'm not super savvy with scripting, sorry!
Marrend
Guardian of the Description Thread
21781
If you're using my test-event above as a basis for your tests, note that the value that $game_variables[1] needs to be for even a "8x slower" speed is 10. If you're using 0 through 9, it's going to be even slower than that! Thus, the whole "between speed 4 (normal) and 5 (2x faster)" you initially requested would be a value between 40 and 50.

However, if you strictly called...
set_custom_speed(0, $game_variables[1])
...this, I would like to know what value(s) that was used for $game_variables[1] that you tested, and maybe, from there, figure out what's going on.
Pages: 1