| 主题贴:【 [RM脚本] 超华丽的缩放式伪3D脚本 】(原帖)(目录) saterick (2006-8-23 10:03:49) 注意: [HTML]#=============================================================================== $width = 640 # Screen width (will not change resolution, $height = 480 # Screen height here for compatibility) $ov_zoom = 0.6 # Overworld zoom multiplier $strip_size = 8 # Size of each strip of the map. Higher numbers will lag less. # Recommended that this number be a power of 2. # Do not make higher than 64. $curve = true # Whether the map is curled, for overworlds (old method) $data_map = load_data("Data/MapInfos.rxdata") #=============================================================================== class RPG::MapInfo def name # Definition prevents location scripts from reading anything within return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets end #----------------------------------------------------------------------------- def original_name return @name end #----------------------------------------------------------------------------- def overworld? return @name.scan(/[OV]/).size > 0 end #----------------------------------------------------------------------------- def pitch @name =~ /\[#[ ]*([00-99]+)\]/i return $1 end end #=============================================================================== class Draw_Tilemap # This class controls a set of sprites, with different Z # values, arranged into horizontal bars attr_accessor :tileset attr_accessor :map_data attr_accessor :priorities attr_accessor :autotiles attr_accessor :bitmaps attr_accessor :pitch attr_accessor :ox attr_accessor :oy attr_accessor :plus_y INDEX = # Autotile definitions [ 26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33, 26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11, 26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33, 26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11, 24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11, 14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11, 28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35, 38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45, 24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11, 16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47, 36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43, 36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7 ] X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing; up, up, down, down #----------------------------------------------------------------------------- def initialize # Get initial data from Game_Map @tileset = RPG::Cache.tileset($game_map.tileset_name) @map_data = $game_map.data @priorities = $game_map.priorities @autotiles = [] for i in 0..6 @autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i]) end # Provide blank data in proper object form @ox = 0 @oy = 0 # Bitmaps used for each priority's drawing. Priorities 2-5 are combined. @bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size), Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size), Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)] # Generate blank sprites @sprites = [[], [], []] for i in 0..2 # For each layer for j in 0..$game_map.height * (32 / $strip_size) - 1 # For each horizontal strip of $strip_size height, make a blank sprite @sprites[i].push(Sprite.new) @sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2) @sprites[i][j].x = $width / 2 @sprites[i][j].y = -64 @sprites[i][j].z = -5 + (i * 10) end end @disposed = false draw end #----------------------------------------------------------------------------- def update # Retrieve variable values for slant drawing; these values accesible by event @pitch = $game_map.pitch.to_f @plus_y = $game_map.plus_y for i in 0..2 # For each layer for j in [0, (($height / 2) - (($height * 60) / @pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1, (@oy + $height) / $strip_size].min.to_i # F…… 长篇帖子,完整版请原地址查看 |
| 美兽 : 想起来了SFC的很多经典游戏的大地图 >千鸟 : 不错呀!!!!!!!!!!!!!! 好东西 >sdxsdx : 好啊!{/qiang} >两只鱼 : 这个强悍的无话可说了~~ >frantice : 看看这个,同样是伪3D地图,怎么区别这么大? http://rpgcreative.forumpro.fr/ftopic281.Map-3D-mode7-encore-quelques-bugs.htm >king : {/qiang} 什么效果都能出来,只要有能力 >BB崽 : 太耗内存了 >NICK : 还有一张图没贴出来(最强悍的一张) http://bbs.66rpg.com/upload_program/files/nighttime.jpg >小湖 : 太卡了{/gg} >tsjmq : {/ll}效果好华丽~~~~不过我机子走不动,华丽的效果变成华丽的卡了 >竹眉叶心 : [b]以下引用[i]frantice于2006-8-24 15:32:22[/i]的发言:[/b] 这个是德语还是西班牙语啊。。。。 脚本如果无视图块优先级的话。。那基本上没什么用了。。 >saterick : [b]以下引用[i]竹眉叶心于2006-8-24 19:03:10[/i]的发言:[/b] 法语的…… 感觉起来是大同小异。 >竹眉叶心 : 无语了,草原地图7~10帧,世界地图10~14帧。。。 太强了。。。。。。。。。stO Orz(夫妻对拜) 我的机器CPR2.4G赛扬,内存1G,显卡9550 >亿万星辰 : 这个东西只可以做华丽效果演示,不进行深度优化的话基本没什么实用价值...... >小湖 : 脚本已经备份{/fd} >ccen3020 : 这个应该是占用CPU过大吧....... 谁有扣肉或者FX60+来测试下{/pz} >beiduo : 我没有用楼主的范例而只是用了0.7版的脚本,似乎并不卡。 >嫁衣 : orz 卡得厉害啊,走路有点像爬{/hx} >西撒1314 : [b]以下引用[i]嫁衣于2006-8-28 16:55:47[/i]的发言:[/b] 只要在脚本中调遮盖高度就会快的,但走路有点像爬我不认为!{/tp} 这很华丽啊!{/qiang} >叼烟的男孩 : 硬盘狂转 卡 >叼烟的男孩 : 地图大就卡死 >peter神人 : 卡! >暴风の龙 : 无视优先级....那就没用了... >暴风の龙 : 好帅的效果,不过走得好慢... >暴风の龙 : 我放到自己的游戏测试过后,请大家看看下面两张图..... 关于山道和森林的效果倒是不错 http://bbs.66rpg.com/upload_program/files/gelu2.jpg 但是到了城市后.......那钟塔竟然出现弯曲...房子倾倒..... http://bbs.66rpg.com/upload_program/files/gelu.jpg >宰牛四天王 : 做大地图用.... >tyghbnrfv3 : [b]以下引用[i]暴风の龙于2006-8-29 2:45:18[/i]的发言:[/b] 台风经过的效果.... >暴风の龙 : [b]以下引用[i]tyghbnrfv3于2006-8-29 23:08:14[/i]的发言:[/b] 别说了,在城市里走真的有点晕的感觉........房子啊什么随着你的走动慢慢变弯...好恐怖... >saterick : 优先级和运算速度……这两个问题不解决……这个脚本……嗯……一点用处也没有…… >秋弦月 : 视觉效果不错哈,也只能做做视觉效果游戏了{/gg} >风雪优游 : 想起了....太阳.... >张永 : 这种类型就是幻想传说的大地图类型。所以说除了做大地图以外,几乎没有用处 >RockK : [b]以下引用[i]张永于2006-9-14 4:37:31[/i]的发言:[/b] 但是就做大地图就足够拉~~ 黄金的太阳 SFC-FF4 DQ…… 无敌的好东西! 我顶!!!!!!!!!!{/dy} >江忆痕 : 华丽啊........我设的800..........速度啊.......... >devilcraft : {/cy}好好耍!我试了试...不卡!{/cy}要用这个 >FinalFantasy : 点了出处那个网站..直接想起FF4.... >再塑军魂 : 很迷茫.........对于我(IT白痴) >⑩字绯影 : R版极品飞车要诞生了.... >鸾翎 : 好东西~! >Forever : 我 试了一下. 卡.....卡.....卡........ |