赞 | 11 |
VIP | 302 |
好人卡 | 162 |
积分 | 62 |
经验 | 108302 |
最后登录 | 2024-11-21 |
在线时间 | 6593 小时 |
Lv4.逐梦者 醉啸 长风万里
- 梦石
- 0
- 星屑
- 6167
- 在线时间
- 6593 小时
- 注册时间
- 2007-12-16
- 帖子
- 4501
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 仲秋启明 于 2011-2-13 20:11 编辑
好的,既然要出地图教程了,就应该关注一下地图加强,于是,搜到了,翻译了
原版的图片宣传:
自己改后的使用方法:
可以无穷无尽,最多我也不知道会到多少
直接上脚本:
- #==============================================================================
- # ■ VX图层无穷无尽
- #------------------------------------------------------------------------------
- # 原作BY:S. F. LaValle 翻译、修改BY:仲秋启明
- # 使用方法:在子地图名的最后加上“LX”(X为第几添加层)
- # 更新手记:2011.2.13 解决战斗渐变问题
- #==============================================================================
- class Scene_Map < Scene_Base
- alias start_2 start
- alias update_2 update
- attr_reader :map_layer_spritesets
- def start
- start_2
- setup_map_layers
- end
- def update
- for i in 0...@map_layer_spritesets.size
- @map_layers[i].update
- @map_layer_spritesets[i].update
- end
- update_2
- end
- def update_transfer_player
- return unless $game_player.transfer?
- fade = (Graphics.brightness > 0)
- fadeout(30) if fade
- @spriteset.dispose
- for i in 0...@map_layer_spritesets.size
- @map_layer_spritesets[i].dispose
- end
- $game_player.perform_transfer
- $game_map.autoplay
- $game_map.update
- Graphics.wait(15)
- @spriteset = Spriteset_Map.new
- setup_map_layers
- fadein(30) if fade
- Input.update
- end
- def call_battle
- @spriteset.update
- Graphics.update
- $game_player.make_encounter_count
- $game_player.straighten
- for i in 0...@map_layer_spritesets.size
- @map_layer_spritesets[i].dispose
- end
- $game_temp.map_bgm = RPG::BGM.last
- $game_temp.map_bgs = RPG::BGS.last
- RPG::BGM.stop
- RPG::BGS.stop
- Sound.play_battle_start
- $game_system.battle_bgm.play
- $game_temp.next_scene = nil
- $scene = Scene_Battle.new
- end
- def setup_map_layers
- maps = load_data("Data/MapInfos.rvdata")
- game_map_name = maps[$game_map.map_id].name
- @map_layers = []
- @map_layer_spritesets = []
- map_names = []
- layer_map_names = []
- layer_index = []
- c = maps.keys
- d = c.max
- for i in 1..d
- unless maps[i] == nil
- a = nil
- map_names.push(maps[i].name)
- a = maps[i].name =~ /(l|L)\d+/
- layer_map_names.push(maps[i].name) if a != nil
- layer_index.push(maps.index(maps[i])) if a != nil
- end
- end
- for string in layer_map_names
- string.chop! until string == game_map_name or string == ""
- end
- if layer_map_names.include?(game_map_name)
- for i in 0...layer_map_names.size
- if layer_map_names[i] != ""
- map = Game_Map.new
- map.setup(layer_index[i])
- @map_layer_spritesets.push(Spriteset_Map_2.new(map))
- @map_layers.push(map)
- end
- end
- end
- end
- end
- class Spriteset_Map_2 < Spriteset_Map
- def initialize(layer)
- @layer = layer
- create_viewports
- create_tilemap
- update
- end
- def update
- update_tilemap
- update_viewports
- end
- def dispose
- @tilemap.dispose
- end
- def create_tilemap(a1 = nil, a2 = nil, a3 = nil, a4 = nil, a5 = nil, b = nil, c = nil, d = nil, e = nil)
- @tilemap = Tilemap.new(@viewport1)
- @tilemap.bitmaps[0] = (a1 == nil ? Cache.system("TileA1") : a1)
- @tilemap.bitmaps[1] = (a2 == nil ? Cache.system("TileA2") : a2)
- @tilemap.bitmaps[2] = (a3 == nil ? Cache.system("TileA3") : a3)
- @tilemap.bitmaps[3] = (a4 == nil ? Cache.system("TileA4") : a4)
- @tilemap.bitmaps[4] = (a5 == nil ? Cache.system("TileA5") : a5)
- @tilemap.bitmaps[5] = (b == nil ? Cache.system("TileB") : b)
- @tilemap.bitmaps[6] = (c == nil ? Cache.system("TileC") : c)
- @tilemap.bitmaps[7] = (d == nil ? Cache.system("TileD") : d)
- @tilemap.bitmaps[8] = (e == nil ? Cache.system("TileE") : e)
- @tilemap.map_data = @layer.data
- @tilemap.passages = @layer.passages
- end
- def update_viewports
- @viewport1.tone = @layer.screen.tone
- @viewport1.ox = @layer.screen.shake
- @viewport2.color = @layer.screen.flash_color
- @viewport3.color.set(0, 0, 0, 255 - @layer.screen.brightness)
- @viewport1.update
- @viewport2.update
- @viewport3.update
- end
- end
复制代码 范例工程不提供,很简单的
|
评分
-
查看全部评分
|