=begin ▼ 乗り物擬似3D化 データベース ver. 3.0 RPGツクールVXAce用スクリプト 制作 : 木星ペンギン URL : http://woodpenguin.blog.fc2.com/ ------------------------------------------------------------------------------ 概要 □ 乗り物搭乗時の画面を、後方から視た擬似3Dで表示します。 ------------------------------------------------------------------------------ 使い方 □ 各パラメータの簡易説明 :system => 乗り物を追加する場合の基本データ :switch_id => 乗り物搭乗時にONになるスイッチID :passage1 => 通行できるオートタイルの種類の配列 :passage2 => タイルセットB〜Eを通行できるかどうか :land_denial => 乗り物から降りられないオートタイルの種類の配列 :move_speed => 移動速度(小数点以下も可能) :turning => 旋回速度 :walk_anime => 搭乗中の歩行アニメフラグ :step_anime => 搭乗中の足踏みアニメフラグ :encount => エンカウント率(100で通常と同じ) :sync_dir => 搭乗時に乗り物の向きをプレイヤーの向きに合わせるフラグ :get_here => 重なった状態で搭乗するかどうかのフラグ :flight => 飛行フラグ :max_altitude => 飛行時の高度の上限 :min_altitude => 飛行時の高度の下限 :dir_type => 搭乗中に表示される乗り物の向き変更タイプ :vehicle_index1 => 搭乗中に表示される乗り物の歩行グラフィックのインデックス1 :vehicle_index2 => 搭乗中に表示される乗り物の歩行グラフィックのインデックス2 :vehicle_index3 => 搭乗中に表示される乗り物の歩行グラフィックのインデックス3 :vehicle_zoom => 搭乗中に表示される歩行グラフィックの拡大率 :inp_forward1 => 前進を行うボタン1 :inp_forward2 => 前進を行うボタン2 :inp_backward => 後退を行うボタン :inp_turnleft1 => 右に旋回するボタン1 :inp_turnleft2 => 右に旋回するボタン2 :inp_turnright1 => 左に旋回するボタン1 :inp_turnright2 => 左に旋回するボタン2 :inp_up => 上昇するボタン(飛行タイプのみ) :inp_down => 下降するボタン(飛行タイプのみ) :inp_horz => 水平移動するボタン(このボタンと方向キーで操作) :inp_get_off => 乗り物から降りるボタン :inp_event => イベントを調べるボタン :inp_menu => メニュー画面を開くボタン □ 設定項目の詳細説明は下記のサイトを参照してください。 http://woodpenguin.web.fc2.com/rgss3/vehicle3D.html =end module WdTk module Veh3D @data = {} #////////////////////////////////////////////////////////////////////////////// # # 設定項目 # #////////////////////////////////////////////////////////////////////////////// #-------------------------------------------------------------------------- # ● 背景画像 #-------------------------------------------------------------------------- Scenery = "BlueSky" #-------------------------------------------------------------------------- # ● 背景のループ回数 #-------------------------------------------------------------------------- Repeat = 4 #-------------------------------------------------------------------------- # ● フレームレート (10 〜 60) #-------------------------------------------------------------------------- FrameRate = 40 #-------------------------------------------------------------------------- # ● 小型船の設定 #-------------------------------------------------------------------------- vehicle = {} vehicle[:passage1] = [0,6,8,12,14] vehicle[:move_speed] = 4 vehicle[:turning] = 16 vehicle[:encount] = 100 vehicle[:sync_dir] = true vehicle[:get_here] = false vehicle[:dir_type] = 0 vehicle[:inp_forward1] = :A vehicle[:inp_forward2] = :UP vehicle[:inp_backward] = :DOWN vehicle[:inp_turnleft1] = :LEFT vehicle[:inp_turnright1] = :RIGHT vehicle[:inp_get_off] = :C vehicle[:inp_event] = :C vehicle[:inp_menu] = :B @data[:boat] = vehicle #-------------------------------------------------------------------------- # ● 大型船の設定 #-------------------------------------------------------------------------- vehicle = {} vehicle[:passage1] = [0,1,6,8,12,14] vehicle[:move_speed] = 5 vehicle[:turning] = 8 vehicle[:encount] = 50 vehicle[:sync_dir] = true vehicle[:get_here] = false vehicle[:dir_type] = 0 vehicle[:inp_forward1] = :A vehicle[:inp_forward2] = :UP vehicle[:inp_backward] = :DOWN vehicle[:inp_turnleft1] = :LEFT vehicle[:inp_turnright1] = :RIGHT vehicle[:inp_get_off] = :C vehicle[:inp_event] = :C vehicle[:inp_menu] = :B @data[:ship] = vehicle #-------------------------------------------------------------------------- # ● 飛行船の設定 #-------------------------------------------------------------------------- vehicle = {} vehicle[:land_denial] = (0..15).to_a + [20,21,23,28,31,36,39,43,44,45,47] vehicle[:move_speed] = 6 vehicle[:turning] = 12 vehicle[:encount] = 0 vehicle[:get_here] = true vehicle[:flight] = true vehicle[:dir_type] = 0 vehicle[:inp_forward1] = :A vehicle[:inp_turnleft1] = :LEFT vehicle[:inp_turnleft2] = :L vehicle[:inp_turnright1] = :RIGHT vehicle[:inp_turnright2] = :R vehicle[:inp_up] = :DOWN vehicle[:inp_down] = :UP vehicle[:inp_horz] = :X vehicle[:inp_get_off] = :C vehicle[:inp_menu] = :B @data[:airship] = vehicle #-------------------------------------------------------------------------- # ● 馬の設定 (サンプル 1) #-------------------------------------------------------------------------- vehicle = {} vehicle[:system] = RPG::System::Vehicle.new vehicle[:system].character_name = "Animal" vehicle[:system].character_index = 5 vehicle[:system].bgm = RPG::BGM.new('Field1') vehicle[:system].start_map_id = 1 vehicle[:system].start_x = 58 vehicle[:system].start_y = 107 vehicle[:passage1] = [16,17,18,19,24,25,26,27,29,32,33,34,35,37,40,42] vehicle[:passage2] = true vehicle[:move_speed] = 4.5 vehicle[:turning] = 16 vehicle[:step_anime] = false vehicle[:encount] = 0 vehicle[:sync_dir] = true vehicle[:get_here] = true vehicle[:dir_type] = 0 vehicle[:inp_forward1] = :A vehicle[:inp_forward2] = :UP vehicle[:inp_backward] = :DOWN vehicle[:inp_turnleft1] = :LEFT vehicle[:inp_turnright1] = :RIGHT vehicle[:inp_get_off] = :C vehicle[:inp_event] = :C vehicle[:inp_menu] = :B #@data[:horse] = vehicle # コメントアウト解除で配置されます。 #-------------------------------------------------------------------------- # ● 飛行船2の設定 (サンプル 2) #-------------------------------------------------------------------------- vehicle = {} vehicle[:system] = RPG::System::Vehicle.new vehicle[:system].character_name = "Vehicle" vehicle[:system].character_index = 2 vehicle[:system].bgm = RPG::BGM.new('Field1') vehicle[:system].start_map_id = 1 vehicle[:system].start_x = 58 vehicle[:system].start_y = 107 vehicle[:land_denial] = (0..15).to_a + [20,21,23,28,31,36,39,43,44,45,47] vehicle[:flight] = true vehicle[:move_speed] = 4 vehicle[:turning] = 10 vehicle[:encount] = 0 vehicle[:get_here] = true vehicle[:max_altitude] = 60 vehicle[:dir_type] = 0 vehicle[:inp_forward1] = :UP vehicle[:inp_backward] = :DOWN vehicle[:inp_left] = :LEFT vehicle[:inp_right] = :RIGHT vehicle[:inp_turnleft1] = :LEFT vehicle[:inp_turnleft2] = :L vehicle[:inp_turnright1] = :RIGHT vehicle[:inp_turnright2] = :R vehicle[:inp_up] = :C vehicle[:inp_down] = :B vehicle[:inp_horz] = :A #@data[:S_airship] = vehicle #////////////////////////////////////////////////////////////////////////////// # # 以降、変更する必要なし # #////////////////////////////////////////////////////////////////////////////// #-------------------------------------------------------------------------- # ● 最低限必要な乗り物データが設定されているかどうかチェック #-------------------------------------------------------------------------- def self.msg_non_data(type, param) unless @data[type][param] message = "乗り物 [:%s] のパラメータ [:%s] を設定してください。" msgbox sprintf(message, type, param) exit end end @data.each_key do |type| msg_non_data(type, :system) unless [:boat, :ship, :airship].include?(type) msg_non_data(type, :move_speed) msg_non_data(type, :turning) msg_non_data(type, :dir_type) msg_non_data(type, :vehicle_index3) if @data[type][:dir_type] == 3 end def self.data @data end end @material ||= [] @material << :Veh3D def self.include?(sym) @material.include?(sym) end end