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

Project1

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

[已经过期] 【提问】如何更改图片的Z值 ?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
160
在线时间
150 小时
注册时间
2015-10-14
帖子
212
跳转到指定楼层
1
发表于 2016-12-6 19:24:12 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

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

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

x
本帖最后由 Kim_巧克力控 于 2016-12-15 16:53 编辑

【已使用ULDS解决】--2016/12/15

嗨,各位大大 又是我啦

如题,我想要:



更改 【显示图片】 指令中的图片的Z值  (因为会遮挡到事件和玩家)





这次的提问就到这里,谢谢





填坑中

Lv1.梦旅人

梦石
0
星屑
160
在线时间
150 小时
注册时间
2015-10-14
帖子
212
3
 楼主| 发表于 2016-12-6 23:11:13 | 只看该作者
翻墙找到的一个脚本 全是英文看不懂啊
摸索看看吧..
  1. #==============================================================================
  2. #    Fix Picture to Map
  3. #    Version: 1.0.2 [VXA]
  4. #    Author: modern algebra (rmrk.net)
  5. #    Date: 8 September, 2012
  6. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  7. #  Description:
  8. #
  9. #    This allows you to set the position of a picture by the X and Y position
  10. #   of the map, rather than the screen, so that the picture won't move with you
  11. #   when the screen scrolls. Additionally, the script lets you set the Z value
  12. #   to show below characters, or even below the tiles or below the parallax.
  13. #
  14. #    This script has no effect in battle and pictures there behave normally.
  15. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  16. #  Instructions:
  17. #
  18. #    Paste this script into its own slot in the Script Editor, above Main but
  19. #   below Materials.
  20. #
  21. #    To specify that a picture should be fixed to a map and not follow the
  22. #   screen, all you need to do is turn an in-game switch on before showing the
  23. #   picture. To specify which switch, all you need to do is change the value of
  24. #   SWITCH_ID at line 60. Alternatively, you can include the code [Fixed]
  25. #   somewhere in the name of the picture.
  26. #
  27. #    For the fixed pictures, you also have the option of assigning it to grid
  28. #   coordinates instead of pixel coordinates. This means that if you wanted it
  29. #   to show up at (3, 5) in the map, you could set it to that directly instead
  30. #   of (96, 160). You can turn on this feature using another switch, again one
  31. #   which you choose by changing the value of COORDINATES_SWITCH_ID at line 63.
  32. #
  33. #    To specify the layer of the tilemap (what shows above it and what shows
  34. #   below it), all you need to do is change the value of a variable. Which
  35. #   variable is also specifed by you by changing Z_VARIABLE_ID at line 69.
  36. #   The value to which that in-game variable is set at the time a picture is
  37. #   shown determines where the picture will show up. If the variable is set to
  38. #   0 then it will be in its normal place; if set to -1, it will show below
  39. #   the tilemap but above the parallax; if set to -2, it will show below the
  40. #   parallax; if set to 1, it will show above all non-star tiles but star tiles
  41. #   and characters with normal priority; if set to 2, it will show above
  42. #   characters with normal priority but below characters with "Above
  43. #   Characters" priority. If set to any other value, the z value of the picture
  44. #   will be set to that directly.
  45. #==============================================================================

  46. $imported = {} unless $imported
  47. $imported[:MA_FixPictureToMap] = true

  48. #==============================================================================
  49. # *** MA_FixPicture
  50. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  51. #  This module holds some relevant configuration Data
  52. #==============================================================================

  53. module MA_FixPicture
  54.   #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  55.   #  Editable Region
  56.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  57.   #  SWITCH_ID - set this to the ID of the in-game switch that you want to
  58.   # use to control whether pictures should be fixed.
  59.   SWITCH_ID = 2
  60.   #  COORDINATES_SWITCH_ID - Set this to the ID of the in-game switch that you
  61.   # want to use to control how coordinates are set. If this switch is ON, then
  62.   # for fixed pictures, you can just use the grid x and y coordinates (ie: you
  63.   # would set (1, 4) instead of (32, 128). If you always want this feature to
  64.   # be on when the FPM Switch is on, you can set it to have the same ID.
  65.   COORDINATES_SWITCH_ID = 2
  66.   #  Z_VARIABLE_ID - set this to the ID of the in-game variable that you
  67.   # want to use to control the z-value priority of the picture.
  68.   Z_VARIABLE_ID = 3
  69.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  70.   #  End Editable Region
  71.   #////////////////////////////////////////////////////////////////////////////
  72.   class << self
  73.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74.     # * Public Instance Variables
  75.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76.     attr_accessor :spriteset_vp1
  77.     attr_accessor :spriteset_vp2
  78.   end
  79. end
  80. #==============================================================================
  81. # ** Game Picture
  82. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  83. #  Summary of Changes:
  84. #    new public instance variables - mafpm_vp_id; mafpm_fixed; mafpm_z
  85. #    aliased method - initialize; show; move
  86. #==============================================================================

  87. class Game_Picture
  88.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  89.   # * Public Instance Variables
  90.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91.   attr_accessor :mafpm_vp_id
  92.   attr_accessor :mafpm_fixed
  93.   attr_accessor :mafpm_z
  94.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95.   # * Object Initialization
  96.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97.   alias mafpm_iniz_2fg6 initialize
  98.   def initialize(*args, &block)
  99.     @mafpm_fixed = false
  100.     @mafpm_vp_id = 2
  101.     mafpm_iniz_2fg6(*args, &block) # Call Original Method
  102.     @mafpm_z = self.number
  103.   end
  104.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105.   # * Show Picture
  106.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  107.   alias mafpm_showpic_3jb7 show
  108.   def show(name, *args, &block)
  109.     # Only fix pictures if in Scene_Map
  110.     if SceneManager.scene_is?(Scene_Map)
  111.       @mafpm_fixed = (MA_FixPicture::SWITCH_ID == true ||
  112.         $game_switches[MA_FixPicture::SWITCH_ID] || !name[/\[FIXED\]/i].nil?)
  113.       z_var = $game_variables[MA_FixPicture::Z_VARIABLE_ID]
  114.       # If 0 or less than 300, then it should belong to the viewport1
  115.       @mafpm_vp_id = (z_var != 0 && z_var < 300) ? 1 : 2
  116.       # Set Z shortcuts
  117.       @mafpm_z = case z_var
  118.       when -1 then -50         # Below tilemap but above parallax
  119.       when -2 then -150        # Below parallax
  120.       when 0 then self.number  # Normal position
  121.       when 1 then 50           # Above tilemap but below normal characters
  122.       when 2 then 150          # Above normal characters but below Above Characters
  123.       else
  124.         @mafpm_z = z_var < 300 ? z_var : z_var - 300 # Directly set to value
  125.       end
  126.     end
  127.     mafpm_showpic_3jb7(name, *args, &block) # Call Original Method
  128.     if @mafpm_fixed && (MA_FixPicture::COORDINATES_SWITCH_ID == true || $game_switches[MA_FixPicture::COORDINATES_SWITCH_ID])
  129.       @x *= 32
  130.       @y *= 32
  131.     end
  132.   end
  133.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  134.   # * Move Picture
  135.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136.   alias mafpm_movepctr_2js1 move
  137.   def move(*args, &block)
  138.     mafpm_movepctr_2js1(*args, &block)
  139.     if @mafpm_fixed && (MA_FixPicture::COORDINATES_SWITCH_ID == true || $game_switches[MA_FixPicture::COORDINATES_SWITCH_ID])
  140.       @target_x *= 32
  141.       @target_y *= 32
  142.     end
  143.   end
  144. end

  145. #==============================================================================
  146. # ** Sprite Picture
  147. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  148. #  Summary of Changes:
  149. #    aliased methods - update
  150. #==============================================================================

  151. class Sprite_Picture
  152.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153.   # * Frame Update
  154.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  155.   alias mafpm_updt_5fw1 update
  156.   def update(*args, &block)
  157.     mafpm_updt_5fw1(*args, &block) # Call original method
  158.     # If picture is fixed to map
  159.     if @picture.mafpm_fixed
  160.       # Scroll the picture appropriately
  161.       self.x = @picture.x - ($game_map.display_x * 32)
  162.       self.y = @picture.y - ($game_map.display_y * 32)
  163.     end
  164.     self.z = @picture.mafpm_z # Update Z to the correct Z
  165.     # If the viewport has changed
  166.     if @mafpm_vp_id != @picture.mafpm_vp_id && MA_FixPicture.send(:"spriteset_vp#{@picture.mafpm_vp_id}")
  167.       @mafpm_vp_id = @picture.mafpm_vp_id
  168.       # Change viewport
  169.       self.viewport = MA_FixPicture.send(:"spriteset_vp#{@mafpm_vp_id}")
  170.     end
  171.   end
  172. end

  173. #==============================================================================
  174. # ** Spriteset Map
  175. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  176. #  Summary of Changes:
  177. #    aliased methods - create_viewports; dispose_viewports
  178. #==============================================================================

  179. class Spriteset_Map
  180.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181.   # * Create Viewports
  182.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  183.   alias mafpm_creatviewpor_3dk8 create_viewports
  184.   def create_viewports(*args, &block)
  185.     mafpm_creatviewpor_3dk8(*args, &block) # Call original method
  186.     # Set the viewports to be globally accessible
  187.     MA_FixPicture.spriteset_vp1 = @viewport1
  188.     MA_FixPicture.spriteset_vp2 = @viewport2
  189.   end
  190.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  191.   # * Dispose Viewports
  192.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  193.   alias mafpm_disposevps_2nr5 dispose_viewports
  194.   def dispose_viewports(*args, &block)
  195.     # Nullify the variables in MA_FixPicture
  196.     MA_FixPicture.spriteset_vp1 = nil
  197.     MA_FixPicture.spriteset_vp2 = nil
  198.     mafpm_disposevps_2nr5(*args, &block) # Call original method
  199.   end
  200. end
复制代码

填坑中
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21631
在线时间
9415 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

2
发表于 2016-12-6 19:44:49 | 只看该作者
不使用脚本的话无法更改,必定遮住事件和玩家

点评

6R上有么..  发表于 2016-12-6 22:31
那..有什么脚本可以更改?OTZ  发表于 2016-12-6 22:31
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-17 03:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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