Jump to content
seitensei

Vehicle Additions

Recommended Posts

Vehicle Additions

 

Version 0.35a

 

By seitensei/tenseiten, with help from shaz

Introduction

 

This Vehicle Additions script adds the ability to access an additional map as

the interior of the vehicle. So far, only the airship has been implemented. This

script overwrites the get_on_vehicle and the get_off_vehicle methods, so it is

not compatible with anything that edits those. However, since it uses a the

default code when the system is not enabled for a vehicle, created a patch to

solve incompatibilities is not within the real of impossibility.

 

Instruction

 

Set the map ID and X/Y coordinates of for the map that will serve as the

interior of the vehicle. Create an event that brings the player back to the

overmap and forces them to pilot the vehicle by by creating and event that

calls the following code:

 

$game_player.pilot_vehicle

 

To exit the vehicle’s interior, and return to the overmap (on foot), call

the following:

 

$game_player.exit_vehicle

 

 

 

 

Terms of Use

Please contact me if the way that you want to use this script is

not allowable under this license (do not wish to share modification, or

want to have it in a commercial project).

Download

Edited by seitensei

Share this post


Link to post
Share on other sites

Woah this is pretty awesome man. I remember on a old VX project I had wanted something like this. This creates a lot of possibilities. Thank you :)

Share this post


Link to post
Share on other sites

Updated to 0.35a, fixing boat and ship not being processed.

 

Edit: Just working on getting the exit function to work with Ships and Boats now.

Edited by seitensei

Share this post


Link to post
Share on other sites

This is great, never seen it done before. I love the fact you have to pilot it from the interior (even though that's impractical as seen in FFVII...) It adds a certain realism to the game.

Share this post


Link to post
Share on other sites

This is a noob question i'm having a problem with it all it does gave me game_map 41

 

so idk if didn't set up the event up right or unless i put it in wrong can someone give me good idea how to set it up or a demo please and thank you.

 

*update*

 

nvm got someone to help also

is there away for this to work with the sea ship and not only just the airship love to have sea ship working the same as it

Edited by shadowds

Share this post


Link to post
Share on other sites
ok i am an idiot

please help me i cant get this script to work i have no idea were to paste it or what i am supposed to do :(

 

to use it make a new map *inside airship*

 

make event to exit out of ship with this in command line 

 

$game_player.exit_vehicle

 

to use ship make something or someone and have this in the command line to start the air ship up 

 

$game_player.pilot_vehicle

 

 

this script does not work with sea ship or boats at all as far as i tried in so many ways but 

 

if you want use this script it better because it's almost about the same but you need to press Q to enter the inside of the ship and easy to setup too and works with sea ship and air ship so works great so far.

http://www.rpgmakervxace.net/topic/7488-csca-vehicle-system/

Share this post


Link to post
Share on other sites

For those who use other core scripts (like me) and thus can't use Casper Gaming Scripts, I made a version of this script that works with both ships and airships. But I cannot publish it without the author's authorization, I guess.

Share this post


Link to post
Share on other sites

Does anyone have this script?

I just found a demo that had it.

Spoiler

#===============================================================================
# * Vehicle Additions
#   Version 0.35b
#-------------------------------------------------------------------------------
# * Authored by: tenseiten/seitensei
# * With help from: shaz
#===============================================================================

#===============================================================================
# * Change log
#-------------------------------------------------------------------------------
=begin

0.35b - 2011-12-27 1:19 JST
  - Replaced cloned methods with alias to fix possible compatibility issues.
    This script should be placed below any other that modified the default
    vehicle behavior.

0.35a - 2011-12-22, 19:16 JST
  - Fixed Boat and Ship not being passed through

0.30a - 2011-12-21, 19:20 JST
  - First Public Release
  - Fixed Teleport on Unlandable Spaces
  
0.20a - Internal Version

0.10a - Internal Version

0.00a - Internal Version

=end
#===============================================================================

#===============================================================================
=begin

.:Introduction:.
This Vehicle Additions script adds the ability to access an additional map as
the interior of the vehicle. So far, only the airship has been implemented. This
script overwrites the get_on_vehicle and the get_off_vehicle methods, so it is
not compatible with anything that edits those. However, since it uses a the
default code when the system is not enabled for a vehicle, created a patch to
solve incompatibilities is not within the real of impossibility.

.:Instruction:.
Set the map ID and X/Y coordinates of for the map that will serve as the
interior of the vehicle. Create an event that brings the player back to the
overmap and forces them to pilot the vehicle by by creating and event that
calls the following code:

$game_player.pilot_vehicle

To exit the vehicle's interior, and return to the overmap (on foot), call
the following:

$game_player.exit_vehicle

=end
#===============================================================================

#-------------------------------------------------------------------------------
# * Config Section
#-------------------------------------------------------------------------------
module Tenseiten
  module Vehicle
    
    AIRSHIP_ENABLED = true # Whether or not we want to invoke additions
    AIRSHIP_MAP = 46 # interior map id
    AIRSHIP_MAP_X = 21 # interior x
    AIRSHIP_MAP_Y = 15 # interior y
    
  end
end
#-------------------------------------------------------------------------------
# * Config End
#-------------------------------------------------------------------------------
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Get on Vehicle (From Overmap)
  #   Intercept the player, and send them inside.
  #--------------------------------------------------------------------------
  alias control_vehicle get_on_vehicle
  def get_on_vehicle
    front_x = $game_map.round_x_with_direction(@x, @direction)
    front_y = $game_map.round_y_with_direction(@y, @direction)

    # check if player is allowed to get onto the airship
    if $game_map.airship.pos?(@x, @y)
      if Tenseiten::Vehicle::AIRSHIP_ENABLED
        #Save world map information
        @player_w_map = $game_map.map_id
        @player_w_x = @x
        @player_w_y = @y
        @used_vehicle = :airship
        #Now Teleport to the map set in config
        reserve_transfer(Tenseiten::Vehicle::AIRSHIP_MAP, Tenseiten::Vehicle::AIRSHIP_MAP_X, Tenseiten::Vehicle::AIRSHIP_MAP_Y, @direction) # transfer to new map
      else
        #Continue to normal function when not enabled
        @vehicle_type = :airship
        control_vehicle
      end
    end
	  
	if $game_map.boat.pos?(front_x, front_y)
    @vehicle_type = :boat
    control_vehicle
	end
	
	if $game_map.ship.pos?(front_x, front_y)
		@vehicle_type = :ship
		control_vehicle
	end
end
  
  #--------------------------------------------------------------------------
  # * Pilot Vehicle (From Interior)
  #   Brings player back to the overmap to control the ship
  #--------------------------------------------------------------------------
  def pilot_vehicle
    
    # Save Interior Map Location
    @player_int_map = $game_map.map_id
    @player_int_x = @x
    @player_int_y = @y
    
    # Transfer to World Map
    reserve_transfer(@player_w_map, @player_w_x, @player_w_y, @direction)
    @vehicle_type = @used_vehicle
    control_vehicle
  end
  
  #--------------------------------------------------------------------------
  # * Leave Vehicle (From Overmap)
  #   Intercept the player, and end them inside
  #--------------------------------------------------------------------------
  alias abandon_vehicle get_off_vehicle
  def get_off_vehicle
    if @vehicle_type == :airship
      if Tenseiten::Vehicle::AIRSHIP_ENABLED
        if vehicle.land_ok?(@x, @y, @direction)
        set_direction(1) if in_airship?
        @followers.synchronize(@x, @y, @direction)
        vehicle.get_off
        unless in_airship?
          force_move_forward
          @transparent = false
        end
        @vehicle_getting_off = true
        @move_speed = 4
        @through = false
        make_encounter_count
        @followers.gather
        end
        @vehicle_getting_off
      if vehicle.land_ok?(@x, @y, @direction)
        @player_w_map = $game_map.map_id
        @player_w_x = @x
        @player_w_y = @y
        reserve_transfer(@player_int_map, @player_int_x, @player_int_y, @direction) # transfer to new map
      end
      else
		  abandon_vehicle
      end
    else
      abandon_vehicle
    end
            
  end
  
  #--------------------------------------------------------------------------
  # * Exit Vehicle (From Interior)
  #   Returns the party to the overmap
  #--------------------------------------------------------------------------
  def exit_vehicle
    
    reserve_transfer(@player_w_map, @player_w_x, @player_w_y, @direction) 
    
  end

  
end

 

 

Edited by roninator2

Share this post


Link to post
Share on other sites
On 12/10/2020 at 9:16 PM, PhoenixSoul said:

fairly simple to implement interiors for all vehicles.

It wasn't easy, but just a little bit of work. I made it work for ships, but boats are a vehicle I don't think need an interior. Where do you go on a raft?

#===============================================================================
# * Vehicle Additions
#   Version 0.41b
#-------------------------------------------------------------------------------
# * Authored by: tenseiten/seitensei
# * With help from: shaz
# * Updated by Roninator2
#===============================================================================

#===============================================================================
# * Change log
#-------------------------------------------------------------------------------
=begin

0.41b - 2020-12-10 18:05 CST
  - added switches to turn feature on or off
  
0.4b - 2020-12-10 18:00 CST
  - Added support for ship interior
  
0.35b - 2011-12-27 1:19 JST
  - Replaced cloned methods with alias to fix possible compatibility issues.
    This script should be placed below any other that modified the default
    vehicle behavior.

0.35a - 2011-12-22, 19:16 JST
  - Fixed Boat and Ship not being passed through

0.30a - 2011-12-21, 19:20 JST
  - First Public Release
  - Fixed Teleport on Unlandable Spaces
  
0.20a - Internal Version

0.10a - Internal Version

0.00a - Internal Version

=end
#===============================================================================

#===============================================================================
=begin

.:Introduction:.
This Vehicle Additions script adds the ability to access an additional map as
the interior of the vehicle. So far, only the airship has been implemented. This
script overwrites the get_on_vehicle and the get_off_vehicle methods, so it is
not compatible with anything that edits those. However, since it uses a the
default code when the system is not enabled for a vehicle, created a patch to
solve incompatibilities is not within the real of impossibility.

.:Instruction:.
Set the map ID and X/Y coordinates of for the map that will serve as the
interior of the vehicle. Create an event that brings the player back to the
overmap and forces them to pilot the vehicle by by creating and event that
calls the following code:

$game_player.pilot_vehicle

To exit the vehicle's interior, and return to the overmap (on foot), call
the following:

$game_player.exit_vehicle

=end
#===============================================================================

#-------------------------------------------------------------------------------
# * Config Section
#-------------------------------------------------------------------------------
module Tenseiten
  module Vehicle
    AIRSHIP_ENABLED = 2 # switch # Whether or not we want to invoke additions
    AIRSHIP_MAP = 3 # interior map id
    AIRSHIP_MAP_X = 10 # interior x
    AIRSHIP_MAP_Y = 10 # interior y
    
    SHIP_ENABLED = 3 # switch # Whether or not we want to invoke additions
    SHIP_MAP = 4 # interior map id
    SHIP_MAP_X = 10 # interior x
    SHIP_MAP_Y = 10 # interior y
  end
end
#-------------------------------------------------------------------------------
# * Config End
#-------------------------------------------------------------------------------
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Get on Vehicle (From Overmap)
  #   Intercept the player, and send them inside.
  #--------------------------------------------------------------------------
  alias control_vehicle get_on_vehicle
  def get_on_vehicle
    front_x = $game_map.round_x_with_direction(@x, @direction)
    front_y = $game_map.round_y_with_direction(@y, @direction)
    # check if player is allowed to get onto the airship
    if $game_map.airship.pos?(@x, @y)
      if $game_switches[Tenseiten::Vehicle::AIRSHIP_ENABLED] == true
        #Save world map information
        @player_w_map = $game_map.map_id
        @player_w_x = @x
        @player_w_y = @y
        @used_vehicle = :airship
        #Now Teleport to the map set in config
        reserve_transfer(Tenseiten::Vehicle::AIRSHIP_MAP, Tenseiten::Vehicle::AIRSHIP_MAP_X, Tenseiten::Vehicle::AIRSHIP_MAP_Y, @direction) # transfer to new map
      else
        #Continue to normal function when not enabled
        @vehicle_type = :airship
        control_vehicle
      end
    end
    if $game_map.boat.pos?(front_x, front_y)
      @vehicle_type = :boat
      control_vehicle
    end
    if $game_map.ship.pos?(front_x, front_y)
      if $game_switches[Tenseiten::Vehicle::SHIP_ENABLED] == true
        #Save world map information
        @player_w_map = $game_map.map_id
        @player_w_x = @x
        @player_w_y = @y
        @player_w_d = @direction
        @used_vehicle = :ship
        #Now Teleport to the map set in config
        reserve_transfer(Tenseiten::Vehicle::SHIP_MAP, Tenseiten::Vehicle::SHIP_MAP_X, Tenseiten::Vehicle::SHIP_MAP_Y, @direction) # transfer to new map
      else
        #Continue to normal function when not enabled
        @vehicle_type = :ship
        control_vehicle
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Pilot Vehicle (From Interior)
  #   Brings player back to the overmap to control the ship
  #--------------------------------------------------------------------------
  def pilot_vehicle
    # Save Interior Map Location
    @player_int_map = $game_map.map_id
    @player_int_x = @x
    @player_int_y = @y
    # Transfer to World Map
    if @used_vehicle == :ship
      @direction = @player_w_d
      if @player_w_d == 2
        @player_w_y += 1
      elsif @player_w_d == 4
        @player_w_x -= 1
      elsif @player_w_d == 6
        @player_w_x += 1
      elsif @player_w_d == 8
        @player_w_y -= 1
      end
    end
    reserve_transfer(@player_w_map, @player_w_x, @player_w_y, @direction)
    @vehicle_type = @used_vehicle
    control_vehicle
  end
  #--------------------------------------------------------------------------
  # * Leave Vehicle (From Overmap)
  #   Intercept the player, and end them inside
  #--------------------------------------------------------------------------
  alias abandon_vehicle get_off_vehicle
  def get_off_vehicle
    if @vehicle_type == :airship
      if $game_switches[Tenseiten::Vehicle::AIRSHIP_ENABLED] == true
        if vehicle.land_ok?(@x, @y, @direction)
        set_direction(1) if in_airship?
        @followers.synchronize(@x, @y, @direction)
        vehicle.get_off
        unless in_airship?
          force_move_forward
          @transparent = false
        end
        @vehicle_getting_off = true
        @move_speed = 4
        @through = false
        make_encounter_count
        @followers.gather
        end
        @vehicle_getting_off
      if vehicle.land_ok?(@x, @y, @direction)
        @player_w_map = $game_map.map_id
        @player_w_x = @x
        @player_w_y = @y
        reserve_transfer(@player_int_map, @player_int_x, @player_int_y, @direction) # transfer to new map
      end
      else
		  abandon_vehicle
      end
    elsif @vehicle_type == :ship
      if $game_switches[Tenseiten::Vehicle::SHIP_ENABLED] == true
        vehicle.get_off
        force_move_forward
        @transparent = false
        @vehicle_getting_off = true
        @move_speed = 4
        @through = false
        make_encounter_count
        @followers.gather
        @vehicle_getting_off
        @player_w_map = $game_map.map_id
        @player_w_x = @x
        @player_w_y = @y
        reserve_transfer(@player_int_map, @player_int_x, @player_int_y, @direction) # transfer to new map
      else
		  abandon_vehicle
      end
    else
      abandon_vehicle
    end
  end
  #--------------------------------------------------------------------------
  # * Exit Vehicle (From Interior)
  #   Returns the party to the overmap
  #--------------------------------------------------------------------------
  def exit_vehicle
    reserve_transfer(@player_w_map, @player_w_x, @player_w_y, @direction) 
  end
end

 

Share this post


Link to post
Share on other sites
23 hours ago, roninator2 said:

Where do you go on a raft?

Well, most rafts made for ocean-faring ventures are fairly large and sturdy; I would actually make either a 3*4 or 4*4 tilemap of what the raft contains with an extra two tile berth of surrounding water. Of course, that's me and purely an art/design choice. However, given the default 'boat' vehicle is a canoe in VX/Ace, I can definitely see the futility of making a representative tilemap of that one since canoes are much smaller.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted