Tsuki's Vehicle Extend - Help with setting up the script - Terrain blocking/allowing

Good Morning / Day / Afternoon / Evening everyone.

I once again have a request

Tsuki's script allows you to create a custom vehicle. However it doesnt have the option to allow/restrict which terrain/region the vehicle can pass through, the vehicle just seems to go through every part of the map... Is there a way to modify this so I can have that feature?


Ruby:
=begin
#==============================================================================
 ** Vehicle Extend
 Author: Tsukihime
 Date: May 25, 2012
------------------------------------------------------------------------------
 ** Change log
 May 25
   - initial release
------------------------------------------------------------------------------   
 This script allows you to add more vehicles into the game.
 Customization is a little complicated.
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_VehicleExtend"] = true
#==============================================================================
# ** Configuration
#==============================================================================
module Tsuki
  module Vehicle_Extend
  
    # Key: vehicle symbol (must be unique)
    # vehicle ID (must be unique)
    # vehicle name
    # start_map_id, start_x, start_y
    # character sheet, character index
    # vehicle BGM, vehicle speed
    # "Front" type (whether it has to be in front of your character to board)
    Vehicle_Table = {    }
#==============================================================================
# ** Rest of the script.
#==============================================================================
    Vehicle_Types = Vehicle_Table.keys
    Front_Index = 9
  end
end

class Custom_Vehicle < RPG::System::Vehicle
  include Tsuki::Vehicle_Extend
 
  attr_accessor :vehicle_name
  attr_accessor :front
  def initialize(type)
    @type = type
    @id = 0
    setup
  end
 
  def setup
    data = Vehicle_Table[@type]
    @id = data[0]
    @vehicle_name = data[1]
    @start_map_id = data[2]
    @start_x = data[3]
    @start_y = data[4]
    @character_name = data[5]
    @character_index = data[6]
    @bgm = RPG::BGM.new(data[7])
    @speed = data[8]
    @front = data[9]
  end
end

class Game_Vehicle < Game_Character
  include Tsuki::Vehicle_Extend
 
  attr_reader :name
  attr_reader :type
  attr_reader :front
 
  alias :th_vehicle_extend_init_vehicle :initialize
  def initialize(type)
    @name = ""
    @type = type
    th_vehicle_extend_init_vehicle(type)
    init_custom_move_speed
  end
 
  alias :th_vehicle_extend_system_vehicle :system_vehicle
  def system_vehicle
    return Custom_Vehicle.new(@type) if Vehicle_Types.include?(@type)
    th_vehicle_extend_system_vehicle
  end
 
  alias :th_vehicle_extend_load_sys_settings :load_system_settings
  def load_system_settings
    th_vehicle_extend_load_sys_settings
    load_custom_settings if system_vehicle.is_a?(Custom_Vehicle)
  end
 
  def load_custom_settings
    @name = system_vehicle.vehicle_name
    @front = system_vehicle.front
  end
 
  def init_custom_move_speed
    @move_speed = Vehicle_Table[@type][8] if Vehicle_Types.include?(@type)
  end
end

class Game_Player < Game_Character
  include Tsuki::Vehicle_Extend
 
  alias :th_vehicle_extend_in_airship? :in_airship?
  def in_airship?
    th_vehicle_extend_in_airship? || (!Vehicle_Table[@vehicle_type][Front_Index] if Vehicle_Types.include?(@vehicle_type))
  end
  
  alias :th_vehicle_extend_get_on :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)
    Vehicle_Types.each {|vtype|
      if Vehicle_Table[vtype][Front_Index]
        @vehicle_type = vtype if $game_map.vehicle_type_here(front_x, front_y) == vtype
      else
        @vehicle_type = vtype if $game_map.vehicle_type_here(x, y) == vtype
      end
    }
    th_vehicle_extend_get_on
  end
end

class Game_Map
  include Tsuki::Vehicle_Extend
 
  alias :th_vehicle_extend_create_map_vehicles :create_vehicles
  def create_vehicles
    th_vehicle_extend_create_map_vehicles
    create_custom_vehicles
  end
 
  alias :th_vehicle_extend_map_vehicle :vehicle
  def vehicle(type)
    return custom_vehicle(type) if Vehicle_Types.include?(type)
    th_vehicle_extend_map_vehicle(type)
  end
 
  def vehicle_type_here(x, y)
    @vehicles.each {|vehicle| return vehicle.type if vehicle.pos?(x, y) }
    return nil
  end
 
  def custom_vehicle(type)
    @vehicles[Vehicle_Table[type][0]]
  end
 
  def create_custom_vehicles
    Vehicle_Types.each do |vtype|
      @vehicles << Game_Vehicle.new(vtype)
    end
  end
 
  def vehicle_passable?(type, x, y)
  end
end
Did you try move restrict region by yanfly?
I had made a mod of it to do just what your asking.
That would be wonderful, could I see it?
could I see it

Original thread: https://forums.rpgmakerweb.com/threads/tsukis-vehicle-extend-help-with-setting-up-the-script-terrain-blocking-allowing.124504/