查看: 2698|回复: 2

[已经解决] 无力翻墙,求帮助,图层脚本

[复制链接]
梦石
0
星屑
85
在线时间
40 小时
注册时间
2012-7-3
回帖
82
发表于 2013-9-22 19:15:09 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 a774741359 于 2013-9-22 19:16 编辑

我需要这个脚本:http://bbs.cgyouxi.com/forum.php?mod=viewthread&tid=304286
但是无力翻墙
求帮助
传送门:http://galveraxe.wordpress.com/galvs-layer-graphics/
梦石
0
星屑
163
在线时间
445 小时
注册时间
2013-7-18
回帖
90
发表于 2013-9-22 19:58:56 | 显示全部楼层
Galv的旧版示范下载  
http://pan.baidu.com/share/link? ... 7&uk=1932489685

  (脚本请用下面这个↓)
  1. #------------------------------------------------------------------------------#
  2. #  Galv's Layer Graphics
  3. #------------------------------------------------------------------------------#
  4. #  For: RPGMAKER VX ACE
  5. #  Version 1.2
  6. #------------------------------------------------------------------------------#
  7. #  2013-03-22 - Version 1.2 - Added layers in battles
  8. #  2013-03-17 - Version 1.1 - fixed graphic object bug
  9. #  2013-03-17 - Version 1.0 - release
  10. #------------------------------------------------------------------------------#
  11. #  Create image layers on maps using script calls. These image layers can be
  12. #  used for overlay mapping, moving fogs etc.
  13. #
  14. #  Notes:
  15. #  Once you have created a layer for a map, it will remain at the settings you
  16. #  chose until you change it again. Layers don't carry over from map to map, you
  17. #  will need to create the layer for each map required.
  18. #  I recommend not using too many layers as it could start to cause lag.
  19. #
  20. #  There are other scripts available that do a similar thing, this is just my
  21. #  implementation of it. I recommend trying the others out, too (as they are
  22. #  possibly better!). I created this more for myself but thought I'd add it to
  23. #  my archive for anyone to use.
  24. #------------------------------------------------------------------------------#

  25. #-------------------------------------------------------------------------------
  26. #  SCRIPT CALLS:
  27. #-------------------------------------------------------------------------------
  28. #
  29. #  layer_status(status)    # script enabled if status is true, disabled if false
  30. #
  31. #  del_layer(map_id,layer_id)       # removes a layer graphic from selected map
  32. #
  33. #  layer(map,layer,["Filename",xspeed,yspeed,opacity,z,blend,xoffset,yoffset])
  34. #
  35. #  #  map        - map id the layer is to be on
  36. #  #  layer      - layer number. use different numbers for different layers
  37. #  #  "Filename" - the name of the image located in Graphics/Layers/ folder
  38. #  #  xspeed     - speed the layer will scroll horizontally
  39. #  #  yspeed     - speed the layer will scroll vertically
  40. #  #  opacity    - the opacity of the layer
  41. #  #  z value    - what level the layer is displayed at (ground is 0)
  42. #  #  blend      - 0 is normal, 1 is addition, 2 is subtraction
  43. #  #  xoffset    - Moves the layer at a different amount than the map. Make
  44. #  #  yoffset    - these 0 to fix the layer to the map.
  45. #
  46. #  refresh_layers     # When setting a NEW layer on the CURRENT map, you will
  47. #                     # need to use the refresh_layers script call right after.
  48. #                     # Updating an existing one or setting a layer for another
  49. #                     # map doesn't require refreshing.
  50. #
  51. #-------------------------------------------------------------------------------
  52. #  EXAMPLE SCRIPT CALLS:
  53. #  layer(1,6,["water2",0.3,0.1,120,-5,0,0,0])   # adds/updates layer 6 on map 1
  54. #  layer(2,1,["map2-over",0,0,255,700,0,10,0])  # adds/updates layer 1 on map 2
  55. #
  56. #  layer_status(false)    # turn layers OFF
  57. #  layer_status(true)     # turn layers ON
  58. #-------------------------------------------------------------------------------

  59. #-------------------------------------------------------------------------------
  60. #  SCRIPT CALLS for BATTLE layers
  61. #-------------------------------------------------------------------------------
  62. #
  63. #  del_blayer(layer_id)       # Removes a layer from battles.
  64. #
  65. #  refresh_layers             # Use this when adding a new laying during battle
  66. #
  67. #  blayer(layer,["Filename",xspeed,yspeed,opacity,z,blend,xoffset,yoffset])
  68. #
  69. #  #  These script calls add and remove layers that will appear in battle. They
  70. #  #  work the same as map layers without the need for a map id at the start.
  71. #  #  Ideally you would change the layers before combat, but they can be done
  72. #  #  during as well, if you refresh the layers.
  73. #
  74. #-------------------------------------------------------------------------------

  75. #-------------------------------------------------------------------------------
  76. #  NO SCRIPT SETTINGS. DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING.
  77. #-------------------------------------------------------------------------------

  78. ($imported ||= {})["Galv_Layers"] = true
  79. module Cache
  80.   def self.layers(filename)
  81.     load_bitmap("Graphics/Layers/", filename)
  82.   end
  83. end # Cache


  84. class Spriteset_Map
  85.   def create_layers
  86.     @layer_images = []
  87.     return if !$game_map.layer_status
  88.     return if $game_map.layers[$game_map.map_id].nil?
  89.     $game_map.layers[$game_map.map_id].each_with_index { |layer,i|
  90.       if layer.nil?
  91.         @layer_images.push(nil)
  92.       else
  93.         @layer_images.push(Layer_Graphic.new(@viewport1,i))
  94.       end
  95.     }
  96.   end

  97.   def update_layers
  98.     @layer_images.each { |o| o.update if !o.nil? }
  99.   end
  100.    
  101.   def dispose_layers
  102.     @layer_images.each { |o| o.dispose if !o.nil? }
  103.     @layer_images = []
  104.   end

  105.   def refresh_layers
  106.     dispose_layers
  107.     create_layers
  108.   end

  109.   alias galv_layers_sm_create_parallax create_parallax
  110.   def create_parallax
  111.     galv_layers_sm_create_parallax
  112.     create_layers
  113.   end
  114.   alias galv_layers_sm_dispose_parallax dispose_parallax
  115.   def dispose_parallax
  116.     galv_layers_sm_dispose_parallax
  117.     dispose_layers
  118.   end

  119.   alias galv_layers_sm_update_parallax update_parallax
  120.   def update_parallax
  121.     galv_layers_sm_update_parallax
  122.     update_layers
  123.   end
  124. end # Spriteset_Map


  125. class Spriteset_Battle
  126.   def create_layers
  127.     @layer_images = []
  128.     return if !$game_map.layer_status
  129.     return if $game_map.blayers.nil?
  130.     $game_map.blayers.each_with_index { |layer,i|
  131.       if layer.nil?
  132.         @layer_images.push(nil)
  133.       else
  134.         @layer_images.push(Layer_Graphic.new(@viewport1,i))
  135.       end
  136.     }
  137.   end

  138.   def update_layers
  139.     @layer_images.each { |o| o.update if !o.nil? }
  140.   end
  141.    
  142.   def dispose_layers
  143.     @layer_images.each { |o| o.dispose if !o.nil? }
  144.     @layer_images = []
  145.   end

  146.   def refresh_layers
  147.     dispose_layers
  148.     create_layers
  149.   end

  150.   alias galv_layers_sb_create_battleback2 create_battleback2
  151.   def create_battleback2
  152.     galv_layers_sb_create_battleback2
  153.     create_layers
  154.   end
  155.    
  156.   alias galv_layers_sb_dispose dispose
  157.   def dispose
  158.     dispose_layers
  159.     galv_layers_sb_dispose
  160.   end

  161.   alias galv_layers_sb_update update
  162.   def update
  163.     galv_layers_sb_update
  164.     update_layers
  165.   end
  166. end # Spriteset_Battle


  167. class Game_Map
  168.   attr_accessor :blayers
  169.   attr_accessor :layers
  170.   attr_accessor :layer_status

  171.   alias galv_layers_gm_initialize initialize
  172.   def initialize
  173.     galv_layers_gm_initialize
  174.     @layer_status = true
  175.     @layers = { 0 => [] }
  176.     @blayers = []
  177.   end

  178.   alias galv_layers_gm_setup setup
  179.   def setup(map_id)
  180.     galv_layers_gm_setup(map_id)
  181.     if SceneManager.scene_is?(Scene_Map)
  182.       @layers[0] = []
  183.       SceneManager.scene.spriteset.refresh_layers
  184.     end
  185.   end
  186. end # Game_Map


  187. class Scene_Map < Scene_Base
  188.   attr_accessor :spriteset
  189. end # Scene_Map < Scene_Base

  190. class Scene_Battle < Scene_Base
  191.   attr_accessor :spriteset
  192. end # Scene_Map < Scene_Base


  193. class Game_Interpreter
  194.   def refresh_layers
  195.     SceneManager.scene.spriteset.refresh_layers
  196.   end
  197.    
  198.   def layer(map,id,array)
  199.     need_refresh = false
  200.     $game_map.layers[map] ||= []
  201.     need_refresh = true if $game_map.layers[map][id].nil?
  202.     $game_map.layers[map][id] = array
  203.   end
  204.   def del_layer(map,id)
  205.     return if !$game_map.layers[map]
  206.     $game_map.layers[map][id] = nil
  207.     SceneManager.scene.spriteset.refresh_layers
  208.   end
  209.   def layer_status(status)
  210.     $game_map.layer_status = status
  211.     SceneManager.scene.spriteset.refresh_layers
  212.   end
  213.    
  214.   def blayer(id,array)
  215.     need_refresh = false
  216.     $game_map.blayers ||= []
  217.     need_refresh = true if $game_map.blayers[id].nil?
  218.     $game_map.blayers[id] = array
  219.   end
  220.   def del_blayer(id)
  221.     return if !$game_map.blayers
  222.     $game_map.blayers[id] = nil
  223.     SceneManager.scene.spriteset.refresh_layers if SceneManager.scene_is?(Scene_Battle)
  224.   end
  225.    
  226. end # Game_Interpreter


  227. class Layer_Graphic < Plane
  228.   def initialize(viewport,id)
  229.     super(viewport)
  230.     @id = id
  231.     if SceneManager.scene_is?(Scene_Battle)
  232.       @layers = $game_map.blayers
  233.     else
  234.       @layers = $game_map.layers[$game_map.map_id]
  235.     end
  236.     @layers
  237.     init_settings
  238.   end

  239.   def init_settings
  240.     @name = @layers[@id][0]  # filename
  241.     self.bitmap = Cache.layers(@name)
  242.     @width = self.bitmap.width
  243.     [url=home.php?mod=space&uid=291977]@height[/url] = self.bitmap.height
  244.     if @layers[0] && @layers[0][@id]
  245.       @movedx = @layers[0][@id][0].to_f  # stored x
  246.       @movedy = @layers[0][@id][1].to_f  # stored y
  247.     else
  248.       @movedx = 0.to_f
  249.       @movedy = 0.to_f
  250.     end
  251.   end

  252.   def update
  253.     change_graphic if @name != @layers[@id][0]
  254.     update_opacity
  255.     update_movement
  256.   end
  257.    
  258.   def change_graphic
  259.     @name = @layers[@id][0]
  260.     self.bitmap = Cache.layers(@name)
  261.     @width = self.bitmap.width
  262.     @height = self.bitmap.height
  263.   end
  264.    
  265.   def update_movement
  266.     self.ox = 0 + $game_map.display_x * 32 + @movedx + xoffset
  267.     self.oy = 0 + $game_map.display_y * 32 + @movedy + yoffset
  268.     @movedx += @layers[@id][1]
  269.     @movedy += @layers[@id][2]
  270.     @movedx = 0 if @movedx >= @width
  271.     @movedy = 0 if @movedy >= @height
  272.     self.z = @layers[@id][4]
  273.     self.blend_type = @layers[@id][5]
  274.   end
  275.    
  276.   def xoffset
  277.     $game_map.display_x * @layers[@id][6]
  278.   end
  279.   def yoffset
  280.     $game_map.display_x * @layers[@id][7]
  281.   end

  282.   def update_opacity
  283.     self.opacity = @layers[@id][3]
  284.   end
  285.    
  286.   def dispose
  287.     $game_map.layers[0][@id] = [@movedx,@movedy]
  288.     self.bitmap.dispose if self.bitmap
  289.     super
  290.   end
  291. end # Layer_Graphic < Plane
复制代码

评分

参与人数 1星屑 +180 收起 理由
熊喵酱 + 180 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
85
在线时间
40 小时
注册时间
2012-7-3
回帖
82
 楼主| 发表于 2013-9-23 14:55:02 | 显示全部楼层
lottesong 发表于 2013-9-22 19:58
Galv的旧版示范下载  
http://pan.baidu.com/share/link?shareid=692351037&uk=1932489685

十分感谢  问题解决
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部