Project1

标题: 这个怎么做 [打印本页]

作者: hyx1963    时间: 2013-9-1 14:27
标题: 这个怎么做
张几个地图合起来,但没有断开的效果
作者: Jousun    时间: 2013-9-1 15:00
这个问题有点奇怪,有点小看不懂。

不过答案应该是:photoshop
作者: hyx1963    时间: 2013-9-1 16:17
Jousun 发表于 2013-9-1 15:00
这个问题有点奇怪,有点小看不懂。

不过答案应该是:photoshop

?????
这个你都讲得出 真是xx啦
作者: tseyik    时间: 2013-9-1 16:29
本帖最后由 tseyik 于 2013-9-1 16:37 编辑

Connected Maps
http://himeworks.wordpress.com/2013/03/17/area-maps/
此腳本允許您將地圖連接在一起,提供一張地圖從無縫過渡到另一個。
你可以在單獨的部分中創建一張地圖,並將其所有一起以產生一個大地圖連接。
這應該在理論上允許您超過編輯器中所規定的 500 × 500 限制。
它們都使用相同的花紋,所以您不能連接兩個地圖有兩個不同的 tilesets




作者: david_ng223    时间: 2013-9-1 18:21
提示: 作者被禁止或删除 内容自动屏蔽
作者: hyx1963    时间: 2013-9-1 21:31
david_ng223 发表于 2013-9-1 18:21
如果你的遊戲的畫面大小是544*416的話,可以在地圖上下預留7格,左右預留9格後,使用場景移動來進行地圖連 ...

你会有这种最lz的方法去做游戏吧
作者: hyx1963    时间: 2013-9-1 21:32
tseyik 发表于 2013-9-1 16:29
Connected Maps
http://himeworks.wordpress.com/2013/03/17/area-maps/
此腳本允許您將地圖連接在一起,提 ...

什么来的 打不开
作者: tseyik    时间: 2013-9-1 21:34
本帖最后由 tseyik 于 2013-9-1 21:39 编辑





<connect map: map_id offset_x offset_y>
  1. =begin

  2. #===============================================================================

  3. Title: Connected Maps

  4. Author: Tsukihime

  5. Date: Apr 2, 2013

  6. --------------------------------------------------------------------------------

  7. ** Change log

  8. Apr 2

  9.    - added note-tag shortcut for width and height

  10. Mar 17, 2013

  11.    - updated to support area map addon

  12.    - combined encounter lists

  13.    - fixed bug where transferring was not done correctly

  14.    - Initial release

  15. --------------------------------------------------------------------------------   

  16. ** Terms of Use

  17. * Free to use in commercial/non-commercial projects

  18. * No real support. The script is provided as-is

  19. * Will do bug fixes, but no compatibility patches

  20. * Features may be requested but no guarantees, especially if it is non-trivial

  21. * Credits to Tsukihime in your project

  22. * Preserve this header

  23. --------------------------------------------------------------------------------

  24. ** Description



  25. This script allows you to connect maps together, providing a seamless

  26. transition from one map to another. You can create a map in separate parts

  27. and then connect it all together to produce one large map. This allows you

  28. to exceed the 500x500 limit imposed by the editor.



  29. --------------------------------------------------------------------------------

  30. ** Usage



  31. Place this script below Materials and above Main.



  32. To connect a map to another, write a note-tag in the map object



  33.    <connect map: map_id offset_x offset_y>

  34.    <connect map: map_id offset_x offset_y recurse_limit>

  35.    

  36. The map_id is the ID of the map that you want to the current map.

  37. Offset_x and Offset_y is the position that the new map will be placed.



  38. You can use the letter "w" for offset_x to mean the width of the map.

  39. You can use the letter "h" for offset_y to mean the height of the map.



  40. The recurse_limit is special and will be described later.



  41. -- Positioning modes --



  42. There are two types of map connecting modes in this script.



  43. 1. Absolute connection.

  44.     All offsets are specified relative to the current map, where the

  45.     origin is located at (0, 0), the upper-left corner of the current map.



  46. 2. Recursive connection.

  47.     All offsets are specified relative to the parent map, where the

  48.     origin is the position of the upper-left corner of the parent map.

  49.    

  50. If you are using recursive mode, you can use the recurse limit in the note-tag.

  51.   

  52. The recurse limit is meant to save you some effort when connecting maps.

  53. For example, suppose you have the following connection between two maps, A

  54. and B



  55. A --> B

  56. B --> A



  57. The recurse limit allows you to specify how many times these connections

  58. should repeat. For example, if recurse limit is 2, then the connection is

  59. allowed to repeat twice



  60. A --> B --> A --> B --> A -> B -> A



  61. There are some rules to follow when connecting maps



  62. 1. You start from the top-left, and connect maps to the right or below. You

  63.     cannot connect maps to the left or above, so plan carefully.

  64.    

  65. 2. Maps that do not have equal dimensions will leave empty black squares that

  66.     are not passable.

  67.    

  68. 3. Events can only reference events on the same map. They cannot reference

  69.     events from other maps.



  70. #===============================================================================

  71. =end

  72. $imported = {} if $imported.nil?

  73. $imported["TH_ConnectedMaps"] = true

  74. #===============================================================================

  75. # ** Configuration

  76. #===============================================================================

  77. module TH

  78.   module Connected_Maps

  79.    

  80.     # Recursive mode allows you to connect maps relative to each other.

  81.     # Set this to false if youp refer absolute positioning. Though I think

  82.     # it is easier to leave it as recursive.

  83.     Recursive_Mode = true

  84.    

  85.     Regex = /<connect[-_ ]map: (\d+)\s+(w|-?\d+)\s+(h|-?\d+)\s*(\d+)?>/im

  86.   end

  87. end

  88. #===============================================================================

  89. # ** Rest of script

  90. #===============================================================================

  91. module RPG

  92.   class Map

  93.    

  94.     def connected_maps

  95.       return @connected_maps unless @connected_maps.nil?

  96.       load_notetag_connected_maps

  97.       return @connected_maps

  98.     end

  99.    

  100.     def load_notetag_connected_maps

  101.       @connected_maps = []

  102.       res = self.note.scan(TH::Connected_Maps::Regex)

  103.       res.each {|result|

  104.         map_id = result[0].to_i

  105.         offset_x = result[1] ? (result[1].downcase == "w" ? self.width : result[1].to_i) : 0

  106.         offset_y = result[2] ? (result[2].downcase == "h" ? self.height : result[2].to_i) : 0

  107.         recurse_limit = result[3] ? result[3].to_i : 1

  108.         @connected_maps.push([map_id, offset_x, offset_y, recurse_limit])

  109.       }

  110.     end  

  111.   end

  112.   

  113.   class Event

  114.     def update_for_map_connection(offset)

  115.       @pages.each {|page|

  116.         update_page_events(page, offset)

  117.       }

  118.     end

  119.    

  120.     def update_page_events(page, offset)

  121.       page.list.each {|cmd|

  122.         case cmd.code

  123.         when 111 # cond branch, character (0, 1, 2, ...)

  124.           cmd.parameters[1] += offset if cmd.parameters[0] == 6 && cmd.parameters[1] > 0

  125.         when 122 # variables, character (0, 1 2, ... )

  126.           cmd.parameters[5] += offset if cmd.parameters[4] == 5 && cmd.parameters[5] > 0

  127.         when 203 # set event location

  128.           cmd.parameters[0] += offset if cmd.parameters[0] > 0

  129.           cmd.parameters[2] += offset if cmd.parameters[1] == 2 && cmd.parameters[2] > 0

  130.         when 205, 212, 213 # move route, animation, and balloon

  131.           cmd.parameters[0] += offset if cmd.parameters[0] > 0

  132.         end

  133.       }

  134.     end

  135.   end

  136. end



  137. class Game_Map

  138.   

  139.   alias :th_connected_maps_setup :setup

  140.   def setup(map_id)

  141.     @new_width = nil

  142.     @new_height = nil

  143.     th_connected_maps_setup(map_id)

  144.     add_connected_maps(@map, {})

  145.     @map.width ||= @new_width

  146.     @map.height ||= @new_height

  147.   end

  148.   

  149.   alias :th_connected_maps_width :width

  150.   def width

  151.     @new_width || th_connected_maps_width

  152.   end

  153.   

  154.   alias :th_connected_maps_height :height

  155.   def height

  156.     @new_height || th_connected_maps_height

  157.   end

  158.   

  159.   #-----------------------------------------------------------------------------

  160.   # Connect maps together with the current map. The recursive limit is a global

  161.   # limit, not a local limit, and is based on the number of times a map has

  162.   # been visited. TO-DO: implement as BFS...

  163.   #-----------------------------------------------------------------------------

  164.   def add_connected_maps(map, visited, ox=0, oy=0)

  165.     map.connected_maps.each {|map_id, offset_x, offset_y, recurse_limit|

  166.       visited[map_id] ||= 1

  167.       return if visited[map_id] > recurse_limit

  168.       visited[map_id] += 1

  169.       conmap = load_data(sprintf("Data/Map%03d.rvdata2", map_id))

  170.       setup_connected_map(map_id, ox, oy, offset_x, offset_y)

  171.       combine_maps(conmap.data, ox + offset_x, oy + offset_y)

  172.       combine_encounters(conmap.encounter_list)

  173.       combine_events(conmap.events, ox + offset_x, oy + offset_y, @events.keys.max || 0)

  174.       add_connected_maps(conmap, visited, ox + offset_x, oy + offset_y)

  175.     }

  176.   end

  177.   

  178.   #-----------------------------------------------------------------------------

  179.   # Setup map metadata

  180.   #-----------------------------------------------------------------------------

  181.   def setup_connected_map(map_id, ox, oy, offset_x, offset_y)

  182.   end

  183.   

  184.   #-----------------------------------------------------------------------------

  185.   # Extend the current map's tilemap with the new map's tile map. Resize

  186.   # only if needed. Remember that we are always connecting to the right or

  187.   # bottom.

  188.   #-----------------------------------------------------------------------------

  189.   def combine_maps(new_data, ox, oy)

  190.     new_x = ox + new_data.xsize >= width ? ox + new_data.xsize : width

  191.     new_y = oy + new_data.ysize >= height ? oy + new_data.ysize : height

  192.     @new_width =  new_x

  193.     @new_height = new_y

  194.     @map.data.resize(new_x, new_y, @map.data.zsize)

  195.     for z in 0 ... 4

  196.       for x in 0 ... new_data.xsize

  197.         for y in 0 ... new_data.ysize

  198.           next if ox + x < 0 || oy + y < 0

  199.           @map.data[ox + x, oy + y, z] = new_data[x, y, z]

  200.         end

  201.       end

  202.     end

  203.   end

  204.   

  205.   #-----------------------------------------------------------------------------

  206.   # Extend the current map's encounters with the new map's events, updating all

  207.   # events and event references as necessary

  208.   #-----------------------------------------------------------------------------

  209.   def combine_encounters(new_enc_list)

  210.     @map.encounter_list.concat(new_enc_list)

  211.   end

  212.   

  213.   #-----------------------------------------------------------------------------

  214.   # Extend the current map's events with the new map's events, updating all

  215.   # events and event references as necessary

  216.   #-----------------------------------------------------------------------------

  217.   def combine_events(events, ofs_x, ofs_y, ofs_evt)

  218.     new_events = {}

  219.     events.each {|id, event|

  220.       new_id = id + ofs_evt

  221.       event.id = new_id

  222.       event.x += ofs_x

  223.       event.y += ofs_y

  224.       event.update_for_map_connection(ofs_evt)

  225.       @map.events[new_id] = event

  226.       new_events[new_id] = event

  227.     }

  228.     setup_new_events(new_events)

  229.   end

  230.   

  231.   #-----------------------------------------------------------------------------

  232.   # Set up our new events

  233.   #-----------------------------------------------------------------------------

  234.   def setup_new_events(events)

  235.     events.each do |i, event|

  236.       @events[i] = Game_Event.new(@map_id, event)

  237.     end

  238.   end

  239. end
复制代码

作者: hyx1963    时间: 2013-9-1 22:17
本帖最后由 hyx1963 于 2013-9-1 22:18 编辑
tseyik 发表于 2013-9-1 21:34


上面英文与识我 我5识与 步骤
作者: tseyik    时间: 2013-9-2 11:48
本帖最后由 tseyik 于 2013-9-2 11:57 编辑
hyx1963 发表于 2013-9-1 22:17
上面英文与识我 我5识与 步骤


1:貼上脚本
2:做四個新地圖(大小)17x14(如本無地圖)
3:在地圖1的附註加入<connect map: 2 17 0>
4:在地圖1的附註再加入<connect map: 4 0 13>
5:在地圖1的附註再加入<connect map: 3 17 13>
運行遊戯
就會看到如下圖,四個地圖合而為一

<connect map: 2 17 0>
<指令  地圖ID  X  y>
其他用法自己摸索
作者: x603526956    时间: 2013-9-2 22:34
每天上线看看论坛,都可以看到好多新用法和脚本。感谢各位大大。我收下了




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