何も見つからなかった!(オブジェクト指定版) |
使い方
・# コモンイベントID ID = 21←ここのそれぞれのIDを入れたいコモンイベントIDに変える ・新たに反応させたいオブジェクトを増やしたい場合 1.------ここから------ ID3 = 101 # ▼ 適応させるタイル番号 (ここでは木箱)( , で区切る) TileA3 = [] TileB3 = [] TileC3 = [224,225,226,227,232,233,234,235,240,241,243,251] TileD3 = [170] TileE3 = [] ------ここまでをコピペ元のすぐ下にコピペする----- 2.[]内の番号をスクリプト内の計算式に基づいて反応させたいオブジェクトに指定。IDのところも上の使い方と同じく反応として使いたいコモンイベントのIDを指定 3.IDやTileなどのところの3を任意の数字に変える 4. #------------------------------------------------------- # ● 正面のイベント起動判定 #------------------------------------------------------- alias dai_not_event_check_event_trigger_there check_event_trigger_there def check_event_trigger_there(triggers) dai_not_event_check_event_trigger_there(triggers) check_not_map_event check_not_map_event2 check_not_map_event3 ここにcheck_not_map_event(さっき変えた任意の数字)を追加(例:check_not_map_event4) end 5.------ここから------ #-------------------------------------------------------- # ● マップID特殊イベントの起動チェック #------------------------------------------------------- def check_not_map_event3 return false if $game_map.interpreter.running? if @direction == 2 if $game_map.common_floor3?(x, y + 1) $game_temp.common_event_id = Riru_MAP_Auto_Event::ID3 end elsif @direction == 4 if $game_map.common_floor3?(x - 1, y) $game_temp.common_event_id = Riru_MAP_Auto_Event::ID3 end elsif @direction == 6 if $game_map.common_floor3?(x + 1, y) $game_temp.common_event_id = Riru_MAP_Auto_Event::ID3 end elsif @direction == 8 if $game_map.common_floor3?(x, y - 1) $game_temp.common_event_id = Riru_MAP_Auto_Event::ID3 end end end ------ここまでをコピペ元のすぐ下にコピペし、赤色の数字をさっき決めた数字に変更----- 6.------ここから------ #------------------------------------- # ● 床の判定 #--------------------------------------- def common_floor3?(x, y) for i in [2, 1, 0] tile_id = @map.data[x, y, i] next if tile_id == nil return true if $game_temp.common_floor3.include?(tile_id) end return false end ------ここまでをコピペ元のすぐ下にコピペし、赤色の数字をさっき決めた数字に変更----- 7. #------------------------------------------------- # ● 公開インスタンス変数 #------------------------------------------------ attr_accessor :common_floor attr_accessor :common_floor2 attr_accessor :common_floor3 attr_accessor :common_floor(決めた任意の数字) を追加 #--------------------------------------- # ● オブジェクト初期化 #---------------------------------------------- def initialize common_floor_temp setting_common_floor setting_common_floor2 setting_common_floor3 setting_common_floor(決めた任意の数字) を追加 8.------ここから------ #-------------------------------------- # ● タイルデータ の設定 #---------------------------------------- def setting_common_floor3 @common_floor3 = [] for type in 0..4 case type when 0; tiles = Riru_MAP_Auto_Event::TileA3 when 1; tiles = Riru_MAP_Auto_Event::TileB3 when 2; tiles = Riru_MAP_Auto_Event::TileC3 when 3; tiles = Riru_MAP_Auto_Event::TileD3 when 4; tiles = Riru_MAP_Auto_Event::TileE3 end for i in tiles do @common_floor3.concat(Tilenumber.tile_data(type, i)) end end end ------ここまでをコピペ元のすぐ下にコピペし、赤色の数字をさっき決めた数字に変更----- |