Project1

标题: 能设定门上的屋顶方块能穿过吗? [打印本页]

作者: 我為了下載    时间: 2012-11-28 12:11
标题: 能设定门上的屋顶方块能穿过吗?
本帖最后由 我為了下載 于 2012-11-28 18:45 编辑

请问有没有方法能穿过那一格的墙壁?
还是要使用到脚本?

test.jpg (96.81 KB, 下载次数: 22)

test.jpg

作者: zeldafd    时间: 2012-11-28 12:27
利用事件貼那一塊圖塊,再在事件中設置通行設置。
作者: 喵呜喵5    时间: 2012-11-28 12:27
把这个图案复制到其他图块组(B、C、D),通行设置设置为星号,门的上方那一格用这个图块来画
作者: 喵呜喵5    时间: 2012-11-28 12:27
本帖最后由 喵呜喵5 于 2012-11-28 12:30 编辑

或者弄一张图案一样的行走图,在门的上方设置一个以此为图案的事件,事件优先级定义为在角色上方
作者: 爱尔伯塔    时间: 2012-11-28 12:31
各位都说明了...
他们的方法都可以..
作者: uuiio797    时间: 2012-11-28 12:47
本帖最后由 uuiio797 于 2012-11-28 12:51 编辑

以下是地图区域穿透脚本,LS说的用事件也行。
脚本用法:
先复制脚本到你的工程。
如果要让该图块在人物头上并且穿过就在该图块区域添上区域号码1。
添上区域号码2就表示该区域不能通过。
添上3的话就表示该区域是秘密通道。
脚本来源:http://forums.rpgmakerweb.com/in ... -in-depth-maps-v20/
RUBY 代码复制
  1. #××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××=×××
  2. # In-Depth Maps v2.0
  3. # FenixFyreX
  4. # RPG Maker VxAce
  5. #×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  6. # This script allows the player to define two regions:
  7. # overhead ceilings, and blocking tiles.
  8. # When the system finds the overhead ceilings region on top of a tile, it will
  9. # move that tile to the highest layer in the tilemap, and put the tile above
  10. # that tile (y - 1) in it's place on the 'ground', this allows the player to pass
  11. # underneath the tile.
  12. # To turn the system OFF, simply turn the switch defined below ON. To turn it
  13. # on, flip the switch OFF. This allows the user to traverse the 'ceilings' when
  14. # on top of them, but go behind them when on the ground.
  15. #
  16. #×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  17.  
  18. module Fyx
  19.   module MapDepth
  20.  
  21.     # This is the switch to turn ON to turn the overhead system OFF.
  22.     # Remember, all switches are OFF by default, so the system is ON at startup.
  23.     Switch = 1
  24.  
  25.     # Does the script turn on the switch automatically when each map loads?
  26.     AutoSwitch = true
  27.  
  28.     # This is the region defining tiles that need to be above the player.
  29.     Overhead_Region = 1
  30.  
  31.     # This is the region defining tiles that need to be unpassable no matter
  32.     # what.
  33.     Block_Region = 2
  34.  
  35.     # This is the region to use when defining 'secret passages'. This region
  36.     # ensures that the tiles below it are ALWAYS above and passable.
  37.     Secret_Region = 3
  38.  
  39.     # This is the user defined fall-back for when the system can't obtain a
  40.     # tile to place under overhead tiles.
  41.     Default_Ground_Tile = 2816
  42.   end
  43. end
  44.  
  45. #×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  46. # Don't edit below unless you know what it means.
  47. #×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  48.  
  49. class Game_Map
  50.  
  51.   alias setup_no_ceilings setup
  52.   def setup(*a,&bl)
  53.     setup_no_ceilings(*a,&bl)
  54.     if Fyx::MapDepth::AutoSwitch
  55.       $game_switches[ohead_switch] = false
  56.     end
  57.     @old_tileset_flags = tileset.flags
  58.     @ohead_switch = ohead_sys_is_on?
  59.     define_ceilings if ohead_sys_is_on?
  60.   end
  61.  
  62.   def ohead_sys_is_on?
  63.     return false if $game_switches[ohead_switch]
  64.     return true
  65.   end
  66.  
  67.   def ohead_switch
  68.     Fyx::MapDepth::Switch
  69.   end
  70.  
  71.   def ohead_region
  72.     Fyx::MapDepth::Overhead_Region
  73.   end
  74.  
  75.   def block_region
  76.     Fyx::MapDepth::Block_Region
  77.   end
  78.  
  79.   def secret_region
  80.     Fyx::MapDepth::Secret_Region
  81.   end
  82.  
  83.   def default_ground_tile
  84.     Fyx::MapDepth::Default_Ground_Tile
  85.   end
  86.  
  87.   def ceiling_ground_tile(x,y)
  88.     return valid?(x,y-1) ? $game_map.data[x,y-1,0] : default_ground_tile
  89.   end
  90.  
  91.   alias passable_no_ceilings? passable?
  92.   def passable?(*a,&bl)
  93.     if ohead_sys_is_on?
  94.       return false if ceiling_block?(*a,&bl)
  95.     end
  96.     passable_no_ceilings?(*a,&bl)
  97.   end
  98.  
  99.   def ceiling?(x,y)
  100.     region_id(x,y) == ohead_region
  101.   end
  102.  
  103.   def secret_passage?(x,y)
  104.     region_id(x,y) == secret_region
  105.   end
  106.  
  107.   def ceiling_block?(*a,&bl)
  108.     x,y = *a[0...2]
  109.     region_id(x,y) == block_region
  110.   end
  111.  
  112.   def get_ceil_xys(clear=false)
  113.     @ceilings = []
  114.     @ceiling_blocks = []
  115.     @pass_ceilings = []
  116.     if clear
  117.       @map = load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
  118.       tileset.flags = @old_tileset_flags
  119.       return nil
  120.     end
  121.     height.times do |y|
  122.       width.times do |x|
  123.         @ceilings << [x,y] if ceiling?(x,y)
  124.         @pass_ceilings << [x,y] if secret_passage?(x,y)
  125.         @ceiling_blocks << [x,y] if ceiling_block?(x,y)
  126.       end
  127.     end
  128.   end
  129.  
  130.   def define_ceilings
  131.     get_ceil_xys
  132.     @ceilings.each do |x,y|
  133.       tid = $game_map.data[x,y,0]
  134.       tileset.flags[tid] = 0x10
  135.       $game_map.data[x,y,2] = tid
  136.       $game_map.data[x,y,0] = ceiling_ground_tile(x,y)
  137.     end
  138.     @pass_ceilings.each do |x,y|
  139.       tid = $game_map.data[x,y,0]
  140.       tileset.flags[tid] = 0x10
  141.       $game_map.data[x,y,2] = tid
  142.       $game_map.data[x,y,0] = default_ground_tile
  143.     end
  144.   end
  145.  
  146.   alias update_no_ceilings update
  147.   def update(*a,&bl)
  148.     if @ohead_switch != ohead_sys_is_on?
  149.       @ohead_switch = ohead_sys_is_on?
  150.       if ohead_sys_is_on?
  151.         define_ceilings
  152.       else
  153.         get_ceil_xys(true)
  154.       end
  155.     end
  156.     update_no_ceilings(*a,&bl)
  157.   end
  158. end
  159. #×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  160. # ×END OF SCRIPT×
  161. #×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

作者: uuiio797    时间: 2012-11-30 14:51
uuiio797 发表于 2012-11-28 12:47
以下是地图区域穿透脚本,LS说的用事件也行。
脚本用法:
先复制脚本到你的工程。


1号的用途:
当图上B图块的上方A图块没有任何图块挡住时就能通行,B图块就是遮挡的图块建筑。

2012-11-30_145433.png (11.88 KB, 下载次数: 23)

2012-11-30_145433.png





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1