I found out my ship only sails through land, it gets stuck in the water.
I also found out when I delete this passibility script the boat sails like normal, does anyone know what I can do to modify the script so the vehicles are an exception? xD
It was french script so I put in google translator, hope it still works
#================================================= ==============================
#
#
# Passabilité edge V1.2
#
#
#================================================= ==============================
#
# On the brainchild of Ashka.
# Rpg-maker-vx.bactif.com
#
# Vincentmhd.
# Http://vincentmhdmaker.canalblog.com/
#
31/08/2009 #
#
#===================================== =========== NOTE ===========================
#
#
#------------------------------------------------- ------------------------------
#
# This script will make passibility contours. Thus each side
# A tile can have a passabilité own. This can be useful for
# Borders, barriers.
#
# Unlike the script Ashka, these changes along
# Run, although it is quite possible to modify the event in passabilités.
#
# On auto-tiles, their passabilités change to their borders
# Respectively, but the interior remains subject to the passabilité of the publisher.
# To change a tile or tile-self is like the script Ashka,
# To the difference in return bool 4 for 4 directions.
The # bool may be substituted with 0 to 1 for true and false if
# You do not have space on a line. (This will surely be the case ^ ^)
# This is the command:
#
# Change_passage (file, x, y, down, left, right, up)
#
# It is also possible to change the passabilité of events.
# To do this just comment out the report, for example:
#
# "P FTTT"
#
# PASSABILITY is mandatory that allows the script to recognize a change
# Of passabilité.
# Do not forget the space!
# F and T is false to true, if they inform the character
# Can pass in the four directions: down, left, right and up.
# It is relatively easy to use.
#
#
# Bon Vincentmhd making ...
#
#------------------------------------------------- ------------------------------
Game_Character class
# Add special passabilité
attr_accessor: p
initialize alias mhd_initialize
def initialize
mhd_initialize
@ P = []
end
#------------------------------------------------- -------------------------
#
# Function original collision
#
#------------------------------------------------- -------------------------
mhd_collide_with_characters alias? collide_with_characters?
def collide_n (x, y)
mhd_collide_with_characters? (x, y)
end
#------------------------------------------------- -------------------------
#
# Function customized
#
#------------------------------------------------- -------------------------
# It returns if collision (unlike the passabilité)
def collide_c (x, y, direction)
for event in $ game_map.events_xy (x, y) # Matches event position
UNLESS event.through Passage # OFF?
event.p.size if> # 2 if it is customized
return! event.p [direction]
end
return true if 1 # == event.priority_type TARGET IS normal char
end
end
if @ # 1 == priority_type Self IS normal char
if $ game_player.pos_nt? (x, y) position player # Matches
event.p.size if> # 2 if it is customized
return! event.p [direction]
else
return true
end
end
if $ game_map.boat.pos_nt? (x, y) position player # Matches
event.p.size if> # 2 if it is customized
return! event.p [direction]
else
return true
end
end
if $ game_map.ship.pos_nt? (x, y) position player # Matches
event.p.size if> # 2 if it is customized
return! event.p [direction]
else
return true
end
end
end
return false
end
#------------------------------------------------- -------------------------
#
# Mix the two versions
#
#------------------------------------------------- -------------------------
def collide_with_characters? (xb, yb, xa, ya)
bcustom = false
acustom = false
# Determination if necessary to customize
for event in $ game_map.events_xy (xb, yb)
if event.p.size> 3
bcustom = true
end
end
for event in $ game_map.events_xy (xa, ya)
if event.p.size> 3
acustom = true
end
end
# If necessary customization for different traffic
if (acustom | | bcustom)
dx = xa-xb
dy = ya - yb
if (dy == -1)
a = 0
b = 3
end
if (dx == 1)
a = 1
b = 2
end
if (dx == -1)
a = 2
b = 1
end
if (dy == 1)
a = 3
b = 0
end
end
if (bcustom == false)
BPass collide_n = (xb, yb)
else
BPass collide_c = (xb, yb, b)
end
if (acustom == false)
APASS collide_n = (xa, ya)
else
APASS collide_c = (xa, ya, a)
end
if (acustom == true) & & (bcustom == false) & & (APASS == true)
return APASS
else
return (& & APASS BPass)
end
end
#------------------------------------------------- -------------------------
# * Determine if Fair
# X: x-coordinate
# Y: y-coordinate
#------------------------------------------------- -------------------------
def passable? (xb, yb, x = @ x = @ y ago)
x = $ game_map.round_x (xb) # Horizontal loop adj.
game_map.round_y $ y = (yb) # loop Vertical adj.
return false unless $ game_map.valid? (xb, yb) # Outside map?
return true if @ debug_through-through gold? Through # ON?
return false unless $ game_map.passable? (xb, yb, xa, ya) # Map impasse?
return false if collide_with_characters? (xb, yb, xa, ya) # Collide with character?
# return true Fair
end
end
#==================================== Game_Map ============ =======================
#
#------------------------------------------------- ------------------------------
#
# We're going to tile the tile A to B. The principle is the same as for the script
# Original. An ash contains exceptions passabilité you want.
#
#------------------------------------------------- ------------------------------
Game_Map class
Table # exception passabilité
attr_accessor: tab_passage
# Read data from the map
attr_reader: map
initialize alias mhd_initialize
def initialize
mhd_initialize
@ Tab_passage = {663 => [false, true, true, true]}
end
def boat_passable? (x, y)
return ok? (x, y, x, y, 0x02)
end
#------------------------------------------------- -------------------------
# * Determine if Ship IS Fair
# X: x-coordinate
# Y: y-coordinate
#------------------------------------------------- -------------------------
def ship_passable? (x, y)
return ok? (x, y, x, y, 0x04)
end
#------------------------------------------------- -------------------------
# * Determine if Cdn Airship Land
# X: x-coordinate
# Y: y-coordinate
#------------------------------------------------- -------------------------
def airship_land_ok? (x, y)
return ok? (x, y, x, y, 0x08)
end
#------------------------------------------------- -------------------------
#
# We always need the old passabilité
#
#------------------------------------------------- -------------------------
mhd_passable alias? Fair?
def normal_p (x, y, flag = 0x01)
mhd_passable? (x, y, flag)
end
#------------------------------------------------- -------------------------
#
# Create our passabilité
#
#------------------------------------------------- -------------------------
def custom_p (x, y, direction, flag = 0x01)
events_xy for event in (x, y) # matching events with coordinates
next if event.tile_id == 0 # tiled graphics are not
# next if event.through pass-through state
event.p.size if> # 2 if it is customized premium on any
return p [direction]
end
next if event.priority_type> 0 # not [Below characters]
pass = @ passages [event.tile_id] # get attribute fair
next if pass == 0x10 & 0x10 # *: Does not affect transition
return true if flag == 0x00 & pass # o: Fair
return false if flag == flag pass & # x: Impasse
end
for i in [2, 1, 0] # in order from on top of layer
tile_id map.data @ = [x, y, i] # get tile ID
return false if tile_id == nil # failed to get tile: Impasse
pass = @ passages [tile_id] # get attribute fair
if (@ tab_passage.key? (tile_id)) #
return @ tab_passage [tile_id] [direction]
end
next if pass == 0x10 & 0x10 # *: Does not affect transition
return true if flag == 0x00 & pass # o: Fair
return false if flag == flag pass & # x: Impasse
end
end
# Redefinition of the method that controls the passabilité
#------------------------------------------------- -------------------------
#
# Mix of both!
#
#------------------------------------------------- -------------------------
def passable? (xb, yb, xa, ya, flag = 0x01)
bcustom = false
acustom = false
# Determination if necessary to customize
for event in events_xy (xb, yb)
if event.p.size> 3
bcustom = true
end
end
for event in events_xy (xa, ya)
if event.p.size> 3
acustom = true
end
end
for i in [2, 1, 0]
tileB_id map.data @ = [xb, yb, i]
if (@ tab_passage.key? (tileB_id))
bcustom = true
end
end
for i in [2, 1, 0]
tileA_id map.data @ = [xa, ya, i]
if (@ tab_passage.key? (tileA_id))
acustom = true
end
end
# If necessary customization for different traffic
if (acustom | | bcustom)
dx = xa-xb
dy = ya - yb
if (dy == -1)
a = 0
b = 3
end
if (dx == 1)
a = 1
b = 2
end
if (dx == -1)
a = 2
b = 1
end
if (dy == 1)
a = 3 b = 0
end
end
if (bcustom == false)
BPass normal_p = (xb, yb, flag)
else
BPass custom_p = (xb, yb, b, flag)
end
if (acustom == false)
APASS normal_p = (xa, ya, flag)
else
APASS custom_p = (xa, ya, a, flag)
end
return (& & APASS BPass)
end
#------------------------------------------------- -------------------------
#
# Upgrade the passabilités
#
#------------------------------------------------- -------------------------
alias mhd_setup_events setup_events
def setup_events
mhd_setup_events
setup_pass
end
def setup_pass
for event in $ game_map.events.values
next if event.list == nil
for i in 0 ... event.list.size
if event.list [i]. code == 108
a = ""
event.list a = [i]. parameters.to_s
if a [0,1] == "P"
line = ""
line = event.list [i]. parameters.to_s
for i in 0 ... 4
info = ""
Online info = [(2 + i), 1]
if info == "T"
event.p [i] = true
else
event.p [i] = false
end
end
end
end
end
end
end
end
#------------------------------------------------- -------------------------
#
# Resume Ashka almost as
# Yet to the contours of autotiles, there is a small addition
# I have analyzed only one autotiles, so I hope they
# All the same shape otherwise it would Balaud ...
#
#------------------------------------------------- -------------------------
Game_Interpreter class
def autotiles (min, down, left, right, up)
$ Game_map.tab_passage [min + 16] = [true, left, true, true]
$ Game_map.tab_passage [min + 17] = [true, left, true, true]
$ Game_map.tab_passage [min + 18] = [true, left, true, true]
$ Game_map.tab_passage [min + 19] = [true, left, true, true]
$ Game_map.tab_passage [min + 20] = [true, true, true, up]
$ Game_map.tab_passage [min + 21] = [true, true, true, up]
$ Game_map.tab_passage [min + 22] = [true, true, true, up]
$ Game_map.tab_passage [min + 23] = [true, true, true, up]
$ Game_map.tab_passage [min + 24] = [true, true, right, true]
$ Game_map.tab_passage [min + 25] = [true, true, right, true]
$ Game_map.tab_passage [min + 26] = [true, true, right, true]
$ Game_map.tab_passage [min + 27] = [true, true, right, true]
$ Game_map.tab_passage [min + 28] = [down, true, true, true]
$ Game_map.tab_passage [min + 29] = [down, true, true, true]
$ Game_map.tab_passage [min + 30] = [down, true, true, true]
$ Game_map.tab_passage [min + 31] = [down, true, true, true]
$ Game_map.tab_passage [min + 32] = [true, left, right, true]
$ Game_map.tab_passage [min + 33] = [down, true, true, up]
$ Game_map.tab_passage [min + 34] = [true, left, true, up]
$ Game_map.tab_passage [min + 35] = [true, left, true, up]
$ Game_map.tab_passage [min + 36] = [true, true, right, up]
$ Game_map.tab_passage [min + 37] = [true, true, right, up]
$ Game_map.tab_passage [min + 38] = [down, true, right, true]
$ Game_map.tab_passage [min + 39] = [down, true, right, true]
$ Game_map.tab_passage [min + 40] = [down, left, true, true]
$ Game_map.tab_passage [min + 41] = [down, left, true, true]
$ Game_map.tab_passage [min + 42] = [true, left, right, up]
$ Game_map.tab_passage [min + 43] = [down, left, true, up]
$ Game_map.tab_passage [min + 44] = [down, left, right, true]
$ Game_map.tab_passage [min + 45] = [down, true, right, up]
$ Game_map.tab_passage [min + 46] = [down, left, right, up]
end
def change_passage (file, x, y, down, left, right, up)
down if a ==
down = false
else
down = true
end
if left == 1
left = false
else
left = true
end
if right == 1
right = false
else
right = true
end
if up == 1
up = false
else
up = true
end
box file
when "A1"
min = 2048 + (((y * 8) + x) * 48)
max = min + 47
autotiles (min, down, left, right, up)
when "A2"
min = 2816 + (((y * 8) + x) * 48)
max = min + 47
autotiles (min, down, left, right, up)
when "A3"
min = 4352 + (((y * 8) + x) * 48)
max = min + 47
autotiles (min, down, left, right, up)
when "A4"
min = 5888 + (((y * 8) + x) * 48)
max = min + 47
autotiles (min, down, left, right, up)
when "A5"
min = 1536 + ((y * 8) + x)
max = min + 1
for tile_id in min ... max
$ Game_map.tab_passage [tile_id] = [down, left, right, up]
end
when "B"
min = 0 + ((y * 8) + x)
max = min + 1
for tile_id in min ... max
$ Game_map.tab_passage [tile_id] = [down, left, right, up]
end
when "C"
min = 256 + ((y * 8) + x)
max = min + 1
for tile_id in min ... max
$ Game_map.tab_passage [tile_id] = [down, left, right, up]
end
when "D"
min = 512 + ((y * 8) + x)
max = min + 1
for tile_id in min ... max
$ Game_map.tab_passage [tile_id] = [down, left, right, up]
end
when "E"
min = 768 + ((y * 8) + x)
max = min + 1
for tile_id in min ... max
$ Game_map.tab_passage [tile_id] = [down, left, right, up]
end
end
end
end
#================================================= =============================
#
# Changes the notion of whether a key is pressed ...
#
#================================================= =============================
Game_Player class
def check_event_trigger_here (triggers)
return false if $ game_map.interpreter.running?
result = false
for event in $ game_map.events_xy (@ x, @ y)
if triggers.include? (event.trigger) # here we include also change if the priority is 1
event.start
result = true if event.starting
end
end
return result
end
end