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

Project1

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

[转载] [RM脚本] 超华丽的缩放式伪3D脚本

 关闭 [复制链接]

Lv4.逐梦者

梦石
1
星屑
4939
在线时间
443 小时
注册时间
2006-1-31
帖子
1537
跳转到指定楼层
1
发表于 2006-8-23 18:03:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 传说VS天涯 于 2010-9-5 12:11 编辑
注意:
首先请确认自己的机器足够强悍!
偶的本本就不行,一点游戏就“脚本已备份”。
偶的台式机只能把祯数维持在10祯左右。
  1. #===============================================================================
  2. $width = 640    # Screen width        (will not change resolution,
  3. $height = 480   # Screen height        here for compatibility)
  4. $ov_zoom = 0.6  # Overworld zoom multiplier
  5. $strip_size = 8 # Size of each strip of the map.  Higher numbers will lag less.
  6.                 #  Recommended that this number be a power of 2.
  7.                 #  Do not make higher than 64.
  8. $curve = true   # Whether the map is curled, for overworlds (old method)
  9. $data_map = load_data("Data/MapInfos.rxdata")
  10. #===============================================================================
  11. class RPG::MapInfo
  12.   def name # Definition prevents location scripts from reading anything within
  13.     return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
  14.   end
  15.   #-----------------------------------------------------------------------------
  16.   def original_name
  17.     return @name
  18.   end
  19.   #-----------------------------------------------------------------------------
  20.   def overworld?
  21.     return @name.scan(/[OV]/).size > 0
  22.   end
  23.   #-----------------------------------------------------------------------------
  24.   def pitch
  25.     @name =~ /\[#[ ]*([00-99]+)\]/i
  26.     return $1
  27.   end
  28. end
  29. #===============================================================================
  30. class Draw_Tilemap # This class controls a set of sprites, with different Z
  31.                    #  values, arranged into horizontal bars
  32.   attr_accessor :tileset
  33.   attr_accessor :map_data
  34.   attr_accessor :priorities
  35.   attr_accessor :autotiles
  36.   attr_accessor :bitmaps
  37.   attr_accessor :pitch
  38.   attr_accessor :ox
  39.   attr_accessor :oy
  40.   attr_accessor :plus_y
  41.   INDEX = # Autotile definitions
  42.   [
  43.   26, 27, 32, 33, 4,  27, 32, 33, 26, 5,  32, 33, 4,  5,  32, 33,
  44.   26, 27, 32, 11, 4,  27, 32, 11, 26, 5,  32, 11, 4,  5,  32, 11,
  45.   26, 27, 10, 33, 4,  27, 10, 33, 26, 5,  10, 33, 4,  5,  10, 33,
  46.   26, 27, 10, 11, 4,  27, 10, 11, 26, 5,  10, 11, 4,  5,  10, 11,
  47.   24, 25, 30, 31, 24, 5,  30, 31, 24, 25, 30, 11, 24, 5,  30, 11,
  48.   14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
  49.   28, 29, 34, 35, 28, 29, 10, 35, 4,  29, 34, 35, 4,  29, 10, 35,
  50.   38, 39, 44, 45, 4,  39, 44, 45, 38, 5,  44, 45, 4,  5,  44, 45,
  51.   24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
  52.   16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4,  41, 46, 47,
  53.   36, 37, 42, 43, 36, 5,  42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
  54.   36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0,  1,  6,  7
  55.   ]
  56.   X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
  57.   Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing;   up,    up, down,  down
  58.   #-----------------------------------------------------------------------------
  59.   def initialize
  60.   # Get initial data from Game_Map
  61.     @tileset = RPG::Cache.tileset($game_map.tileset_name)
  62.     @map_data = $game_map.data
  63.     @priorities = $game_map.priorities
  64.     @autotiles = []
  65.     for i in 0..6
  66.       @autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
  67.     end
  68.   # Provide blank data in proper object form
  69.     @ox = 0
  70.     @oy = 0
  71.   # Bitmaps used for each priority's drawing.  Priorities 2-5 are combined.
  72.     @bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
  73.                 Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
  74.                 Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
  75.   # Generate blank sprites
  76.     @sprites = [[], [], []]
  77.     for i in 0..2 # For each layer
  78.       for j in 0..$game_map.height * (32 / $strip_size) - 1
  79.       # For each horizontal strip of $strip_size height, make a blank sprite
  80.         @sprites[i].push(Sprite.new)
  81.         @sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
  82.         @sprites[i][j].x = $width / 2
  83.         @sprites[i][j].y = -64
  84.         @sprites[i][j].z = -5 + (i * 10)
  85.       end
  86.     end
  87.     @disposed = false
  88.     draw
  89.   end
  90.   #-----------------------------------------------------------------------------
  91.   def update
  92.   # Retrieve variable values for slant drawing; these values accesible by event
  93.     @pitch = $game_map.pitch.to_f
  94.     @plus_y = $game_map.plus_y
  95.     for i in 0..2 # For each layer
  96.       for j in [0, (($height / 2) - (($height * 60) /
  97.                 @pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
  98.                 (@oy + $height) / $strip_size].min.to_i
  99.       # For each strip within the visible screen, update OX/Y
  100.         @sprites[i][j].x = $width / 2
  101.         @sprites[i][j].y = j * $strip_size - @oy
  102.         unless @pitch == 0 # Apply X Zoom
  103.           @sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
  104.                                   (@pitch / ($height * 25)) + 1
  105.           if $curve # Zoom Y values same as X, and compensate
  106.             @sprites[i][j].zoom_y = @sprites[i][j].zoom_x
  107.             @sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
  108.                                 ((1 - @sprites[i][j].zoom_y) /
  109.                                 (2 * ((@pitch / 100) /
  110.                                       ($height / ($strip_size * 2)))) + 0.5)
  111.           end
  112.         end
  113.         @sprites[i][j].ox = @ox + $width / 2
  114.       # Add plus_y value; used in airship script
  115.         @sprites[i][j].y += @plus_y
  116.       end
  117.     end
  118.   end
  119.   #-----------------------------------------------------------------------------
  120.   def dispose
  121.   # Dispose all sprites
  122.     for i in 0..2
  123.       for j in @sprites[i]
  124.         j.bitmap.dispose
  125.         j.dispose
  126.       end
  127.     end
  128.     for i in @bitmaps
  129.       i.dispose
  130.     end
  131.     @tileset.dispose
  132.     for i in 0..6
  133.       @autotiles[i].dispose
  134.     end
  135.     @disposed = true
  136.   end
  137.   #-----------------------------------------------------------------------------
  138.   def disposed?
  139.     return @disposed
  140.   end
  141.   #-----------------------------------------------------------------------------
  142.   def draw
  143.   # Draw each individual position by XY value
  144.     for x in 0...@map_data.xsize
  145.       for y in 0...@map_data.ysize
  146.         draw_position(x, y)
  147.       end
  148.     end
  149.     for i in 0..2 # For each priority
  150.       for j in 0..@sprites[i].size - 1
  151.       # For each horizontal strip, transfer the bitmap appropriately
  152.         @sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
  153.             Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
  154.       end
  155.     end
  156.   end
  157.   #-----------------------------------------------------------------------------
  158.   def draw_position(x, y)
  159.     for layer in 0..2
  160.       pos = @map_data[x, y, layer]
  161.       @priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
  162.       if pos >= 384 # If it is a tile
  163.       # src_rect = 32x32 Rect on the tileset for source bitmap
  164.         src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
  165.       # Transfer source bitmap on the tileset to the current map tile
  166.         @bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
  167.       elsif pos >= 48 and pos < 384 # If it is an autotile
  168.         id = pos / 48 - 1 # Which autotile is used (0-6)
  169.       # plus_x is in development for animated autotiles
  170.         plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
  171.         for corner in 0..3
  172.           h = 4 * (pos % 48) + corner # Used to access INDEX
  173.         # src_rect = 16x16 Rect on the autotile for source bitmap
  174.           src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
  175.         # Transfer source bitmap on the autotile to the current 16x16 tile
  176.           @bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
  177.                                           @autotiles[id], src_rect)
  178.         end
  179.       end
  180.     end
  181.   end
  182. end
  183. #===============================================================================
  184. class Game_Map
  185.   attr_accessor :pitch
  186.   attr_accessor :plus_y
  187.   #-----------------------------------------------------------------------------
  188.   alias setup_or :setup
  189.   def setup(map_id)
  190.     setup_or(map_id)
  191.     @pitch = $data_map[$game_map.map_id].pitch
  192.     @plus_y = 0
  193.   end
  194.   #-----------------------------------------------------------------------------
  195.   def name
  196.     return $data_map[@map_id].name
  197.   end
  198. end
  199. #===============================================================================
  200. class Sprite_Character < RPG::Sprite
  201.   attr_accessor :character
  202.   #-----------------------------------------------------------------------------
  203.   def initialize(character = nil)
  204.     super()
  205.     @character = character
  206.     update
  207.   end
  208.   #-----------------------------------------------------------------------------
  209.   alias update_or :update
  210.   def update
  211.     update_or
  212.   # Update pitch value, and update zoom values to match
  213.     @pitch = $data_map[$game_map.map_id].pitch.to_f
  214.     self.zoom_x =
  215.     self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
  216.                   (@pitch / ($height * 25)) + 1
  217.   # Set sprite coordinates.  X value is multiplied by zoom value from the center
  218.     self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
  219.     self.y = @character.screen_y
  220.   # Add Y value for zoom compensation while in curve mode
  221.     if $curve and @pitch != 0
  222.       self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
  223.                 (2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
  224.     end
  225.   # Add plus_y value; used in airship script
  226.     self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
  227.     self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
  228.     if $data_map[$game_map.map_id].overworld? and
  229.        @character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
  230.       self.zoom_x *= $ov_zoom        #  the map is marked with [OV] and event
  231.       self.zoom_y *= $ov_zoom        #  is a Game_Player
  232.     end
  233.   end
  234. end
  235. #===============================================================================
  236. class Spriteset_Map
  237.   def initialize
  238.   # Make viewports
  239.     @viewport1 = Viewport.new(0, 0, 640, 480)
  240.     @viewport2 = Viewport.new(0, 0, 640, 480)
  241.     @viewport3 = Viewport.new(0, 0, 640, 480)
  242.     @viewport2.z = 2000
  243.     @viewport3.z = 5000
  244.   # Make tilemap
  245.     @tilemap = Draw_Tilemap.new
  246.   # Make panorama plane
  247.     @panorama = Plane.new
  248.     @panorama.z = -2000
  249.   # Make fog plane
  250.     @fog = Plane.new
  251.     @fog.z = 3000
  252.   # Make character sprites
  253.     @character_sprites = []
  254.     for i in $game_map.events.keys.sort
  255.       sprite = Sprite_Character.new($game_map.events[i])
  256.       @character_sprites.push(sprite)
  257.     end
  258.     @character_sprites.push(Sprite_Character.new($game_player))
  259.   # Make weather
  260.     @weather = RPG::Weather.new(@viewport1)
  261.   # Make picture sprites
  262.     @picture_sprites = []
  263.     for i in 1..50
  264.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  265.                                                $game_screen.pictures[i]))
  266.     end
  267.   # Make timer sprite
  268.     @timer_sprite = Sprite_Timer.new
  269.   # Frame update
  270.     update
  271.   end
  272.   #-----------------------------------------------------------------------------
  273.   def dispose
  274.   # Dispose of tilemap
  275.     @tilemap.dispose
  276.   # Dispose of panorama plane
  277.     @panorama.dispose
  278.   # Dispose of fog plane
  279.     @fog.dispose
  280.   # Dispose of character sprites
  281.     for sprite in @character_sprites
  282.       sprite.dispose
  283.     end
  284.   # Dispose of weather
  285.     @weather.dispose
  286.   # Dispose of picture sprites
  287.     for sprite in @picture_sprites
  288.       sprite.dispose
  289.     end
  290.   # Dispose of timer sprite
  291.     @timer_sprite.dispose
  292.   # Dispose of viewports
  293.     @viewport1.dispose
  294.     @viewport2.dispose
  295.     @viewport3.dispose
  296.   end
  297. end
复制代码
激活方法:
若要激活这个效果,请在工程中的地图名后加上[#**],**是缩放比率。例如地图名是:
“66后院”,那么将其改为“66后院[#12]”,就相当于对66后院这张地图实施12%的缩
放,这个数值请根据实际情况灵活调整。如果使用了显示地图名的脚本,地图后缀是不
会被显示出来的。不设置缩放比率,默认不进行地图缩放。如果设置有大地图,那么请
在大地图名后加上[OV],将会启用一套更合适的缩放效果。

杂感:
华丽确实是华丽,但是总体来说可用性不是很高,主要是那近乎疯狂的资源占用率……
另外还有个很大的缺陷——无视图块优先级……
如要使用,看来也只能是做R剧用用了(无视优先级对于一个游戏来说相当致命)。
而且不知道为什么,在这种伪3D地图上行走有点头晕……

转载自RPG Palace(原发布页面)

Lv4.逐梦者

梦石
1
星屑
4939
在线时间
443 小时
注册时间
2006-1-31
帖子
1537
2
 楼主| 发表于 2006-8-23 18:03:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
注意:
首先请确认自己的机器足够强悍!
偶的本本就不行,一点游戏就“脚本已备份”。
偶的台式机只能把祯数维持在10祯左右。

  1. #===============================================================================
  2. $width = 640    # Screen width        (will not change resolution,
  3. $height = 480   # Screen height        here for compatibility)
  4. $ov_zoom = 0.6  # Overworld zoom multiplier
  5. $strip_size = 8 # Size of each strip of the map.  Higher numbers will lag less.
  6.                 #  Recommended that this number be a power of 2.
  7.                 #  Do not make higher than 64.
  8. $curve = true   # Whether the map is curled, for overworlds (old method)
  9. $data_map = load_data("Data/MapInfos.rxdata")
  10. #===============================================================================
  11. class RPG::MapInfo
  12.   def name # Definition prevents location scripts from reading anything within
  13.     return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
  14.   end
  15.   #-----------------------------------------------------------------------------
  16.   def original_name
  17.     return @name
  18.   end
  19.   #-----------------------------------------------------------------------------
  20.   def overworld?
  21.     return @name.scan(/[OV]/).size > 0
  22.   end
  23.   #-----------------------------------------------------------------------------
  24.   def pitch
  25.     @name =~ /\[#[ ]*([00-99]+)\]/i
  26.     return $1
  27.   end
  28. end
  29. #===============================================================================
  30. class Draw_Tilemap # This class controls a set of sprites, with different Z
  31.                    #  values, arranged into horizontal bars
  32.   attr_accessor :tileset
  33.   attr_accessor :map_data
  34.   attr_accessor :priorities
  35.   attr_accessor :autotiles
  36.   attr_accessor :bitmaps
  37.   attr_accessor :pitch
  38.   attr_accessor :ox
  39.   attr_accessor :oy
  40.   attr_accessor :plus_y
  41.   INDEX = # Autotile definitions
  42.   [
  43.   26, 27, 32, 33, 4,  27, 32, 33, 26, 5,  32, 33, 4,  5,  32, 33,
  44.   26, 27, 32, 11, 4,  27, 32, 11, 26, 5,  32, 11, 4,  5,  32, 11,
  45.   26, 27, 10, 33, 4,  27, 10, 33, 26, 5,  10, 33, 4,  5,  10, 33,
  46.   26, 27, 10, 11, 4,  27, 10, 11, 26, 5,  10, 11, 4,  5,  10, 11,
  47.   24, 25, 30, 31, 24, 5,  30, 31, 24, 25, 30, 11, 24, 5,  30, 11,
  48.   14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
  49.   28, 29, 34, 35, 28, 29, 10, 35, 4,  29, 34, 35, 4,  29, 10, 35,
  50.   38, 39, 44, 45, 4,  39, 44, 45, 38, 5,  44, 45, 4,  5,  44, 45,
  51.   24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
  52.   16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4,  41, 46, 47,
  53.   36, 37, 42, 43, 36, 5,  42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
  54.   36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0,  1,  6,  7
  55.   ]
  56.   X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
  57.   Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing;   up,    up, down,  down
  58.   #-----------------------------------------------------------------------------
  59.   def initialize
  60.   # Get initial data from Game_Map
  61.     @tileset = RPG::Cache.tileset($game_map.tileset_name)
  62.     @map_data = $game_map.data
  63.     @priorities = $game_map.priorities
  64.     @autotiles = []
  65.     for i in 0..6
  66.       @autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
  67.     end
  68.   # Provide blank data in proper object form
  69.     @ox = 0
  70.     @oy = 0
  71.   # Bitmaps used for each priority's drawing.  Priorities 2-5 are combined.
  72.     @bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
  73.                 Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
  74.                 Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
  75.   # Generate blank sprites
  76.     @sprites = [[], [], []]
  77.     for i in 0..2 # For each layer
  78.       for j in 0..$game_map.height * (32 / $strip_size) - 1
  79.       # For each horizontal strip of $strip_size height, make a blank sprite
  80.         @sprites[i].push(Sprite.new)
  81.         @sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
  82.         @sprites[i][j].x = $width / 2
  83.         @sprites[i][j].y = -64
  84.         @sprites[i][j].z = -5 + (i * 10)
  85.       end
  86.     end
  87.     @disposed = false
  88.     draw
  89.   end
  90.   #-----------------------------------------------------------------------------
  91.   def update
  92.   # Retrieve variable values for slant drawing; these values accesible by event
  93.     @pitch = $game_map.pitch.to_f
  94.     @plus_y = $game_map.plus_y
  95.     for i in 0..2 # For each layer
  96.       for j in [0, (($height / 2) - (($height * 60) /
  97.                 @pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
  98.                 (@oy + $height) / $strip_size].min.to_i
  99.       # For each strip within the visible screen, update OX/Y
  100.         @sprites[i][j].x = $width / 2
  101.         @sprites[i][j].y = j * $strip_size - @oy
  102.         unless @pitch == 0 # Apply X Zoom
  103.           @sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
  104.                                   (@pitch / ($height * 25)) + 1
  105.           if $curve # Zoom Y values same as X, and compensate
  106.             @sprites[i][j].zoom_y = @sprites[i][j].zoom_x
  107.             @sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
  108.                                 ((1 - @sprites[i][j].zoom_y) /
  109.                                 (2 * ((@pitch / 100) /
  110.                                       ($height / ($strip_size * 2)))) + 0.5)
  111.           end
  112.         end
  113.         @sprites[i][j].ox = @ox + $width / 2
  114.       # Add plus_y value; used in airship script
  115.         @sprites[i][j].y += @plus_y
  116.       end
  117.     end
  118.   end
  119.   #-----------------------------------------------------------------------------
  120.   def dispose
  121.   # Dispose all sprites
  122.     for i in 0..2
  123.       for j in @sprites[i]
  124.         j.bitmap.dispose
  125.         j.dispose
  126.       end
  127.     end
  128.     for i in @bitmaps
  129.       i.dispose
  130.     end
  131.     @tileset.dispose
  132.     for i in 0..6
  133.       @autotiles[i].dispose
  134.     end
  135.     @disposed = true
  136.   end
  137.   #-----------------------------------------------------------------------------
  138.   def disposed?
  139.     return @disposed
  140.   end
  141.   #-----------------------------------------------------------------------------
  142.   def draw
  143.   # Draw each individual position by XY value
  144.     for x in 0...@map_data.xsize
  145.       for y in 0...@map_data.ysize
  146.         draw_position(x, y)
  147.       end
  148.     end
  149.     for i in 0..2 # For each priority
  150.       for j in 0..@sprites[i].size - 1
  151.       # For each horizontal strip, transfer the bitmap appropriately
  152.         @sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
  153.             Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
  154.       end
  155.     end
  156.   end
  157.   #-----------------------------------------------------------------------------
  158.   def draw_position(x, y)
  159.     for layer in 0..2
  160.       pos = @map_data[x, y, layer]
  161.       @priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
  162.       if pos >= 384 # If it is a tile
  163.       # src_rect = 32x32 Rect on the tileset for source bitmap
  164.         src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
  165.       # Transfer source bitmap on the tileset to the current map tile
  166.         @bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
  167.       elsif pos >= 48 and pos < 384 # If it is an autotile
  168.         id = pos / 48 - 1 # Which autotile is used (0-6)
  169.       # plus_x is in development for animated autotiles
  170.         plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
  171.         for corner in 0..3
  172.           h = 4 * (pos % 48) + corner # Used to access INDEX
  173.         # src_rect = 16x16 Rect on the autotile for source bitmap
  174.           src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
  175.         # Transfer source bitmap on the autotile to the current 16x16 tile
  176.           @bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
  177.                                           @autotiles[id], src_rect)
  178.         end
  179.       end
  180.     end
  181.   end
  182. end
  183. #===============================================================================
  184. class Game_Map
  185.   attr_accessor :pitch
  186.   attr_accessor :plus_y
  187.   #-----------------------------------------------------------------------------
  188.   alias setup_or :setup
  189.   def setup(map_id)
  190.     setup_or(map_id)
  191.     @pitch = $data_map[$game_map.map_id].pitch
  192.     @plus_y = 0
  193.   end
  194.   #-----------------------------------------------------------------------------
  195.   def name
  196.     return $data_map[@map_id].name
  197.   end
  198. end
  199. #===============================================================================
  200. class Sprite_Character < RPG::Sprite
  201.   attr_accessor :character
  202.   #-----------------------------------------------------------------------------
  203.   def initialize(character = nil)
  204.     super()
  205.     @character = character
  206.     update
  207.   end
  208.   #-----------------------------------------------------------------------------
  209.   alias update_or :update
  210.   def update
  211.     update_or
  212.   # Update pitch value, and update zoom values to match
  213.     @pitch = $data_map[$game_map.map_id].pitch.to_f
  214.     self.zoom_x =
  215.     self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
  216.                   (@pitch / ($height * 25)) + 1
  217.   # Set sprite coordinates.  X value is multiplied by zoom value from the center
  218.     self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
  219.     self.y = @character.screen_y
  220.   # Add Y value for zoom compensation while in curve mode
  221.     if $curve and @pitch != 0
  222.       self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
  223.                 (2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
  224.     end
  225.   # Add plus_y value; used in airship script
  226.     self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
  227.     self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
  228.     if $data_map[$game_map.map_id].overworld? and
  229.        @character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
  230.       self.zoom_x *= $ov_zoom        #  the map is marked with [OV] and event
  231.       self.zoom_y *= $ov_zoom        #  is a Game_Player
  232.     end
  233.   end
  234. end
  235. #===============================================================================
  236. class Spriteset_Map
  237.   def initialize
  238.   # Make viewports
  239.     @viewport1 = Viewport.new(0, 0, 640, 480)
  240.     @viewport2 = Viewport.new(0, 0, 640, 480)
  241.     @viewport3 = Viewport.new(0, 0, 640, 480)
  242.     @viewport2.z = 2000
  243.     @viewport3.z = 5000
  244.   # Make tilemap
  245.     @tilemap = Draw_Tilemap.new
  246.   # Make panorama plane
  247.     @panorama = Plane.new
  248.     @panorama.z = -2000
  249.   # Make fog plane
  250.     @fog = Plane.new
  251.     @fog.z = 3000
  252.   # Make character sprites
  253.     @character_sprites = []
  254.     for i in $game_map.events.keys.sort
  255.       sprite = Sprite_Character.new($game_map.events[i])
  256.       @character_sprites.push(sprite)
  257.     end
  258.     @character_sprites.push(Sprite_Character.new($game_player))
  259.   # Make weather
  260.     @weather = RPG::Weather.new(@viewport1)
  261.   # Make picture sprites
  262.     @picture_sprites = []
  263.     for i in 1..50
  264.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  265.                                                $game_screen.pictures[i]))
  266.     end
  267.   # Make timer sprite
  268.     @timer_sprite = Sprite_Timer.new
  269.   # Frame update
  270.     update
  271.   end
  272.   #-----------------------------------------------------------------------------
  273.   def dispose
  274.   # Dispose of tilemap
  275.     @tilemap.dispose
  276.   # Dispose of panorama plane
  277.     @panorama.dispose
  278.   # Dispose of fog plane
  279.     @fog.dispose
  280.   # Dispose of character sprites
  281.     for sprite in @character_sprites
  282.       sprite.dispose
  283.     end
  284.   # Dispose of weather
  285.     @weather.dispose
  286.   # Dispose of picture sprites
  287.     for sprite in @picture_sprites
  288.       sprite.dispose
  289.     end
  290.   # Dispose of timer sprite
  291.     @timer_sprite.dispose
  292.   # Dispose of viewports
  293.     @viewport1.dispose
  294.     @viewport2.dispose
  295.     @viewport3.dispose
  296.   end
  297. end
复制代码

激活方法:
若要激活这个效果,请在工程中的地图名后加上[#**],**是缩放比率。例如地图名是:
“66后院”,那么将其改为“66后院[#12]”,就相当于对66后院这张地图实施12%的缩
放,这个数值请根据实际情况灵活调整。如果使用了显示地图名的脚本,地图后缀是不
会被显示出来的。不设置缩放比率,默认不进行地图缩放。如果设置有大地图,那么请
在大地图名后加上[OV],将会启用一套更合适的缩放效果。

杂感:
华丽确实是华丽,但是总体来说可用性不是很高,主要是那近乎疯狂的资源占用率……
另外还有个很大的缺陷——无视图块优先级……
如要使用,看来也只能是做R剧用用了(无视优先级对于一个游戏来说相当致命)。
而且不知道为什么,在这种伪3D地图上行走有点头晕……

转载自RPG Palace(原发布页面)

Lv1.梦旅人

月下可怜人

梦石
0
星屑
50
在线时间
10 小时
注册时间
2005-11-23
帖子
4085

第1届短篇游戏比赛亚军

3
发表于 2006-8-23 18:24:04 | 只看该作者
想起来了SFC的很多经典游戏的大地图
纵然千里外,我等雁归来。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2006-2-27
帖子
230
4
发表于 2006-8-23 18:29:38 | 只看该作者
不错呀!!!!!!!!!!!!!!

好东西
................
回复 支持 反对

使用道具 举报

Lv1.梦旅人

天下第一杰伦迷

梦石
0
星屑
50
在线时间
1 小时
注册时间
2005-10-28
帖子
308
5
发表于 2006-8-23 18:55:39 | 只看该作者
好啊!{/qiang}
回复 支持 反对

使用道具 举报

Lv1.梦旅人

海 关

梦石
0
星屑
50
在线时间
431 小时
注册时间
2006-1-1
帖子
460
6
发表于 2006-8-23 20:05:08 | 只看该作者
这个强悍的无话可说了~~
消失中~~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

查无此人

梦石
0
星屑
50
在线时间
9 小时
注册时间
2006-5-8
帖子
1399
7
发表于 2006-8-24 23:32:22 | 只看该作者
看看这个,同样是伪3D地图,怎么区别这么大?
http://rpgcreative.forumpro.fr/f ... e-quelques-bugs.htm
KRKR + NS 学习中..........
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
25410
在线时间
1535 小时
注册时间
2006-1-10
帖子
2063

开拓者第一届地图绘制大赛RTP组第四名

8
发表于 2006-8-24 23:44:10 | 只看该作者
{/qiang}
什么效果都能出来,只要有能力
MV帮助 http://miaowm5.github.io/RMMV-F1/日复一日,年复一年人还是保留一点自我兴趣的好啊~~~忘记过去 ,这样我就可以  放弃未来了……哭~~终于找回以前的头像了,哎~~原来我是那么的想念阿……
画地图没灵感?很烦?很无聊 【 戳 我 】一 大 波 地 图 在 等 你  \^0^/
我的游戏
回复 支持 反对

使用道具 举报

Lv1.梦旅人

贵宾

梦石
0
星屑
50
在线时间
261 小时
注册时间
2005-10-21
帖子
489

贵宾

9
发表于 2006-8-24 23:57:51 | 只看该作者
太耗内存了
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2005-10-29
帖子
150
10
发表于 2006-8-25 00:00:13 | 只看该作者
还有一张图没贴出来(最强悍的一张)

评分

参与人数 1星屑 +2 收起 理由
yzls123 + 2

查看全部评分

签名被屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 15:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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