设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1608|回复: 7
打印 上一主题 下一主题

[已经解决] vx如何扩展数据库呢?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
31 小时
注册时间
2012-12-1
帖子
19
跳转到指定楼层
1
发表于 2013-1-14 07:27:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
用的vx 只能用abcde这5个图块的模板

不知道要怎么才能扩展呢。

素材都不够用了。

要是替换原有的abcde的话呢,因为地图已经画了很多了,也没法换了。

而且默认素材也有很多很好用的。

多谢啦。

Lv4.逐梦者

梦石
0
星屑
19334
在线时间
3077 小时
注册时间
2013-1-11
帖子
1288
2
发表于 2013-1-14 09:51:53 | 只看该作者
本帖最后由 张咚咚 于 2013-1-14 09:54 编辑

使用此脚本插入到Main上面
楼主给经验啊

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/    ◆ 图块扩张 - KGC_TilesetExtension ◆ VX ◆
#_/    ◇ Last update : 2008/01/20 ◇
#_/----------------------------------------------------------------------------
#_/       变更图块图像、增加4方向通行、地形标记功能。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

=begin

  在地图名称加上[默认地图图块图档名称 新地图图块图档名称]
  
  例如:
  
  森林[A2 A2_2][B B_3]
  就是说用 TileA2_2 代替 TileA2
        用 TileB_3 代替 TileB

  脚本中定义方法
  
  在30行下面定义哈希表:
  TILE_PRESET["组名称"] = {
    "默认地图图块图档名称1"=>"新地图图块图档名称",
    "默认地图图块图档名称2"=>"新地图图块图档名称",
    "默认地图图块图档名称3"=>"新地图图块图档名称",
    "默认地图图块图档名称4"=>"新地图图块图档名称",
    ...
  }
  然後在地图名称使用
  
  地图名称 [SET 组名称]

  例如:
  TILE_PRESET["魔王之城"] = {
    "A1" => "A1-Maou",
    "A2" => "A2-Maou",
    "B"  => "B-Maou",
    "D"  => "D-Maou",
  }

  魔王城─走廊[SET 魔王之城]
  
  就等於
  魔王城─走廊[A1 A1-Maou][A2 A2-Maou][B B-Maou][D D-Maou]
  
  继承自定义图块:
  在地图名称使用[inherit]就能继承其在地图管理器中父地图所定义的图块
  
  例如:
  魔王城─走廊[A1 A1-Maou][A2 A2-Maou][B B-Maou][D D-Maou]
   +--魔王城─房间一[inherit]
   
  如此「魔王城─房间一」就继承了魔王城─走廊已经定义过的所有图块。
  PS:地图管理器就是RMVX介面左下角(图块选择器的下面)那个

  变更的优先度:
  1. 继承
  2. 脚本自定义
  3. 个别设定
  
  
  例如
  - 魔王城堡[A1 A1-2][B B2][C C2]
      魔王城堡大厅[inherit][A2 A2-2]
    - 魔王城堡走廊[inherit][B B3]
        魔王城堡房间一[inherit][D D2]
    - 魔王城堡後院[A1 A1-100]
        魔王城堡─谜之间[inherit]
  
  则效果:
  *魔王城堡
      A1: TileA1-2
      B : TileB2
      C : TileC2
  *魔王城堡大厅
      A1: TileA1-2
      A2: TileA2-2
      B : TileB2
      C : TileC2
  *魔王城堡走廊
      A1: TileA1-2
      B : TileB3
      C : TileC2
  *魔王城堡房间一
      A1: TileA1-2
      B : TileB3
      C : TileC2
      D : TileD2
  *魔王城堡後院
      A1: TileA1-100
  *魔王城堡─谜之间
      A1: TileA1-100


四方向和地形标记需要软体
  下载:http://f44.aaa.livedoor.jp/~ytomy/cgi-bin/dl/dl.php?dl=vxtiletool
  
  说明:与XP相同,就是四方向
  地形标记可以增加到1~99个,不设置的话默认为0
  使用插件软件设置时,用shift + 点击可以将地形标记增加 10
  使用方式请看XP的说明
  
  
  
  地形标记相关脚本:
  get_terrain_tag(x, y[, variable_id])
    返回指定图块的地形标记至指定的变量
      x, y: 指定图块的XY座标
      variable_id:返回值储存位置(变量ID)(可不填)
      
      例如:get_terrain_tag(0, 32, 1)返回座标为(0,32)的地形标记并储存至1号变量
            $game_variable[1] = get_terrain_tag(0, 32) 同上
  
  get_event_terrain_tag(event_id[, variable_id])
    返回指定事件的地形标记至指定的变量
      event_id:指定事件的ID
      variable_id:返回值储存位置(变量ID)(可不填)
      
      例如:get_event_terrain_tag(32, 1)返回32号事件所在的地形标记并储存至1号变量
            $game_variable[1] = get_event_terrain_tag(32) 同上
      
  get_player_terrain_tag[(variable_id)]
    返回玩家角色的地形标记至指定的变量
      variable_id:返回值储存位置(变量ID)(可不填)
      
      例如:get_event_terrain_tag(1)返回玩家角色所在的地形标记并储存至1号变量
            $game_variable[1] = get_event_terrain_tag 同上
      
=end
#==============================================================================
# ★ 自定义項目 - Customize ★
#==============================================================================

module KGC
module TilesetExtension
  # ◆ 图块图像的字首
  #  图块图像名称前方的文字(如 TileA1 中的 Tile)

  TILE_IMAGE_PREFIX = "Tile"

  # ◆ 预设的图块图像
  #  使用[SET <预设组名称>]设定。

  TILE_PRESET = {}  # ← 这行不可删除
  # 预设在下方。
  # ↓范例


# 使用时,在地图名插入[SET 魔王之城]

  # ◆ 4方向通行、地形标记确认的按钮 (DEBUG用)
  #  按下此键之时,就会以对话框的方式显现
  #  当前玩家所在图块的可通行方向和地形标记。
  #  当设定为nil时则关闭此功能
  #   ※ 此功能只有在游戏测试时有效
  DEBUG_INFO_BUTTON = Input::F7
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

$imported = {} if $imported == nil
$imported["TilesetExtension"] = true

if $data_mapinfos == nil
  $data_mapinfos = load_data("Data/MapInfos.rvdata")
end

# 方向通行度 (4方向通行对应)
module DirectionFlag
  DOWN  = 0x01
  LEFT  = 0x02
  RIGHT = 0x04
  UP    = 0x08
end

module KGC::TilesetExtension
  # 扩张时储存的档案名称
  EX_RVDATA = "TilesetEx.rvdata"

  # 正規表現
  module Regexp
    # 継承
    INHERIT = /\[INHERIT\]/i
    # プリセット
    PRESET = /\[SET ([\w\-]+)\]/i
  end

  # デフォルトタイルセットファイル名
  DEFAULT_FILENAME = {
    "A1"=>"TileA1",
    "A2"=>"TileA2",
    "A3"=>"TileA3",
    "A4"=>"TileA4",
    "A5"=>"TileA5",
    "B"=>"TileB",
    "C"=>"TileC",
    "D"=>"TileD",
    "E"=>"TileE"
  }
  @@__filename = DEFAULT_FILENAME.dup

  module_function
  #--------------------------------------------------------------------------
  # ○ 指定マップのタイル画像ファイル名初期化
  #     map_id : マップ ID
  #--------------------------------------------------------------------------
  def init_tileset_filename(map_id)
    @@__filename = get_converted_tileset_filename(map_id)
  end
  #--------------------------------------------------------------------------
  # ○ 変換後のタイル画像ファイル名を取得
  #     map_id : マップ ID
  #--------------------------------------------------------------------------
  def get_converted_tileset_filename(map_id)
    info = $data_mapinfos[map_id]
    name = info.original_name
    filename = DEFAULT_FILENAME.dup
    if name =~ Regexp::INHERIT
      # 継承する場合は親を調べる
      parent_id = $data_mapinfos[map_id].parent_id
      if parent_id > 0
        filename = get_converted_tileset_filename(parent_id)
      end
    end
    # 現マップの変換規則を適用
    return convert_tileset_filename(filename, name)
  end
  #--------------------------------------------------------------------------
  # ○ タイル画像ファイル名変換
  #     filename : ファイル名 (Hash)
  #     map_name : マップ名
  #--------------------------------------------------------------------------
  def convert_tileset_filename(filename, map_name)
    name_buf = filename.dup
    # プリセット適用
    presets = map_name.scan(Regexp::PRESET)
    presets.each { |s|
      if TILE_PRESET.has_key?(s[0])
        TILE_PRESET[s[0]].each { |k, v|
          name_buf[k] = TILE_IMAGE_PREFIX + v
        }
      end
    }
    # 置換
    DEFAULT_FILENAME.keys.each { |key|
      if map_name =~ /\[#{key} ([\w\-]+)\]/
        name_buf[key] = TILE_IMAGE_PREFIX + $1
      end
    }
    return name_buf
  end
  #--------------------------------------------------------------------------
  # ○ タイル画像ファイル名取得
  #--------------------------------------------------------------------------
  def get_tileset_filename
    return @@__filename
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# □ KGC::Commands
#==============================================================================

module KGC::Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ 指定座標の地形タグ取得
  #     x : マップの X 座標
  #     y : マップの Y 座標
  #     variable_id : 取得した地形タグを代入する変数の ID
  #--------------------------------------------------------------------------
  def get_terrain_tag(x, y, variable_id = 0)
    tag = $game_map.terrain_tag(x, y)       # 指定位置のタグを取得
    if variable_id > 0
      $game_variables[variable_id] = tag    # 指定された変数に代入
    end
    return tag
  end
  #--------------------------------------------------------------------------
  # ○ 指定イベント ID の位置の地形タグ取得
  #     event_id : イベント ID
  #     variable_id : 取得した地形タグを代入する変数の ID
  #--------------------------------------------------------------------------
  def get_event_terrain_tag(event_id, variable_id = 0)
    event = $game_map.events.values.find { |e| e.id == event_id }
    if event == nil
      # 該当するイベントが無ければ 0
      tag = 0
    else
      tag = $game_map.terrain_tag(event.x, event.y)
    end

    # 指定された変数に代入
    if variable_id > 0
      $game_variables[variable_id] = tag
    end
    return tag
  end
  #--------------------------------------------------------------------------
  # ○ プレイヤーの位置の地形タグ取得
  #     variable_id : 取得した地形タグを代入する変数の ID
  #--------------------------------------------------------------------------
  def get_player_terrain_tag(variable_id = 0)
    tag = $game_map.terrain_tag($game_player.x, $game_player.y)

    # 指定された変数に代入
    if variable_id > 0
      $game_variables[variable_id] = tag
    end
    return tag
  end
end

class Game_Interpreter
  include KGC::Commands
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ RPG::MapInfo
#==============================================================================

class RPG::MapInfo
  #--------------------------------------------------------------------------
  # ● マップ名取得
  #--------------------------------------------------------------------------
  def name
    return @name.gsub(/\[.*\]/) { "" }
  end
  #--------------------------------------------------------------------------
  # ○ オリジナルマップ名取得
  #--------------------------------------------------------------------------
  def original_name
    return @name
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# □ RPG::Tileset
#------------------------------------------------------------------------------
#   タイルセットの付加的情報を扱うクラスです。
#==============================================================================

class RPG::Tileset
  #--------------------------------------------------------------------------
  # ○ 定数
  #--------------------------------------------------------------------------
  TABLE_SIZE = 8192                       # 通行・地形タグテーブルのサイズ
  #--------------------------------------------------------------------------
  # ○ 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :version                  # 内部バージョン
  attr_accessor :passages                 # 4 方向通行フラグ
  attr_accessor :terrain_tags             # 地形タグ
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    @version = 1
    @passages = Table.new(TABLE_SIZE)
    @terrain_tags = Table.new(TABLE_SIZE)
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map
  LAYERS = [2, 1, 0]
  #--------------------------------------------------------------------------
  # ● セットアップ
  #     map_id : マップ ID
  #--------------------------------------------------------------------------
  alias setup_KGC_TilesetExtension setup
  def setup(map_id)
    # タイルセット画像ファイル名を初期化
    KGC::TilesetExtension.init_tileset_filename(map_id)

    setup_KGC_TilesetExtension(map_id)
  end
  #--------------------------------------------------------------------------
  # ○ 指定座標の通行フラグ取得
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  def passage(x, y)
    LAYERS.each { |i|
      tile_id = @map.data[x, y, i]
      return 0 if tile_id == nil
      return $data_tileset.passages[tile_id]
    }
    return 0
  end
  #--------------------------------------------------------------------------
  # ○ 指定座標の地形タグ取得
  #     x : X 座標
  #     y : Y 座標
  #--------------------------------------------------------------------------
  def terrain_tag(x, y)
    LAYERS.each { |i|
      tile_id = @map.data[x, y, i]               # タイル ID を取得
      return 0 if tile_id == nil                 # タイル ID 取得失敗 : タグなし
      tag = $data_tileset.terrain_tags[tile_id]  # 地形タグを取得
      return tag if tag > 0                      # タグが設定してあれば返す
    }
    return 0
  end
  #--------------------------------------------------------------------------
  # ○ 指定方向通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #     d : 移動方向
  #--------------------------------------------------------------------------
  def passable_dir?(x, y, d)
    # 方向 (0,2,4,6,8,10) から 通行フラグ (0,1,2,4,8,0) に変換
    flag = (1 << (d / 2 - 1)) & 0x0F

    LAYERS.each { |i|                         # レイヤーの上から順に調べる
      tile_id = @map.data[x, y, i]            # タイル ID を取得
      return false if tile_id == nil          # タイル ID 取得失敗 : 通行不可
      pass = $data_tileset.passages[tile_id]  # タイルセットの通行属性を取得
      return false if pass & flag != 0x00     # フラグが立っていたら通行不可
    }
    return true
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Character
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # ○ 通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #     d : 移動方向 (省略時: 10)
  #--------------------------------------------------------------------------
  def passable?(x, y, d = 10)
    nx = moved_x(x, d)
    ny = moved_y(y, d)
    nx = $game_map.round_x(nx)                         # 横方向ループ補正
    ny = $game_map.round_y(ny)                         # 縦方向ループ補正
    return false unless $game_map.valid?(nx, ny)       # マップ外?
    return true if @through or debug_through?          # すり抜け ON?
    return false unless map_passable?(x, y, d)         # 指定方向に移動不能?
    return false unless map_passable?(nx, ny, 10 - d)  # 移動先が進入不能?
    return false if collide_with_characters?(nx, ny)   # キャラクターに衝突?
    return true                                        # 通行可
  end
  #--------------------------------------------------------------------------
  # ○ 移動後の X 座標算出
  #     x : X 座標
  #     d : 移動方向
  #    移動後の X 座標を計算する。
  #--------------------------------------------------------------------------
  def moved_x(x, d)
    return x + (d == 6 ? 1 : d == 4 ? -1 : 0)
  end
  #--------------------------------------------------------------------------
  # ○ 移動後の Y 座標算出
  #     y : Y 座標
  #     d : 移動方向
  #    移動後の Y 座標を計算する。
  #--------------------------------------------------------------------------
  def moved_y(y, d)
    return y + (d == 2 ? 1 : d == 8 ? -1 : 0)
  end
  #--------------------------------------------------------------------------
  # ○ マップ通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #     d : 移動方向
  #    指定座標の指定した方向が通行可能かを取得する。
  #--------------------------------------------------------------------------
  def map_passable?(x, y, d)
    return $game_map.passable?(x, y) && $game_map.passable_dir?(x, y, d)
  end
  #--------------------------------------------------------------------------
  # ● 下に移動
  #     turn_ok : その場での向き変更を許可
  #--------------------------------------------------------------------------
  def move_down(turn_ok = true)
    if passable?(@x, @y, 2)                 # 通行可能
      turn_down
      @y = $game_map.round_y(@y+1)
      @real_y = (@y-1)*256
      increase_steps
      @move_failed = false
    else                                    # 通行不可能
      turn_down if turn_ok
      check_event_trigger_touch(@x, @y+1)   # 接触イベントの起動判定
      @move_failed = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 左に移動
  #     turn_ok : その場での向き変更を許可
  #--------------------------------------------------------------------------
  def move_left(turn_ok = true)
    if passable?(@x, @y, 4)                 # 通行可能
      turn_left
      @x = $game_map.round_x(@x-1)
      @real_x = (@x+1)*256
      increase_steps
      @move_failed = false
    else                                    # 通行不可能
      turn_left if turn_ok
      check_event_trigger_touch(@x-1, @y)   # 接触イベントの起動判定
      @move_failed = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 右に移動
  #     turn_ok : その場での向き変更を許可
  #--------------------------------------------------------------------------
  def move_right(turn_ok = true)
    if passable?(@x, @y, 6)                 # 通行可能
      turn_right
      @x = $game_map.round_x(@x+1)
      @real_x = (@x-1)*256
      increase_steps
      @move_failed = false
    else                                    # 通行不可能
      turn_right if turn_ok
      check_event_trigger_touch(@x+1, @y)   # 接触イベントの起動判定
      @move_failed = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 上に移動
  #     turn_ok : その場での向き変更を許可
  #--------------------------------------------------------------------------
  def move_up(turn_ok = true)
    if passable?(@x, @y, 8)                 # 通行可能
      turn_up
      @y = $game_map.round_y(@y-1)
      @real_y = (@y+1)*256
      increase_steps
      @move_failed = false
    else                                    # 通行不可能
      turn_up if turn_ok
      check_event_trigger_touch(@x, @y-1)   # 接触イベントの起動判定
      @move_failed = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 左下に移動
  #--------------------------------------------------------------------------
  def move_lower_left
    unless @direction_fix
      @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
    end
    if (passable?(@x, @y, 2) && passable?(@x, @y+1, 4)) ||
       (passable?(@x, @y, 4) && passable?(@x-1, @y, 2))
      @x -= 1
      @y += 1
      increase_steps
      @move_failed = false
    else
      @move_failed = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 右下に移動
  #--------------------------------------------------------------------------
  def move_lower_right
    unless @direction_fix
      @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
    end
    if (passable?(@x, @y, 2) && passable?(@x, @y+1, 6)) ||
       (passable?(@x, @y, 6) && passable?(@x+1, @y, 2))
      @x += 1
      @y += 1
      increase_steps
      @move_failed = false
    else
      @move_failed = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 左上に移動
  #--------------------------------------------------------------------------
  def move_upper_left
    unless @direction_fix
      @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
    end
    if (passable?(@x, @y, 8) && passable?(@x, @y-1, 4)) ||
       (passable?(@x, @y, 4) && passable?(@x-1, @y, 8))
      @x -= 1
      @y -= 1
      increase_steps
      @move_failed = false
    else
      @move_failed = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 右上に移動
  #--------------------------------------------------------------------------
  def move_upper_right
    unless @direction_fix
      @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
    end
    if (passable?(@x, @y, 8) && passable?(@x, @y-1, 6)) ||
       (passable?(@x, @y, 6) && passable?(@x+1, @y, 8))
      @x += 1
      @y -= 1
      increase_steps
      @move_failed = false
    else
      @move_failed = true
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # ○ マップ通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #     d : 移動方向
  #    指定座標の指定した方向が通行可能かを取得する。
  #--------------------------------------------------------------------------
  alias map_passable_KGC_TilesetExtension? map_passable?
  def map_passable?(x, y, d)
    return false unless map_passable_KGC_TilesetExtension?(x, y)

    return $game_map.passable_dir?(x, y, d)
  end

  if $TEST && KGC::TilesetExtension::DEBUG_INFO_BUTTON != nil
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias update_KGC_TilesetExtension update
  def update
    update_KGC_TilesetExtension

    if Input.trigger?(KGC::TilesetExtension::DEBUG_INFO_BUTTON)
      show_passage_and_terrain_tag
    end
  end
  #--------------------------------------------------------------------------
  # ○ プレイヤー位置の通行フラグ・地形タグを表示
  #--------------------------------------------------------------------------
  def show_passage_and_terrain_tag
    passage = $game_map.passage(x, y)
    tag = $game_map.terrain_tag(x, y)

    # デバッグ情報作成
    s = "通行可能: "
    s += "↓" if passage & DirectionFlag::DOWN  == 0x00
    s += "←" if passage & DirectionFlag::LEFT  == 0x00
    s += "→" if passage & DirectionFlag::RIGHT == 0x00
    s += "↑" if passage & DirectionFlag::UP    == 0x00
    s += "  地形标记: #{tag}"

    p s
  end
  end

end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Sprite_Character
#==============================================================================

class Sprite_Character < Sprite_Base
  #--------------------------------------------------------------------------
  # ● 指定されたタイルが含まれるタイルセット画像の取得
  #     tile_id : タイル ID
  #--------------------------------------------------------------------------
  def tileset_bitmap(tile_id)
    filename = KGC::TilesetExtension.get_tileset_filename
    set_number = tile_id / 256
    return Cache.system(filename["B"]) if set_number == 0
    return Cache.system(filename["C"]) if set_number == 1
    return Cache.system(filename["D"]) if set_number == 2
    return Cache.system(filename["E"]) if set_number == 3
    return nil
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Spriteset_Map
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # ● タイルマップの作成
  #--------------------------------------------------------------------------
  def create_tilemap
    filename = KGC::TilesetExtension.get_tileset_filename
    @tilemap = Tilemap.new(@viewport1)
    @tilemap.bitmaps[0] = Cache.system(filename["A1"])
    @tilemap.bitmaps[1] = Cache.system(filename["A2"])
    @tilemap.bitmaps[2] = Cache.system(filename["A3"])
    @tilemap.bitmaps[3] = Cache.system(filename["A4"])
    @tilemap.bitmaps[4] = Cache.system(filename["A5"])
    @tilemap.bitmaps[5] = Cache.system(filename["B"])
    @tilemap.bitmaps[6] = Cache.system(filename["C"])
    @tilemap.bitmaps[7] = Cache.system(filename["D"])
    @tilemap.bitmaps[8] = Cache.system(filename["E"])
    @tilemap.map_data = $game_map.data
    @tilemap.passages = $game_map.passages
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Title
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # ● データベースのロード
  #--------------------------------------------------------------------------
  alias load_database_KGC_TilesetExtension load_database
  def load_database
    load_database_KGC_TilesetExtension

    load_tileset
  end
  #--------------------------------------------------------------------------
  # ○ タイルセット付加情報のロード
  #--------------------------------------------------------------------------
  def load_tileset
    begin
      $data_tileset = load_data("Data/#{KGC::TilesetExtension::EX_RVDATA}")
    rescue
      $data_tileset = RPG::Tileset.new
    end
  end
end
回复 支持 反对

使用道具 举报

Lv4.逐梦者

送快递的水表员

梦石
10
星屑
4847
在线时间
3303 小时
注册时间
2012-6-27
帖子
7160

开拓者贵宾

3
发表于 2013-1-14 10:24:21 | 只看该作者
其实有一个更为简单而白痴化的做法……

对!用远景图!
也就是新建一个工程,把要用到但是原工程放不下的图块扔到里面,画出一个地图,然后用高质量的截图软件截图,可以用PS修下大小什么的,然后放到原工程的远景图文件夹里,然后原工程新建地图,插入远景图,这时再根据地图的通行度分别铺上一层可通行的透明图块和不可通行的透明图块。

理论上这样是可以无限叠加地图的……

点评

3,没用过……而且也不会脚本……所以不大知道  发表于 2013-1-16 18:29
2,可百度……我目前用不到这样的东西所以没有也不是很清楚  发表于 2013-1-16 18:28
1,A1在别的地方画好了自然有效果啊…… = = 没太明白  发表于 2013-1-16 18:28
再再追加一下,突然想到用双远脚本后,又如何保留背景飘飘图的呢?  发表于 2013-1-16 18:21
追加一下,能说下高质量的截图软件的名称吗?  发表于 2013-1-16 18:17

评分

参与人数 1星屑 +40 收起 理由
咕噜 + 40 精品文章

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
31 小时
注册时间
2012-12-1
帖子
19
4
 楼主| 发表于 2013-1-14 11:47:38 | 只看该作者
张咚咚 发表于 2013-1-14 09:51
使用此脚本插入到Main上面
楼主给经验啊

这个方法我自己搜索的时候看到了 感觉不好用 我已经有8方向脚本了 用这个估计会冲突。

不过还是多谢你啦
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
2459 小时
注册时间
2011-12-18
帖子
1484
5
发表于 2013-1-14 12:34:02 | 只看该作者
http://pan.baidu.com/share/link?shareid=211032&uk=201428228
下载此链接的文件,配合一下脚本使用。
  1. =begin
  2.                                 SwapXT

  3. Version: 1.0
  4. Author: Marco Di Antonio ([email protected])
  5. Nickname: BulletXt
  6. Date: 14/07/2010

  7. This is SwapXT script that must be put in your VX game script section.
  8. It's Plug&Play.
  9. Use SwapXT application to do swaps once you put this into your VX game.

  10. =end


  11. ############################# CONFIGURATION ####################################

  12. #Switch ID.
  13. #If ON, your events will not swap according to tiles and will use default tiles.
  14. DISABLE_EVENT_SWAPPING = 100


  15. =begin
  16. IGNORE the following two switches IDs unless you are using
  17. old 0.4 swapping script found at:
  18. http://lodestone2d.svn.sourceforge.net/viewvc/lodestone2d/Scripts-Dev/Swap_TileSet/Swap_tile_new_passage_setting.rb .
  19. If you are, set the 2 ID switches to ensure compatibility
  20. with your current "old system" swaps.
  21. The meaning of these two switches are described on the old 0.4 script, and you
  22. should already have confidence with them if you need these.
  23. =end
  24. SWAP_TILE = 9999
  25. LOAD_PASSAGE_SETTING = 9998


  26. ########################## END CONFIGURATION ###################################


  27. #==============================================================================
  28. # ** Cache

  29. module Cache_Swap_Tiles

  30.   #error message in case user is swapping tiles
  31.   #on a map with both old and new system
  32.   def self.error_message(map_id)
  33.   $bulletxt_error_message_mixed_swapping_configuration = "BulletXt Message:
  34.   on this map ID " + map_id.to_s() + "
  35.   you have a dangerous configuration.
  36.   You are swapping tilesets from events and from the swapping application.
  37.   Mixed configuration is not allowed.
  38.   Please decide which system to use to swap your tiles.
  39.   I highly suggest to swap tilesets using the swapping application.
  40.   If you decide to do this, please be sure you turn off the swapping switch
  41.   ID " + SWAP_TILE.to_s() + " before entering this map.
  42.   I will close the game for security reasons."  
  43.   #get rid of \n
  44.   array = $bulletxt_error_message_mixed_swapping_configuration.split("\n")
  45.   size = array.length()
  46.   n = 0
  47.   f = ""
  48.   while n < size do
  49.     message = array[n]
  50.     f = f + message
  51.     n = n + 1
  52.   end
  53.   $bulletxt_error_message_mixed_swapping_configuration = f
  54.   end

  55.   #error message in case user is swapping passage settings
  56.   #on a map with both old and new system
  57.   def self.error_message_passage(map_id)
  58.   $bulletxt_error_message_mixed_swapping_configuration = "BulletXt Message:
  59.   on this map ID " + map_id.to_s() + "
  60.   you have a dangerous configuration.
  61.   You are swapping a passage settings from events and from the swapping application.
  62.   Mixed configuration is not allowed.
  63.   Please decide which system to use to swap your passage settings.
  64.   I highly suggest to swap passage settings using the swapping application.
  65.   If you decide to do this, please be sure you turn off the swapping passage
  66.   setting switch ID " + LOAD_PASSAGE_SETTING.to_s() + " before entering this map.
  67.   I will close the game for security reasons."  
  68.   #get rid of \n
  69.   array = $bulletxt_error_message_mixed_swapping_configuration.split("\n")
  70.   size = array.length()
  71.   n = 0
  72.   f = ""
  73.   while n < size do
  74.     message = array[n]
  75.     f = f + message
  76.     n = n + 1
  77.   end
  78.   $bulletxt_error_message_mixed_swapping_configuration = f
  79.   end  

  80.   
  81.   #--------------------------------------------------------------------------
  82.   # * Get Character Graphic
  83.   #     filename : Filename
  84.   #--------------------------------------------------------------------------
  85.   def self.swap(filename)
  86.     load_bitmap("Graphics/System/extra_tiles/", filename)
  87.   end
  88.   
  89.   #--------------------------------------------------------------------------
  90.   # * Clear Cache
  91.   #--------------------------------------------------------------------------
  92.   def self.clear
  93.     @cache = {} if @cache == nil
  94.     @cache.clear
  95.     GC.start
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # * Load Bitmap
  99.   #--------------------------------------------------------------------------
  100.   def self.load_bitmap(folder_name, filename, hue = 0)
  101.     @cache = {} if @cache == nil
  102.     path = folder_name + filename
  103.     if not @cache.include?(path) or @cache[path].disposed?
  104.       if filename.empty?
  105.         @cache[path] = Bitmap.new(32, 32)
  106.       else
  107.         @cache[path] = Bitmap.new(path)
  108.       end
  109.     end
  110.     if hue == 0
  111.       return @cache[path]
  112.     else
  113.       key = [path, hue]
  114.       if not @cache.include?(key) or @cache[key].disposed?
  115.         @cache[key] = @cache[path].clone
  116.         @cache[key].hue_change(hue)
  117.       end
  118.       return @cache[key]
  119.     end
  120.   end
  121. end


  122. ################################################################################



  123. ############ CHECK IF THERE ARE SWAPPED TILES AT START PLAY TIME ###############
  124. =begin
  125. We must ensure user is starting game and there are physically swapped tiles or
  126. passage settings,
  127. tiles that have been for example swapped from the application
  128. =end
  129. class Scene_Title < Scene_Base

  130.   alias swapxt_start start
  131.   def start
  132.     swapxt_start
  133.     check_if_tileset_swapped_exist
  134.     check_if_passage_swapped_exist
  135.   end
  136.   
  137.   def check_if_tileset_swapped_exist
  138.     tile = "Graphics/System/swapped_"
  139.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "A1.png")
  140.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "A2.png")
  141.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "A3.png")
  142.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "A4.png")
  143.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "A5.png")
  144.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "B.png")
  145.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "C.png")
  146.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "D.png")
  147.     tileset_swap_loaded_message_error if FileTest.exist?(tile + "E.png")
  148.   end

  149.   def tileset_swap_loaded_message_error
  150.     p sprintf("SwapXT Error: You are not allowed to start your game with swapped tilesets. You must unload your tilesets with SwapXT application first. Open SwapXT, click at top Tools->Restore all Tilesets")
  151.     exit
  152.   end

  153.   def check_if_passage_swapped_exist
  154.     passage = "swapxt/passage_warning.stx"
  155.     passage_swap_loaded_message_error if FileTest.exist?(passage)
  156.   end
  157.   
  158.   def passage_swap_loaded_message_error
  159.     p sprintf("SwapXT Error: You are not allowed to start your game with swapped passage settings. You must unload your passage setting with SwapXT application first. Open SwapXT, go on PassageSetting tab and click on Restore to Default.")
  160.     exit
  161.   end
  162.   
  163. end
  164. ################################################################################



  165. =begin
  166. this class takes care of checking if there is a map id file. this class does
  167. not swap tilesets but only prepares the tiles variables(if map id file found).
  168. this class handles loading the passage setting file, for both old and
  169. new system
  170. =end

  171. class Game_Map
  172.   include Cache_Swap_Tiles  
  173.   alias bulletxt_goodbye_vx_limit_tile_setup setup
  174.   def setup(map_id)
  175.   
  176.     #must be false at load time
  177.     $swapxt_realtime = false
  178.    
  179.     #this variable must always be false at runtime.
  180.     #becomes true only if it finds a map id file
  181.     $swap_tileset_profile_bulletxt = false
  182.   
  183.     #check if it must load a saved profile TILESET for this map id
  184.     profile_path_tile = "swapxt/tiles/" + map_id.to_s() + ".stx"
  185.     if FileTest.exist?(profile_path_tile)
  186.       #we must now check if user isn't fooling around with his configuration.
  187.       #he must not be swapping tiles on this map with old and new system
  188.       #at the same time. if this is the case, warn him we don't want issues and
  189.       #close the game
  190.       if $game_switches[SWAP_TILE] == true
  191.         Cache_Swap_Tiles.error_message(map_id)
  192.         p sprintf($bulletxt_error_message_mixed_swapping_configuration)
  193.         exit
  194.       end
  195.       #set this to true so we know we want to swap with new system
  196.       $swap_tileset_profile_bulletxt = true
  197.       #p sprintf(profile_path_tile + " found!")
  198.       #read the map id file, it has 8 lines with the name of the tileset to swap.
  199.       #set each tileset global variable with the corresponding found line, in order.
  200.       $tileA1,$tileA2,$tileA3,$tileA4,$tileA5,$tileB,$tileC,$tileD,$tileE = File.read(profile_path_tile).split("\n")
  201.     end
  202.   
  203.   
  204.     ##################### SWAP PASSSAGE SETTINGS ##########################
  205.     @swap_passagesetting_bulletxt = false
  206.     #for how this works, look at the code above
  207.     profile_path_passages = "swapxt/passages/" + map_id.to_s() + ".stx"
  208.     if FileTest.exist?(profile_path_passages)
  209.       #p sprintf("passage exists on map " + map_id.to_s())
  210.       if $game_switches[LOAD_PASSAGE_SETTING] == true
  211.         Cache_Swap_Tiles.error_message_passage(map_id)
  212.         p sprintf($bulletxt_error_message_mixed_swapping_configuration)
  213.         exit
  214.       end
  215.       @swap_passagesetting_bulletxt = true
  216.       $swap_passages = (File.read(profile_path_passages).split("\n"))[0]
  217.     end
  218.   
  219.    
  220.     #checks if it should load default passage setting, both for old and new system
  221.     if $game_switches[LOAD_PASSAGE_SETTING] == false and @swap_passagesetting_bulletxt == false
  222.       bulletxt_goodbye_vx_limit_tile_setup(map_id)
  223.       $swap_passages = nil
  224.       return  
  225.     end
  226.    

  227.     path = "Graphics/System/extra_tiles/" + $swap_passages.to_s() + ".rvdata" rescue nil

  228.     #check if user set $swap_passages to nil cause he wants to load default setting.
  229.     #if user is loading with new system checks if it's equal to empty::*::
  230.     if $swap_passages == nil or $swap_passages == "empty::*::"
  231.       bulletxt_goodbye_vx_limit_tile_setup(map_id)
  232.       return
  233.     end
  234.   

  235.     #when here, we are sure user wants to swap passage setting, either
  236.     #via old system or new system
  237.     #the file to swap is not default one, he wants to swap to a real new one
  238.     @map_id = map_id
  239.     @map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
  240.     @display_x = 0
  241.     @display_y = 0
  242.      
  243.     # load system settings from that file
  244.     new_system_rvdata = load_data(path)
  245.     # Use passage settings from that file
  246.     @passages = new_system_rvdata.passages
  247.       
  248.     #default vx code
  249.     referesh_vehicles
  250.     setup_events
  251.     setup_scroll
  252.     setup_parallax
  253.     @need_refresh = false
  254.   end
  255.   
  256.   
  257. ############################# REAL TIME SWAPS ##################################  
  258.   #if here, player has done a $game_map.tileset call. It must reload
  259.   #map with new passage setting (if it exists) and upate map.
  260.   #OLD SYSTEM
  261.   def tileset
  262.     #if false, we must update and load default passage
  263.     if $game_switches[LOAD_PASSAGE_SETTING] == false
  264.       @passages = $data_system.passages
  265.     else
  266.       #if nil, must reset passage setting to default  
  267.       if $swap_passages == nil
  268.         @passages = $data_system.passages
  269.         $scene = Scene_Map.new
  270.         return
  271.       end
  272.     path = "Graphics/System/extra_tiles/" + $swap_passages + ".rvdata" rescue nil
  273.     # load system settings from that file
  274.     new_system_rvdata = load_data(path)
  275.     # Use passage settings from that file
  276.     @passages = new_system_rvdata.passages
  277.     end   
  278.     #this updates the map tiles. it does not modify events or anything else.
  279.     $scene = Scene_Map.new
  280.   end
  281.   

  282.   
  283.   #if here, player has done a $game_map.swapxt() call. It must reload
  284.   #map with new passage setting (if it exists) and upate map.
  285.   #NEW SWAPXT SYSTEM
  286.   def swapxt(integer)
  287.     rtx_path = "swapxt/realtime/" + integer.to_s() + ".rtx"
  288.     if !FileTest.exist?(rtx_path )
  289.       p sprintf("SwapXT Error: You have called $game_map.swapxt(" + integer.to_s() + ") , but that Real-Time swap doesn't exist. Please better check it inside SwapXT app, under the Real-Time section.")
  290.       exit
  291.     end
  292.     $tileA1,$tileA2,$tileA3,$tileA4,$tileA5,$tileB,$tileC,$tileD,$tileE,passage = File.read(rtx_path).split("\n")
  293.     path = "Graphics/System/extra_tiles/" + passage + ".rvdata" rescue nil
  294.     if !FileTest.exist?(path)
  295.       p sprintf("SwapXT Error: Unable to find " + path + ". Please go and check your existant passages from SwapXT in the PassageSetting section.")
  296.       exit
  297.     end
  298.     $swapxt_realtime = true #warning,realtime update must occur
  299.     # load system settings from that file
  300.     new_system_rvdata = load_data(path)
  301.     # Use passage settings from that file
  302.     @passages = new_system_rvdata.passages
  303.     #this updates the map tiles. it does not modify events or anything else.
  304.     $scene = Scene_Map.new
  305.   end
  306.   
  307.   
  308. end


  309. #this class handles loading tilesets
  310. class Spriteset_Map
  311. include Cache_Swap_Tiles  

  312.   alias bulletxt_lodestone_create_tilemap create_tilemap
  313.   def create_tilemap
  314.     #if true, it means the map doesn't have to load tilesets,
  315.     #neither for old swapping system or new system.
  316.     #if true, also means no realtime update occured
  317.     #it must load DEFAULT tilesets
  318.     if $game_switches[SWAP_TILE] == false and $swap_tileset_profile_bulletxt == false and $swapxt_realtime == false
  319.       bulletxt_lodestone_create_tilemap
  320.       $tileA1 = nil
  321.       $tileA2 = nil
  322.       $tileA3 = nil
  323.       $tileA4 = nil
  324.       $tileA5 = nil
  325.       $tileB = nil
  326.       $tileC = nil
  327.       $tileD = nil
  328.       $tileE = nil
  329.       return
  330.     end
  331.   
  332.    
  333.    
  334. =begin
  335. calling the original function is a trick. if there are tiles to swap
  336. it will just replace them, otherwise if a tile is nil it won't swap anything,
  337. but still the tile will be loaded because it has already loaded the original tile
  338. when calling this function. in other words, if setting a tile$n = nil will simply
  339. make the script load default tile.
  340. =end
  341.     bulletxt_lodestone_create_tilemap
  342. =begin
  343. when here, some/all tiles must be swapped, either old or with new system.
  344. the tile can be equal to "empty::*::" only if it found the file id of the
  345. map and line$n is equal to empty::*::. in that case it must load default tileset.
  346. there are no chances a user with old system is swapping a tileset named
  347. "empty::*::" because you can't name files with ":" characters under
  348. Microsoft Windows OS.
  349. =end
  350.     path_to_graphic = "extra_tiles/"

  351.     #tileA1
  352.     if $tileA1 == "empty::*::"
  353.       @tilemap.bitmaps[0] = Cache.system("TileA1")
  354.     else
  355.       tile1 = Cache_Swap_Tiles.swap($tileA1 + ".png") rescue nil
  356.       @tilemap.bitmaps[0] = tile1 if $tileA1 != nil
  357.     end
  358.   
  359.     #tileA2
  360.     if $tileA2 == "empty::*::"
  361.       @tilemap.bitmaps[1] = Cache.system("TileA2")
  362.     else
  363.       tile2 = Cache_Swap_Tiles.swap($tileA2 + ".png") rescue nil
  364.       @tilemap.bitmaps[1] = tile2 if $tileA2 != nil
  365.     end
  366.    
  367.     #tileA3
  368.     if $tileA3 == "empty::*::"
  369.       @tilemap.bitmaps[2] = Cache.system("TileA3")
  370.     else
  371.       tile3 = Cache_Swap_Tiles.swap($tileA3 + ".png") rescue nil
  372.       @tilemap.bitmaps[2] = tile3 if $tileA3 != nil
  373.     end
  374.       
  375.     #tileA4
  376.     if $tileA4 == "empty::*::"
  377.       @tilemap.bitmaps[3] = Cache.system("TileA4")
  378.     else
  379.       tile4 = Cache_Swap_Tiles.swap($tileA4 + ".png") rescue nil
  380.       @tilemap.bitmaps[3] = tile4 if $tileA4 != nil
  381.     end
  382.       
  383.     #tileA5
  384.     if $tileA5 == "empty::*::"
  385.       @tilemap.bitmaps[4] = Cache.system("TileA5")
  386.     else
  387.       tile5 = Cache_Swap_Tiles.swap($tileA5 + ".png") rescue nil
  388.       @tilemap.bitmaps[4] = tile5 if $tileA5 != nil
  389.     end

  390.     #tileB
  391.     if $tileB == "empty::*::"
  392.       @tilemap.bitmaps[5] = Cache.system("TileB")
  393.     else
  394.       tile6 = Cache_Swap_Tiles.swap($tileB + ".png") rescue nil
  395.       @tilemap.bitmaps[5] = tile6 if $tileB != nil
  396.     end

  397.     #tileC
  398.     if $tileC == "empty::*::"
  399.       @tilemap.bitmaps[6] = Cache.system("TileC")
  400.     else
  401.       tile7 = Cache_Swap_Tiles.swap($tileC + ".png") rescue nil
  402.       @tilemap.bitmaps[6] = tile7 if $tileC != nil
  403.     end

  404.     #tileD
  405.     if $tileD == "empty::*::"
  406.       @tilemap.bitmaps[7] = Cache.system("TileD")
  407.     else
  408.       tile8 = Cache_Swap_Tiles.swap($tileD + ".png") rescue nil
  409.       @tilemap.bitmaps[7] = tile8 if $tileD != nil
  410.     end

  411.     #tileE
  412.     if $tileE == "empty::*::"
  413.       @tilemap.bitmaps[8] = Cache.system("TileE")
  414.     else
  415.       tile9 = Cache_Swap_Tiles.swap($tileE + ".png") rescue nil
  416.       @tilemap.bitmaps[8] = tile9 if $tileE != nil
  417.     end
  418.    
  419.   #closes def
  420.   end
  421. #closes class
  422. end


  423. ########################## SWAP EVENT'S GRAPHICS #############################
  424. #the following class handles swapping event's graphics according to the tiles
  425. class Sprite_Character < Sprite_Base
  426. include Cache_Swap_Tiles

  427.   alias swap_tileset_bitmap tileset_bitmap
  428.   def tileset_bitmap(tile_id)
  429.      #do not swap events if true
  430.      if $game_switches[DISABLE_EVENT_SWAPPING]
  431.         set_number = tile_id / 256
  432.         return Cache.system("TileB") if set_number == 0
  433.         return Cache.system("TileC") if set_number == 1
  434.         return Cache.system("TileD") if set_number == 2
  435.         return Cache.system("TileE") if set_number == 3
  436.         return nil
  437.         return
  438.      end
  439.      
  440.      if $game_switches[SWAP_TILE] == false and $swap_tileset_profile_bulletxt == false and $swapxt_realtime == false
  441.         set_number = tile_id / 256
  442.         return Cache.system("TileB") if set_number == 0
  443.         return Cache.system("TileC") if set_number == 1
  444.         return Cache.system("TileD") if set_number == 2
  445.         return Cache.system("TileE") if set_number == 3
  446.         return nil
  447.         return
  448.      end
  449.      
  450.     swap_tileset_bitmap(tile_id)
  451.     set_number = tile_id / 256
  452.    
  453.     if $tileB == "empty::*::"
  454.       return Cache.system("TileB") if set_number == 0
  455.     else
  456.       return Cache_Swap_Tiles.swap($tileB) if set_number == 0 rescue nil
  457.     end
  458.    
  459.     if $tileC == "empty::*::"
  460.       return Cache.system("TileC") if set_number == 1
  461.     else
  462.       return Cache_Swap_Tiles.swap($tileC) if set_number == 1 rescue nil
  463.     end
  464.    
  465.     if $tileD == "empty::*::"
  466.       return Cache.system("TileD") if set_number == 2
  467.     else
  468.       return Cache_Swap_Tiles.swap($tileD) if set_number == 2 rescue nil
  469.     end
  470.    
  471.     if $tileE == "empty::*::"
  472.       return Cache.system("TileE") if set_number == 3
  473.     else
  474.        return Cache_Swap_Tiles.swap($tileE) if set_number == 3 rescue nil
  475.     end

  476.     return nil
  477.   end
  478. end



  479. =begin
  480. saves tiles and passage setting variables,
  481. needed if you save on a map that has swapped stuff.
  482. this is only needed when using old system, because new system
  483. reads the value from the map id file
  484. =end
  485. class Scene_File < Scene_Base
  486.   alias bulletxt_swap_tiles_write_save_data write_save_data
  487.   def write_save_data(file)
  488.     bulletxt_swap_tiles_write_save_data(file)
  489.     Marshal.dump($tileA1,      file)
  490.     Marshal.dump($tileA2,      file)
  491.     Marshal.dump($tileA3,      file)
  492.     Marshal.dump($tileA4,      file)
  493.     Marshal.dump($tileA5,      file)
  494.     Marshal.dump($tileB,      file)
  495.     Marshal.dump($tileC,      file)
  496.     Marshal.dump($tileD,      file)
  497.     Marshal.dump($tileE,      file)
  498.     Marshal.dump($swap_passages.to_s(),   file)
  499.     Marshal.dump($swap_tileset_profile_bulletxt,  file)
  500.     Marshal.dump($swapxt_realtime, file)
  501.   end  

  502.   alias bulletxt_swap_tiles_read_save_data read_save_data
  503.   def read_save_data(file)
  504.     bulletxt_swap_tiles_read_save_data(file)
  505.     $tileA1        = Marshal.load(file)
  506.     $tileA2        = Marshal.load(file)
  507.     $tileA3        = Marshal.load(file)
  508.     $tileA4        = Marshal.load(file)
  509.     $tileA5        = Marshal.load(file)
  510.     $tileB        = Marshal.load(file)
  511.     $tileC        = Marshal.load(file)
  512.     $tileD        = Marshal.load(file)
  513.     $tileE        = Marshal.load(file)
  514.     $swap_passages = Marshal.load(file)
  515.     $swap_tileset_profile_bulletxt = Marshal.load(file)
  516.     $swapxt_realtime = Marshal.load(file)
  517.   end

  518. end
复制代码
使用方法很简单,也很方便。
如果实在不懂,可以追问。

评分

参与人数 1星屑 +80 收起 理由
咕噜 + 80 精品文章

查看全部评分

这是一个深不见底的坑,这是一个广袤无边的坑,我才刚刚放上了一抔泥土……

《六道·陈国篇》开坑了……↓点我
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
31 小时
注册时间
2012-12-1
帖子
19
6
 楼主| 发表于 2013-1-14 16:52:20 | 只看该作者
a364774426 发表于 2013-1-14 12:34
http://pan.baidu.com/share/link?shareid=211032&uk=201428228
下载此链接的文件,配合一下脚本使用。使用 ...

十分感谢 我感觉这个比较高级 不过仙子阿不太懂 自己研究下先

多谢你啦 有不懂得我会问你的。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
31 小时
注册时间
2012-12-1
帖子
19
7
 楼主| 发表于 2013-1-14 17:41:22 | 只看该作者
a364774426 发表于 2013-1-14 12:34
http://pan.baidu.com/share/link?shareid=211032&uk=201428228
下载此链接的文件,配合一下脚本使用。使用 ...

能教我下是怎么用的么。

我打开以后看见了swap的选项 是不是只能用新素材替换旧的abcde呢,
我想加入新的,不改变原来的abcde要怎么做才行。

多谢你了哦

点评

好吧,这里不方便详细描述,加我QQ吧。364774426  发表于 2013-1-14 17:46
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
31 小时
注册时间
2012-12-1
帖子
19
8
 楼主| 发表于 2013-1-15 05:54:49 | 只看该作者
夜弥忘忧 发表于 2013-1-14 17:41
能教我下是怎么用的么。

我打开以后看见了swap的选项 是不是只能用新素材替换旧的abcde呢,

多谢啦 我昨天后来在网上找到教程了 多谢你啦
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-27 22:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表