- Joined
- Jun 9, 2014
- Messages
- 129
- Reaction score
- 21
- First Language
- English
- Primarily Uses
I'm trying to use the Land vehicles script but getting an error
but when I run the game I get the error:
Spript 'Land vehicle script' line 88: NameError occured.
Uninicialized constant Object::Game_Character
I'm guessing this is something easy to fix, since others have gotten it working fine, but I'm still learning how to use script in VXA...
# ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
# ║ Land Vehicle │ v1.02 │ (01/30/12) ║
# ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
# ║ Author: William Couillard ║
# ║ Thanks: Galv (http://galveraxe.wordpress.com/)%C2 ║
# ║ E-Mail: cooliebk18@yahoo.com ║
# ║ Website: ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ABOUT ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ This script changes how the "Boat" vehicle functions. By default, the ║
# ║ boat an travel on water, the same as the ship. Why isn't there a land ║
# ║ vehicle? This script changes the boat to function as a land vehicle, able ║
# ║ to travel over any terrain that the player can (at a faster speed and ║
# ║ without encounters), and blocks it from traveling over water or ║
# ║ activating touch and confirm event processes. ║
# ║ ║
# ║ Anyone familiar with how Chocobos functioned in the SNES-era Final ║
# ║ Fantasy titles should notice similarities here. ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ USAGE ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ Plug and play! This script overwrites a few methods in Game_Map, ║
# ║ Game_Player and Game_Vehicle. As long as you don't have scripts that ║
# ║ alter the exact same methods used in this script, you should have no ║
# ║ compatibility issues! ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ CHANGE LOG ║
# ╠═════════════════════════════════════════════════════════════════╤═════════╣
# ║ ■ January 30, 2012 : Bug fixed. │ (v1.02) ║
# ╟─────────────────────────────────────────────────────────────────┼─────────╢
# ║ ■ December 01, 2012 : Added option to keep encounters & touch │ (v1.01) ║
# ║ events. │ ║
# ╟─────────────────────────────────────────────────────────────────┼─────────╢
# ║ ■ November 27, 2012 : Initial release. │ (v1.00) ║
# ╠═════════════════════════════════════════════════════════════════╧═════════╣
# ║ NEXT VERSION ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ■ Script completed! ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ OVERWRITTEN METHODS ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ This script overwrites a few methods in various default scripts. ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Game_Map ║
# ║ ► def boat_passable? ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Game_Player < Game_Character ║
# ║ ► def map_passable? ║
# ║ ► def update_encounter ║
# ║ ► def check_touch_event ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Game_Vehicle > Game_Character ║
# ║ ► def init_move_speed ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ INSTRUCTIONS ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ Paste this script ABOVE Main and BELOW Game_Vehicle. ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ IMPORT SETTING ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
$imported = {} if $imported.nil?
$imported["WC-LandVehicle_1.1"] = true
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ CUSTOMIZATION MODULE ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
module COOLIE
module VEHICLE
VEHICLE_SPEED = 5 # Higher number = faster speed, maximum of 6.
VEHICLE_ENCOUNTERS = false # Change to true if you want enemy encounters
# while piloting the vehicle.
VEHICLE_TOUCH = false # Change to true if you want touch events to
# process while piloting the vehicle.
end
end
#-------------------------------------------------------------------------------
class Game_Map
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Determine if Passable by Land Vehicle ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Changes the Boat vehicle to have the same passability as the player. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def boat_passable?(x, y, d)
check_passage(x, y, (1 << (d / 2 - 1)) & 0x0f)
end
end
class Game_Player < Game_Character
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Map Passable? ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Determines passability. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def map_passable?(x, y, d)
case @vehicle_type
when :boat
$game_map.boat_passable?(x, y, d)
when :ship
$game_map.ship_passable?(x, y)
when :airship
true
else
super
end
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Update Encounters ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Turns off encounters if piloting the Land Vehicle. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def update_encounter
return if $TEST && Input.press?
CTRL)
return if $game_party.encounter_none?
return if in_airship?
unless COOLIE::VEHICLE::VEHICLE_ENCOUNTERS == true
return if in_boat? # If you want encounters when in the boat, remove this line.
end
return if @move_route_forcing
@encounter_count -= encounter_progress_value
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Determine if Event Start Caused by Touch (Overlap) ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Disables touch events when driving the Land Vehicle, including teleports. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def check_touch_event
return false if in_airship?
unless COOLIE::VEHICLE::VEHICLE_TOUCH == true
return false if in_boat?
end
check_event_trigger_here([1,2])
$game_map.setup_starting_event
end
end
class Game_Vehicle < Game_Character
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Initialize Move Speed ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Changes the player's movement speed when piloting the Land Vehicle. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def init_move_speed
@move_speed = COOLIE::VEHICLE::VEHICLE_SPEED if @type == :boat
@move_speed = 5 if @type == :ship
@move_speed = 6 if @type == :airship
end
end
# ║ Land Vehicle │ v1.02 │ (01/30/12) ║
# ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
# ║ Author: William Couillard ║
# ║ Thanks: Galv (http://galveraxe.wordpress.com/)%C2 ║
# ║ E-Mail: cooliebk18@yahoo.com ║
# ║ Website: ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ABOUT ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ This script changes how the "Boat" vehicle functions. By default, the ║
# ║ boat an travel on water, the same as the ship. Why isn't there a land ║
# ║ vehicle? This script changes the boat to function as a land vehicle, able ║
# ║ to travel over any terrain that the player can (at a faster speed and ║
# ║ without encounters), and blocks it from traveling over water or ║
# ║ activating touch and confirm event processes. ║
# ║ ║
# ║ Anyone familiar with how Chocobos functioned in the SNES-era Final ║
# ║ Fantasy titles should notice similarities here. ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ USAGE ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ Plug and play! This script overwrites a few methods in Game_Map, ║
# ║ Game_Player and Game_Vehicle. As long as you don't have scripts that ║
# ║ alter the exact same methods used in this script, you should have no ║
# ║ compatibility issues! ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ CHANGE LOG ║
# ╠═════════════════════════════════════════════════════════════════╤═════════╣
# ║ ■ January 30, 2012 : Bug fixed. │ (v1.02) ║
# ╟─────────────────────────────────────────────────────────────────┼─────────╢
# ║ ■ December 01, 2012 : Added option to keep encounters & touch │ (v1.01) ║
# ║ events. │ ║
# ╟─────────────────────────────────────────────────────────────────┼─────────╢
# ║ ■ November 27, 2012 : Initial release. │ (v1.00) ║
# ╠═════════════════════════════════════════════════════════════════╧═════════╣
# ║ NEXT VERSION ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ■ Script completed! ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ OVERWRITTEN METHODS ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ This script overwrites a few methods in various default scripts. ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Game_Map ║
# ║ ► def boat_passable? ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Game_Player < Game_Character ║
# ║ ► def map_passable? ║
# ║ ► def update_encounter ║
# ║ ► def check_touch_event ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Game_Vehicle > Game_Character ║
# ║ ► def init_move_speed ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ INSTRUCTIONS ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ Paste this script ABOVE Main and BELOW Game_Vehicle. ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ IMPORT SETTING ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
$imported = {} if $imported.nil?
$imported["WC-LandVehicle_1.1"] = true
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ CUSTOMIZATION MODULE ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
module COOLIE
module VEHICLE
VEHICLE_SPEED = 5 # Higher number = faster speed, maximum of 6.
VEHICLE_ENCOUNTERS = false # Change to true if you want enemy encounters
# while piloting the vehicle.
VEHICLE_TOUCH = false # Change to true if you want touch events to
# process while piloting the vehicle.
end
end
#-------------------------------------------------------------------------------
class Game_Map
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Determine if Passable by Land Vehicle ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Changes the Boat vehicle to have the same passability as the player. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def boat_passable?(x, y, d)
check_passage(x, y, (1 << (d / 2 - 1)) & 0x0f)
end
end
class Game_Player < Game_Character
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Map Passable? ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Determines passability. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def map_passable?(x, y, d)
case @vehicle_type
when :boat
$game_map.boat_passable?(x, y, d)
when :ship
$game_map.ship_passable?(x, y)
when :airship
true
else
super
end
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Update Encounters ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Turns off encounters if piloting the Land Vehicle. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def update_encounter
return if $TEST && Input.press?
return if $game_party.encounter_none?
return if in_airship?
unless COOLIE::VEHICLE::VEHICLE_ENCOUNTERS == true
return if in_boat? # If you want encounters when in the boat, remove this line.
end
return if @move_route_forcing
@encounter_count -= encounter_progress_value
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Determine if Event Start Caused by Touch (Overlap) ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Disables touch events when driving the Land Vehicle, including teleports. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def check_touch_event
return false if in_airship?
unless COOLIE::VEHICLE::VEHICLE_TOUCH == true
return false if in_boat?
end
check_event_trigger_here([1,2])
$game_map.setup_starting_event
end
end
class Game_Vehicle < Game_Character
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Initialize Move Speed ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ Changes the player's movement speed when piloting the Land Vehicle. ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
def init_move_speed
@move_speed = COOLIE::VEHICLE::VEHICLE_SPEED if @type == :boat
@move_speed = 5 if @type == :ship
@move_speed = 6 if @type == :airship
end
end
Spript 'Land vehicle script' line 88: NameError occured.
Uninicialized constant Object::Game_Character
I'm guessing this is something easy to fix, since others have gotten it working fine, but I'm still learning how to use script in VXA...
