Vehicle question and speed question for rmvxa

Started by phillip1756, April 14, 2015, 06:35:14 pm

Previous topic - Next topic

phillip1756

ok I have 2 questions, first of all is there a way to make it so the sprite of a vehicle is different when you're off it to when you're on it and the second is is there a way to make it so you can have more than 6 movement speeds on rmvxa


KK20

Popped open VXA since I thought it was pretty easy. Took me like an hour to figure out where everything was.

# Format: [SPRITE_SHEET_FILENAME, CHARACTER_INDEX]
BOAT_RIDING_GRAPHIC = ["Vehicle", 4]
SHIP_RIDING_GRAPHIC = ["Vehicle", 5]
AIRSHIP_RIDING_GRAPHIC = ["Vehicle", 2]

class Game_Player < Game_Character

  alias change_vehicle_geton update_vehicle_get_on
  def update_vehicle_get_on
    if !@followers.gathering? && !moving?
      case @vehicle_type
      when :boat
        vehicle.character_name = BOAT_RIDING_GRAPHIC[0]
        vehicle.character_index = BOAT_RIDING_GRAPHIC[1]
      when :ship
        vehicle.character_name = SHIP_RIDING_GRAPHIC[0]
        vehicle.character_index = SHIP_RIDING_GRAPHIC[1]
      when :airship
        vehicle.character_name = AIRSHIP_RIDING_GRAPHIC[0]
        vehicle.character_index = AIRSHIP_RIDING_GRAPHIC[1]
      end
      return change_vehicle_geton
    end
  end
 
  alias change_vehicle_ugetoff update_vehicle_get_off
  def update_vehicle_get_off
    if !@followers.gathering? && vehicle.altitude == 0
      if @vehicle_type ==  :airship
        vehicle.character_name = $data_system.airship.character_name
        vehicle.character_index = $data_system.airship.character_index
      end
      return change_vehicle_ugetoff
    end
  end
 
  alias change_vehicle_getoff get_off_vehicle
  def get_off_vehicle
    ret = change_vehicle_getoff
    if ret && @vehicle_type != :airship
      if @vehicle_type == :boat
        vehicle.character_name = $data_system.boat.character_name
        vehicle.character_index = $data_system.boat.character_index
      else
        vehicle.character_name = $data_system.ship.character_name
        vehicle.character_index = $data_system.ship.character_index
      end
    end
    return ret
  end
 
end

class Game_Vehicle < Game_Character
  attr_accessor :character_name, :character_index
end

class Game_CharacterBase
  attr_accessor :move_speed
end

Configuration for changing the vehicle graphics at the top there.

For changing player move speed, script call:
$game_player.move_speed = VALUE

And you can use floating-point numbers (that's a decimal number for you less-techie folks).

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

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

Join the CP Discord Server!