Main Menu
  • Welcome to The RPG Maker Resource Kit.

how do i use this script

Started by Arial_Nuke, September 08, 2006, 11:40:42 PM

0 Members and 1 Guest are viewing this topic.

Arial_Nuke

i want to use it to make huge rideable war galleons and airships and dragons and things so heres the script





#================================================= =============================
# ** Vehicle System
#================================================= =============================
# SephirothSpawn
# Version 1
# 2006-04-12
#================================================= =============================
# * Instructions :
#
# ~ Creating Event Vehicles:
# - Create An Event With The Following Comment Lines
#
# Comment: Vehicle Event
# Comment: Passable Terrains

  • #
    # x : Passable Terrains for the vehicle (0 - 7)
    #
    # - Additional Comment Lines:
    #
    # Comment: Step Animation ( Turns On Stepping Animation )
    # Comment: Always On Top ( Turns Vehicle Always On Top )
    # Comment: Through Event ( Allows Vehicle To Pass Through Events )
    #
    # ~ Creating Game Vehicles (Requires Some Scripting):
    # - Look In The Vehicle_System Module
    # - In the Constant Vehicles, create a new Game_Vehicle
    #
    # Vehicles = [
    # Game_Vehicle.new(name, hue, terrains, step_anime, on_top, through),
    #
    # name : Character Filename for Vehicle
    # hue : Hue of Character
    # terrains : Array of Passable Terrains
    # step_anime : True (On) or False (Off)
    # on_top : True (On) or False (Off)
    # through : True (On) or False (Off)
    #
    # - Calling Game Vehicle (For Entering & Exiting)
    #
    # $game_player.game_vehicle(vehicle_id)
    #
    # vehicle_id : Index in your Vehicles Constant
    #================================================= =============================

    #------------------------------------------------------------------------------
    # * SDK Log Script
    #------------------------------------------------------------------------------
    SDK.log('Vehicle System', 'SephirothSpawn', 1, '2006-04-12')

    #------------------------------------------------------------------------------
    # * Begin SDK Enable Test
    #------------------------------------------------------------------------------
    if SDK.state('Vehicle System') == true

    #================================================= =============================
    # ** Vehicle System
    #================================================= =============================

    module Vehicle_System
    #================================================= =============================
    # ** Game_Vehicle
    #================================================= =============================

    class Game_Vehicle
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_reader :character_name
    attr_reader :character_hue
    attr_reader :passable_terrains
    attr_reader tep_animation
    attr_reader :always_on_top
    attr_reader :event_through
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize(name, hue, terr, anim = true, top = false, e_t = false)
    # Assigns Vehicle Attributes
    @character_name = name
    @character_hue = hue
    @passable_terrains = terr
    @step_animation = anim
    @always_on_top = top
    @event_through = false
    end
    end

    #================================================= =============================
    # ** Vehicles Constant
    #================================================= =============================

    Vehicles = [
    # Landrover
    Game_Vehicle.new('056-Snake02', 0,
  • ),
    # Airship
    Game_Vehicle.new('074-Bird04', 0, [0, 1, 2, 3, 4, 5, 6, 7], true, true, true),
    # Boat
    Game_Vehicle.new('084-Elemental02', 0, [1])
    ]
    end

    #================================================= =============================
    # ** Game_Character
    #================================================= =============================

    class Game_Character
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_accessor :character_hue, :character_name
    attr_accessor :direction, tep_anime, :always_on_top
    attr_accessor :restore_animation, :restore_ontop
    end

    #================================================= =============================
    # ** Game_Event
    #================================================= =============================

    class Game_Event < Game_Character
    #--------------------------------------------------------------------------
    # * Alias Listings
    #--------------------------------------------------------------------------
    alias seph_vehicles_gameevent_start start
    #--------------------------------------------------------------------------
    # * Start Event
    #--------------------------------------------------------------------------
    def start
    # Original Start Processing
    seph_vehicles_gameevent_start
    # If Starting
    if @starting
    # Vehicle Defaults
    vehicle_event = false
    passable_terrains = []
    step_animation = true
    always_on_top = false
    e_t = false
    # Checks Each Code
    for i in 0...@list.size
    # If Event Command is Comment
    if @list.code == 108
    # If Event Comment is Vehicle Event
    if @list.parameters[0] == 'Vehicle Event'
    vehicle_event = true
    next
    end
    # if Event Comment contains Passable Terrains
    if @list.parameters[0].include?('Passable Terrains')
    @list.parameters[0].dup.gsub!(/\[(.+?)\]/) do
    passable_terrains = eval "[#{$1}]"
    end
    next
    end
    # If Event Comment is Step Animation
    if @list.parameters[0] == 'Step Animation'
    step_animation = true
    next
    end
    # If Event Comment is Always On Top
    if @list.parameters[0] == 'Always On Top'
    always_on_top = true
    next
    end
    # If Event Comment is Event Through
    if @list.parameters[0] == 'Through Event'
    e_t = true
    next
    end
    end
    end
    # If Vehicle Event
    if vehicle_event
    # Enter Vehicle
    $game_player.event_vehicle(@id, passable_terrains,
    step_animation, always_on_top, e_t)
    end
    end
    end
    end

    #================================================= =============================
    # ** Game_Player
    #================================================= =============================

    class Game_Player < Game_Character
    #--------------------------------------------------------------------------
    # * Public Instance Variable
    #--------------------------------------------------------------------------
    attr_reader :event_vehicle_mode
    attr_reader :game_vehicle_mode
    #--------------------------------------------------------------------------
    # * Alias Listings
    #--------------------------------------------------------------------------
    alias seph_vehicles_gameplyr_init initialize
    alias seph_vehicles_gameplyr_pass? passable?
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize
    # Original Initialization
    seph_vehicles_gameplyr_init
    # Vehicle Setup
    vehicle_setup
    end
    #--------------------------------------------------------------------------
    # * Vehicle Setup
    #--------------------------------------------------------------------------
    def vehicle_setup
    # Event Vehicle Data
    @event_vehicle_id = nil
    @event_vehicle_mode = false
    # Game Vehicle Data
    @game_vehicle_id = nil
    @game_vehicle_mode = false
    # Event Through
    @event_through = false
    # Creates Passable Terrains
    @passable_terrains = []
    end
    #--------------------------------------------------------------------------
    # * Event Vehicle
    #--------------------------------------------------------------------------
    def event_vehicle(event_id, terrains, anim, top, e_t)
    # Return if Game Vehicle Mode
    return if @game_vehicle_mode
    # If Not In Vehicle
    if @event_vehicle_id.nil?
    enter_event_vehicle(event_id, terrains, anim, top, e_t)
    # Exit Vehicle
    elsif @event_vehicle_id == event_id
    exit_event_vehicle(event_id)
    end
    end
    #--------------------------------------------------------------------------
    # * Enter Event Vehicle
    #--------------------------------------------------------------------------
    def enter_event_vehicle(event_id, terrains, anim, top, e_t)
    # Turns On Vehicle Mode
    @event_vehicle_mode = true
    # Stores Vehicle Data
    @event_vehicle_id = event_id
    # Gets Event Data
    event = $game_map.events[event_id]
    event_c_name = event.character_name
    event_c_hue = event.character_hue
    event_x, event_y = event.x, event.y
    event_dir = event.direction
    # Saves Event & Player Information
    event.restore_animation = event.step_anime
    event.restore_ontop = event.always_on_top
    @restore_animation = @step_anime
    @restore_ontop = @always_on_top
    # Changes Event Data
    event.step_anime = false
    event.character_name = @character_name
    event.character_hue = @character_hue
    event.moveto(@x, @y)
    event.direction = @direction
    # Change Player Data
    @character_name = event_c_name
    @character_hue = event_c_hue
    self.moveto(event_x, event_y)
    @direction = event_dir
    # Change Step Animation, On Top & Event Through
    @step_anime = anim
    @always_on_top = top
    @event_through = e_t
    # Turns On Passable Terrains
    @passable_terrains = terrains
    end
    #--------------------------------------------------------------------------
    # * Exit Event Vehicle
    #--------------------------------------------------------------------------
    def exit_event_vehicle(event_id)
    # Turns Off Vehicle Mode
    @event_vehicle_mode = false
    # Clears Vehicle Data
    @event_vehicle_id = nil
    # Gets Event Data
    event = $game_map.events[event_id]
    event_x, event_y = event.x, event.y
    event_dir = event.direction
    # Changes Event Data
    event.character_name = @character_name
    event.character_hue = @character_hue
    event.moveto(@x, @y)
    event.direction = @direction
    # Change Player Data
    self.moveto(event_x, event_y)
    @direction = event_dir
    refresh
    # Restore Event & Player Information
    event.step_anime = event.restore_animation
    event.always_on_top = event.restore_ontop
    @step_anime = @restore_animation
    @always_on_top = @restore_ontop
    @event_through = false
    # Turns On Passable Terrains
    @passable_terrains = []
    end
    #--------------------------------------------------------------------------
    # * Game Vehicle
    #--------------------------------------------------------------------------
    def game_vehicle(vehicle_id)
    # Return If In Vehicle Mode
    return if @event_vehicle_mode
    # Enter Game Vehicle
    if @game_vehicle_id.nil?
    enter_game_vehicle(vehicle_id)
    # Exit Game Vehicle
    elsif @game_vehicle_id == vehicle_id
    exit_game_vehicle
    end
    end
    #--------------------------------------------------------------------------
    # * Enter Game Vehicle
    #--------------------------------------------------------------------------
    def enter_game_vehicle(vehicle_id)
    # Turns On Game Vehicle
    @game_vehicle_mode = true
    # Saves Game Vehicle ID
    @game_vehicle_id = vehicle_id
    # Gets Vehicle Data
    vehicle = Vehicle_System::Vehicles[vehicle_id]
    # Saves Player Information
    @restore_animation = @step_anime
    @restore_ontop = @always_on_top
    # Change Player Data
    @character_name = vehicle.character_name
    @character_hue = vehicle.character_hue
    @step_anime = vehicle.step_animation
    @always_on_top = vehicle.always_on_top
    @event_through = vehicle.event_through
    # Turns On Passable Terrains
    @passable_terrains = vehicle.passable_terrains
    end
    #--------------------------------------------------------------------------
    # * Exit Game Vehicle
    #--------------------------------------------------------------------------
    def exit_game_vehicle
    # Turns Off Game Vehicle
    @game_vehicle_mode = false
    # Resets Game Vehicle ID
    @game_vehicle_id = nil
    # Refreshes Player Data
    $game_player.refresh
    @step_anime = @restore_animation
    @always_on_top = @restore_ontop
    @event_through = false
    # Turns Off Passable Terrains
    @passable_terrains = []
    end
    #--------------------------------------------------------------------------
    # * Passable Determinants
    # x : x-coordinate
    # y : y-coordinate
    # d : direction (0,2,4,6,8)
    # * 0 = Determines if all directions are impassable (for jumping)
    #--------------------------------------------------------------------------
    def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless $game_map.valid?(new_x, new_y)
    # Impassable
    return false
    end
    # If In Vehicle Mode
    if @event_vehicle_mode || @game_vehicle_mode
    # Checks Terrain List
    if @passable_terrains.include?($game_map.terrain_tag( new_x, new_y))
    # Unless Event Through
    unless @event_through
    # Loop all events
    for event in $game_map.events.values
    # If event coordinates are consistent with move destination
    if event.x == new_x and event.y == new_y
    # If through is OFF
    unless event.through
    return false unless event.character_name == ""
    end
    end
    end
    end
    return true
    else
    return false
    end
    end
    # Original Passable Check
    seph_vehicles_gameplyr_pass?(x, y, d)
    end
    end

    #--------------------------------------------------------------------------
    # * End SDK Enable Test
    #--------------------------------------------------------------------------
    end


Nightwolf

either above main
or somewhere in some weapon section
or zeriab
Arlen is hot.

Zeriab


thingy

why did they remove vehicles after 2k3...
Zypher, Veltonvelton, and Dalton are secretly having a homosexual affair in hidden messages just like this one
research shows Fu is also involved, but not in a gross and creepy way