Boat script
#1
Boat script
by cypherzero
Mar 1 2005

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Apologies if this has been said already, but if you're like me and like to start from the ground up, here's a very good starting point for a boat script:

In Game_Map goto line 234
Change the for... i loop so that it matches the following:
(I've also included some of the surrounding code to help locate where this should go, don't bother with this! New sections are commented MJR:)
Code:
# When priority 0 is the other than that,
        elsif @priorities[event.tile_id] == 0
          # Transit success
          return true
        end
      end
    end
    # From on the layer is inspected in order the loop
    for i in [2, 1, 0]
      # Tile ID acquisition
      tile_id = data[x, y, i]
      # Failure of tile ID
      if tile_id == nil
        return false  #fail
      #MJR: When terrain = 1 and player is not in boat
      elsif ($game_temp.isinboat == 0) and (@terrain_tags[tile_id] == 1)
        return false
      #MJR
      elsif ($game_temp.isinboat == 1) && (@terrain_tags[tile_id] != 1) && (i == 0) then
        return false
      # When the obstacle bit is set,
      elsif @passages[tile_id] & bit != 0
        return false
      # When the obstacle bit of all directions is set,
      elsif @passages[tile_id] & 0x0f == 0x0f
        return false
      # When priority 0 is the other than that,
      elsif @priorities[tile_id] == 0
        return true Â�  #success
      end
    end
    # 通行å?¯
  return true
  end
  #--------------------------------------------------------------------------
  # â—? 茂ã?¿åˆ¤å®š
  #  x  : X 座標
  #  y  : Y 座標
  #--------------------------------------------------------------------------
  def bush?(x, y)


Now goto the database and make some tiles of terrain type 2 (water chips might be a good idea)
You will also have to set them to PASSABLE (unlike in RM2K where boats would traverse impassable chips)

Now draw some water on the map in the BOTTOM LAYER.

Create two events:
One which contains the code:
Code:
$game_temp.isinboat = 0


And the other:
Code:
$game_temp.isinboat = 1


You might have to use CTRL (to walk through walls etc) before you refine these events.

You should be able to walk on water (but not on land) when $game_temp.isinboat = 1, and you should only be able to walk on land when $game_temp.isinboat = 0.

A car script can be created even more easily in a similar manner.

After testing these out, you can create a better boat by adding change player graphic and move player events. But like I said before, this makes a good starting point.
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Emotion Script Ánemus 0 2,541 08-29-2008, 01:00 PM
Last Post: Ánemus
  Beran's iPod script Sniper308 0 3,003 08-09-2008, 01:00 PM
Last Post: Sniper308
  NeoABS & NeoSABS ()enemy processes script azrith001 0 2,701 04-04-2008, 01:00 PM
Last Post: azrith001
  Blur Effect Script Hadriel 0 2,949 01-30-2008, 01:00 PM
Last Post: Hadriel
  Warp Script Sheol 0 2,870 12-28-2007, 01:00 PM
Last Post: Sheol
  AIM Script Pack vgvgf 0 3,188 09-13-2007, 01:00 PM
Last Post: vgvgf
  Audio Encryption Script InfiniteSpawn 0 2,576 05-09-2007, 01:00 PM
Last Post: InfiniteSpawn
  Credits Script Remake avatarmonkeykirby 0 2,586 03-10-2007, 01:00 PM
Last Post: avatarmonkeykirby
  Leon Blade's Percent Script Leon Blade 0 2,588 03-05-2007, 01:00 PM
Last Post: Leon Blade
  Cogwheels original pixelmovement script!!! mechacrash 0 2,530 01-14-2007, 01:00 PM
Last Post: mechacrash



Users browsing this thread: 1 Guest(s)