Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

BDR Sweep v1.0

BDR Sweep Version: 1.0 for RMVX
By: Fustel

Introduction
Remember the FF6 underground river, or any river that sweeps you past nearly unreachable treaseures ??
With this script, you can easily create such rivers, even aerial air currents, without overloading your maps withe events. Furthermore, ther is NO EVENT at all to achieve this. Just mapping.

Features
  • Create 'Sweep Maps' for each method of transport for any map you want.
  • Define is a single input move is allowed between 2 sweep move for each method of transport
  • The above properties are hierachized, so that a more detailed definition replaces a more generic. The levels of definition are
    • Default: used by all methods (feet, ship, boat, airship)
      • Air: used when aboard the airship
      • Sea: used when at sea (boat or ship)
        • Boat: used when abooard the boat
        • Ship: used when abooard the ship
  • Define the 'Sweep Tiles' you will put on the 'Sweep Maps'. The default are the four arrowed tiles at the bottom loft.

Screenshots
The purpose of this script is about moving. No static image could be of any help

Demo
http://www.mediafire.com/file/hljzmmdjhy1/BDR Sweep - v1.0.zip

Try and get the chest using various vehicles... or even your feets

Script
[rgss]#==============================================================================
# ** BDR Sweep
#------------------------------------------------------------------------------
#  © Fustel, 2010
#  14/04/10
#  Version 1.0
#------------------------------------------------------------------------------
#  VERSION HISTORY:
#   - 1.0 (14/04/10), Initial release
#-------------------------------------------------------------------------------
#  INSTRUCTIONS:
#   - Install the 'BDR Tile v1.1' script
#   - Place this script in the 'Materials' section
#   - Set the following parameters in the BDR::Sweep module:
#     - Fille the following hash to link sweep maps to real maps
#       - Maps : default sweep maps
#       - Maps_Boat : sweep maps when on boat
#       - Maps_Ship : sweep maps when on ship
#       - Maps_Sea  : sweep maps when at sea (boat or ship)
#       - Maps_Air  : sweep maps when on airship
#     - Allow a single input move between 2 sweep, or not (true, false, nil)
#       - MOVE_BETWEEN : input move allowed between 2 sweeps
#       - MOVE_BETWEEN_BOAT : input move allowed between 2 sweeps when in boar
#       - MOVE_BETWEEN_SHIP : input move allowed between 2 sweeps when in ship
#       - MOVE_BETWEEN_SEA : input move allowed between 2 sweeps when at sea (in boat or ship)
#       - MOVE_BETWEEN_AIR : input move allowed between 2 sweeps when in airship
#     - Select the sweeping tiles in the hash:
#       - Tiles
#------------------------------------------------------------------------------
# NOTES
#   The 'move between sweep' and 'sweep maps' properties are hierarchicaly organized.
#     From a default level, they become more precise. If a more precise level is
#     defined, it replaces the more general level. These levels are:
#     - Default (MOVE_BETWEEN & Maps)
#       - in Airship (MOVE_BETWEEN_AIR & Maps_Air)
#       - at Sea (MOVE_BETWEEN_SEA & Maps_Sea)
#         - in Boat (MOVE_BETWEEN_BOAT & Maps_Boat)
#         - in Ship (MOVE_BETWEEN_SHIP & Maps_Ship)
#------------------------------------------------------------------------------
 
module BDR
  module Sweep
 
    # Maps are used in the folling prioty, if they do exist:
    # if the Hero is:
    #   - on foor: Maps
    #   - on Boat: Maps_Boat, Maps_Sea, Maps
    #   - on Ship: Maps_Ship, Maps_Sea, Maps
    #   - on Airship: Maps_Air, Maps
    #---------------------------------------
 
    # key = real map ID
    # data = ID of map containing directional tiles
    #----------------------------------------------
    Maps = {}       # default for all
    Maps_Boat = {}  # specific for boat
    Maps_Ship = {}  # specific for ship
    Maps_Sea = {}   # default for both boat & ship
    Maps_Air = {}   # specific for airship
 
    Maps[ 1] = 5
    Maps_Boat[ 1] = 4
    Maps_Sea[ 1] = 2
    Maps_Air[ 1] = 3
 
    # Use the same pririty as Maps
    # Allows key input between forced moves
    #--------------------------------------
    MOVE_BETWEEN = true
    MOVE_BETWEEN_BOAT = nil
    MOVE_BETWEEN_SHIP = nil
    MOVE_BETWEEN_SEA = nil
    MOVE_BETWEEN_AIR = false
 
    # key = tile ID as returned by BDR::Tile::id
    #         ( [ col, row] in tile panel A)
    # data = direction (1=S, 2=W, 3=E, 4=N)
    #
    # Those are the arrow tiles at the bottom-left
    #---------------------------------------------
    Tiles = {}
    Tiles[ [ 0, 31]] = 1
    Tiles[ [ 1, 31]] = 4
    Tiles[ [ 2, 31]] = 2
    Tiles[ [ 3, 31]] = 3
  end
end
 
 
class Game_Map
  attr_reader :bdr_sweep_map
  attr_reader :bdr_sweep_map_boat
  attr_reader :bdr_sweep_map_ship
  attr_reader :bdr_sweep_map_sea
  attr_reader :bdr_sweep_map_air
 
  alias bdr_sweep_initialize initialize
  def initialize
    @bdr_sweep_map = nil
    @bdr_sweep_map_boat = nil
    @bdr_sweep_map_ship = nil
    @bdr_sweep_map_sea = nil
    @bdr_sweep_map_air = nil
    bdr_sweep_initialize
  end
 
  alias bdr_sweep_setup setup
  def setup( map_id)
    bdr_sweep_setup( map_id)
 
    m = BDR::Sweep::Maps[ map_id]
    @bdr_sweep_map = m != nil ? load_data( sprintf( "Data/Map%03d.rvdata", m)) : nil
 
    m = BDR::Sweep::Maps_Boat[ map_id]
    @bdr_sweep_map_boat = m != nil ? load_data( sprintf( "Data/Map%03d.rvdata", m)) : nil
 
    m = BDR::Sweep::Maps_Ship[ map_id]
    @bdr_sweep_map_ship = m != nil ? load_data( sprintf( "Data/Map%03d.rvdata", m)) : nil
 
    m = BDR::Sweep::Maps_Sea[ map_id]
    @bdr_sweep_map_sea = m != nil ? load_data( sprintf( "Data/Map%03d.rvdata", m)) : nil
 
    m = BDR::Sweep::Maps_Air[ map_id]
    @bdr_sweep_map_air = m != nil ? load_data( sprintf( "Data/Map%03d.rvdata", m)) : nil
  end
end
 
class Game_Player < Game_Character
  alias bdr_sweep_initialize initialize
  def initialize
    @bdr_sweep_map = nil
    @bdr_sweep_mode = 1    # 1=move_by_input, 2=move_by_sweep
    bdr_sweep_initialize
  end
 
  alias bdr_sweep_move_by_input move_by_input
  def move_by_input
    return unless movable?
    return if $game_map.interpreter.running?
 
    # deterimine map ans move_by_input autorization acording to vehicle
    #------------------------------------------------------------------
    bdr_sweep_map_select
    bdr_sweep_move_batween = ( BDR::Sweep::MOVE_BETWEEN == nil ? false : BDR::Sweep::MOVE_BETWEEN)
    case @vehicle_type
      when 0:      # on boat
        bdr_sweep_move_batween = BDR::Sweep::MOVE_BETWEEN_SEA  if BDR::Sweep::MOVE_BETWEEN_SEA != nil
        bdr_sweep_move_batween = BDR::Sweep::MOVE_BETWEEN_BOAT if BDR::Sweep::MOVE_BETWEEN_BOAT != nil
      when 1:      # on ship
        bdr_sweep_move_batween = BDR::Sweep::MOVE_BETWEEN_SEA  if BDR::Sweep::MOVE_BETWEEN_SEA != nil
        bdr_sweep_move_batween = BDR::Sweep::MOVE_BETWEEN_SHIP if BDR::Sweep::MOVE_BETWEEN_SHIP != nil
      when 2:      # on airship
        bdr_sweep_move_batween = BDR::Sweep::MOVE_BETWEEN_AIR  if BDR::Sweep::MOVE_BETWEEN_AIR != nil
    end
 
    if @bdr_sweep_map == nil                                              # no sweep map
      @bdr_sweep_mode = 1
      bdr_sweep_move_by_input
    elsif BDR::Sweep::Tiles[ @bdr_sweep_map.tile_id( @x, @y)] == nil      # not on a sweeping tile
      @bdr_sweep_mode = 1
      bdr_sweep_move_by_input
    elsif @bdr_sweep_mode == 1                                            # last move was by input
      @bdr_sweep_mode = 2
      bdr_sweep_move_by_sweep
    elsif @bdr_sweep_mode == 2                                            # last move was by sweeping
      @bdr_sweep_mode = 1
      if bdr_sweep_move_batween
        bdr_sweep_move_by_input
      else
        bdr_sweep_move_by_sweep
      end
    end
  end
 
  def bdr_sweep_move_by_sweep
    case BDR::Sweep::Tiles[ @bdr_sweep_map.tile_id( @x, @y)]
      when 1: move_down
      when 2: move_left
      when 3: move_right
      when 4: move_up
    end
  end
 
  def bdr_sweep_map_select
    @bdr_sweep_map = $game_map.bdr_sweep_map
    case @vehicle_type
      when 0:      # on boat
        @bdr_sweep_map = $game_map.bdr_sweep_map_sea  if $game_map.bdr_sweep_map_sea != nil
        @bdr_sweep_map = $game_map.bdr_sweep_map_boat if $game_map.bdr_sweep_map_boat != nil
      when 1:      # on ship
        @bdr_sweep_map = $game_map.bdr_sweep_map_sea  if $game_map.bdr_sweep_map_sea != nil
        @bdr_sweep_map = $game_map.bdr_sweep_map_ship if $game_map.bdr_sweep_map_ship != nil
      when 2:      # on airship
        @bdr_sweep_map = $game_map.bdr_sweep_map_air  if $game_map.bdr_sweep_map_air != nil
    end
  end
end
[/rgss]

Instructions
  • Install 'BDR Tile v1.1', found here: http://www.arpgmaker.com/viewtopic.php?f=11&t=70440
  • Copy the script in the 'Materials' section
  • Set the following constants in the BDR::Sweep module to define if a single input move is allowed between 2 sweep moves. These constants are hierachized as explained above. They can be set to: true (input move allowed), false (input move diallowed), or nil (use more global definition or false for the default definition). These constants are:
    • MOVE_BETWEEN : default
    • MOVE_BETWEEN_AIR : for airship
    • MOVE_BETWEEN_SEA : at sea
    • MOVE_BETWEEN_BOAT : for boat
    • MOVE_BETWEEN_SHIP : for ship
  • Create 'Sweep Maps' the same size of the real map it is attached to. Fill it with the tiles defined in the BDR::Sweep::Tiles hash. When the Hero is at the same position of one of these tiles in the main map, he is swept in the according direction.
  • Fill the following hash in the BDR::Sweep module to link 'Sweep Maps' with real maps
    • their structure is
      • the key is the real map ID
      • the data is the 'Sweep Map' ID
    • these hash are
      • Maps : default
      • Maps_Air : for airship
      • Maps_Sea : at sea
      • Maps_Boat : for boat
      • Maps_Ship : for ship

FAQ

Compatibility
No issue known.

Credits and Thanks
All done by myself

Author's Notes
If you have any trouble, look thoroughly at the demo, and do not hesitate to ask the silly question.

Terms and Conditions
You may not use this in a commercial game without my explicit permission.
You may not post this script anywhere without my explict permission.
You must give me credit.
 
Interesting script... and you actually made one I didn't do before :p (acually, I don't think it's ever been attempted without events)
Again, though, my advice to switch to tile placement-based setup instead of manual assignment. Also, you spelled bdr_sweep_move_batween wrong :p (oh, and your method and module names are undistinctive :p )
 
Uh !!! A misspelling !!! Please tell me where it is (once more, I am near-blind, and have some difficulty finding that kind of things...).

And if you ask, I am more and more considering this kind of mapping option for a new version 'BDR Height'. It will be easier to indicate more height feature, and I'll more features for a future 'BDR ...'
 
BlueScope":7mshunkk said:
bdr_sweep_move_batween should be bdr_sweep_move_between ^^ (however, it's not critical for the script)
Ok, I've found if. Not critical YET... but could have cost a lot of time debugging a future version (if there ever is one...).
Next reincarnation, I change the eyes... :shades:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top