Help with land Vehicles Script...

Ashton

Veteran
Veteran
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

# ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
# ║ 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
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... :(
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
The best solution would be to use a script for VX Ace, not one for VX, as they have a different engine.


If the given dates inside the script are correct, that script can't have been written for use in Ace as even the japanese Ace was published Dez 2011 and that script claimed to have been finished in Jan 2012...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
then the script contains a wrong date - perhaps a typo.


In that case, did you start a new game after installing that script?


Initialization errors usually happen when you load a savegame from before the script was added.


Or it could be a script conflict - did you use any other script in your project?
 

Ashton

Veteran
Veteran
Joined
Jun 9, 2014
Messages
129
Reaction score
21
First Language
English
Primarily Uses
then the script contains a wrong date - perhaps a typo.

In that case, did you start a new game after installing that script?

Initialization errors usually happen when you load a savegame from before the script was added.

Or it could be a script conflict - did you use any other script in your project?
Never got to the point of starting a new game, I clicked the play test button and got a small black screen with a popup error atop it.

I'm using the tankentai abs script/system (it's placed under the code for the land vehicles in the script window)
 

Ashton

Veteran
Veteran
Joined
Jun 9, 2014
Messages
129
Reaction score
21
First Language
English
Primarily Uses
Just an update for anyone reading this - I found my error and it's working perfectly now. I was using the script files from my battle system, which were in japanese, and I didnt know there *were* specific areas like "main" and "materials" because they were written in Kanji/kakanna. After looking through the script files from the demo for this code, I saw where they were >.< 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Ashton, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Also, don't post scripts in your post unless they're not available anywhere else. Just put a link to where you downloaded it from.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
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'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top