A4 Passability Adjustment (RPG Maker VX Ace Script)

I wrote this to avoid having to use region passability scripts on every map where I used converted resources, maybe you’ll find it helpful. If you use my converters (http://rpgmakeronline.org/converters/) then you probably will.

=begin
A4 Tile Passability Adjustment
by Fomar0153
Version 1.0
----------------------
Notes
----------------------
You know how A4 tile roofs are passable from the bottom and between themselves?
Well this stops that nonesence, not passable means not passable.

I'm not sure if there will be any unintended consquences of this script,
please let me know if you find any anomalies.
----------------------
Instructions
----------------------
Plug and Play

=end

class Game_Map
  #--------------------------------------------------------------------------
  # * Check Passage
  #     bit:  Inhibit passage check bit
  #--------------------------------------------------------------------------
  alias a4_check_passage check_passage
  def check_passage(x, y, bit)
    pass = a4_check_passage(x, y, bit)
    all_tiles(x, y).each do |tile_id|
      if tile_id >= 5888 && tile_id <= 8191
        if ((80..87).to_a + (96..103).to_a + (112..119).to_a).include?((tile_id - 2048) / 48)
          return pass && airship_land_ok?(x, y)
        end
      end
    end
    pass
  end
  #--------------------------------------------------------------------------
  # * Determine if Airship can Land
  #--------------------------------------------------------------------------
  def airship_land_ok?(x, y)
    a4_check_passage(x, y, 0x0800) && a4_check_passage(x, y, 0x0f)
  end
end

 

Leave a comment