Automatic Boat Call

RCS_2012

Villager
Member
Joined
Aug 28, 2012
Messages
6
Reaction score
1
First Language
English
Primarily Uses
I updated your code for Ace if you don't mind so others can use it. It did make a few changes being a professional programmer. So here you go so you can post the update (please take all the credit given that it is your idea and original work). Good job by the way for VX.



Code:
module CallBoatConfig

# The item that must be in inventory for the boat to be called
ITEM_ID = 147
# If this is set to "true", a map name must include this text:
#
# <boat>
#
# in order for the boat to be called automatically.
USE_BOAT_REQ = true
# If this is set to "true", an animation will play
# when the player gets on or off the boat.
USE_ANIMATION = true
# The animation displayed when the player gets on the
# boat if USE_ANIMATION is set to "true".
ON_ANIMATION_ID = 75
# The animation displayed when the player gets off of the
# boat if USE_ANIMATION is set to "true".
OFF_ANIMATION_ID = 75
# If this is set to "true", the boat will
# disappear when the player gets off of it.
REMOVE_VEHICLE = true
end

class Game_Vehicle
attr_accessor :direction
end

class Game_Map

alias :eds_pre_call_setup :setup
def setup(map_id)
eds_pre_call_setup(map_id)
@info = load_data("Data/MapInfos.rvdata2")
end

def can_use_boat?
return true unless CallBoatConfig::USE_BOAT_REQ
return @info[@map_id].name.downcase.include?("<boat>")
end

end

class Game_Player < Game_Character
include CallBoatConfig

def get_directional_pos(d)
x, y = 0, 0;

case(d)
	 when 8 #up
	 y, x = @y - 1, @x;
	 when 2 #down
	 y, x = @y + 1, @x;
	 when 6 #right
	 x, y = @x + 1, @y;
	 y = @y
	 when 4 #left
	 x, y = @x - 1, @y;
end
return x, y;
end
def should_call_boat?(d)

x, y = get_directional_pos(d);

if ($game_map.can_use_boat? &&
	 $game_party.items.include?($data_items[ITEM_ID]) &&
	 $game_map.boat_passable?(x, y) &&
	 !@vehicle_getting_on &&
	 !in_boat?)
	 auto_call_boat(x, y);
	 return true;
end

return false;
end

def auto_call_boat(x, y)
$game_map.boat.direction = $game_player.direction;
$game_map.boat.set_location($game_map.map_id, x, y);
if(USE_ANIMATION)
	 $game_map.boat.animation_id = ON_ANIMATION_ID
end
get_on_vehicle
end
#--------------------------------------------------------------------------
# * Move Up
#--------------------------------------------------------------------------
alias _move_straight move_straight
def move_straight(d, turn_ok = true)
	 _move_straight(d, turn_ok) unless should_call_boat?(d);
end
#--------------------------------------------------------------------------
# * Move Right
#--------------------------------------------------------------------------
alias _move_diagonal move_diagonal
def move_diagonal(d, turn_ok = true)
_move_diagonal(d, turn_ok) unless should_call_boat?(d);
end

#--------------------------------------------------------------------------
# * Get Off Vehicle
#--------------------------------------------------------------------------
alias _get_off_vehicle get_off_vehicle
def get_off_vehicle
in_boat = (@vehicle_type == 0);
_get_off_vehicle();
if REMOVE_VEHICLE
	 $game_map.boat.set_location(-1, -1, -1)
	 if USE_ANIMATION
	 $game_map.boat.animation_id = 75;
	 end
end
end

end
 

BigEd781

undefined method 'stupid_title' found for nil:NilC
Veteran
Joined
Mar 1, 2012
Messages
940
Reaction score
304
First Language
Dothraki
Primarily Uses
N/A
I don't mind at all. Feel free to post it in the Ace scripts forum as well where it will be easier to find.
 

celebrus

Veteran
Veteran
Joined
May 2, 2012
Messages
233
Reaction score
2
First Language
English
Primarily Uses
This is really great. I've been waiting for something like this for awhile! One bug, though: When you get off the boat and attempt to directly walk back into the river, the boat reappears, but the player does not embark. If you can fix that, it's gold! :)

Thanks for the original script BigEd and thanks for the port RCS!

Edit: Two more things: (1) The boat is activated even when in the airship. (2) Auto-disembarking when you walk back onto land would be nice.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top