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

Project1

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

[已经过期] 有没有关于区域不可见的脚本?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
99
在线时间
12 小时
注册时间
2018-3-23
帖子
19
跳转到指定楼层
1
发表于 2019-3-30 23:59:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
就比如说在你进入这个房间前,这个房间是显示黑色的,你必须要进入后在能看见房间内的区域?以前有一个这个脚本,后来换电脑就没了。希望哪位大大帮我找一下

Lv4.逐梦者

梦石
1
星屑
14504
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
2
发表于 2019-3-31 02:23:24 | 只看该作者
  1. #==============================================================================
  2. # TheoAllen - 不可见区域
  3. # Version : 1.1
  4. # Language : Informal Indonesian
  5. # 需要脚本 : 基础模块 v1.5 - 基础功能
  6. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  7. # Contact :
  8. #------------------------------------------------------------------------------
  9. # *> http://www.rpgmakerid.com
  10. # *> http://www.rpgmakervxace.net
  11. # *> http://www.theolized.com
  12. #==============================================================================
  13. ($imported ||= {})[:Theo_InvisRegion] = true
  14. # =============================================================================
  15. # Change Logs:
  16. # -----------------------------------------------------------------------------
  17. # 2015.08.01 - Added always visible region
  18. # 2014.11.22 - Finished script
  19. # =============================================================================
  20. =begin

  21.   ================
  22.   *) 介绍 :
  23.   ----------------
  24.   本脚本可以根据玩家所处的位置,只显示其所在的区域,隐藏其他区域,有类似进入
  25.   房间而看不见房间外地图的效果。
  26.   
  27.   =====================
  28.   *) 使用方法 :
  29.   ---------------------
  30.   将本脚本放在插件脚本和基础模块之下,Main之上
  31.   
  32.   地图备注:
  33.   <invisreg>
  34.   
  35.   然后你需要在地图上为同一房间绘制相同ID的区域。例如,当玩家进入1号区域时,其他
  36.   ID的区域和没有区域设定的地方就会被隐藏。当玩家进入无区域设定的地方时,有区域
  37.   设定的地方会被隐藏。
  38.   
  39.   事件始终可见的事件注释:
  40.   <visible>
  41.   
  42.   ----------
  43.   更新 1.1
  44.   
  45.   可以设定:当玩家不在某区域时,仍然显示该区域。使用地图备注 <visireg: n>
  46.   'n'替换为区域ID。
  47.   
  48.   ===================
  49.   *)   使用条款 :
  50.   署名脚本作者, TheoAllen. 你可以自由编辑此脚本,只要你不声明你是脚本的原作者
  51.   如果你想用此脚本于商业游戏,请和我共享收益.别忘了给我一份免费的游戏拷贝.  
  52.   
  53. =end
  54. #===============================================================================
  55. # 无设定
  56. #===============================================================================
  57. #===============================================================================
  58. # ** TileMask
  59. #-------------------------------------------------------------------------------
  60. #  Sprite that same size as the map size. It's also scrolled alongside the map
  61. # if it's updated. It can be used to draw anything on map. In this script, it
  62. # used to manually draw "Fog of War" on map screen.
  63. #===============================================================================
  64. class TileMask < Plane_Mask
  65.   #-----------------------------------------------------------------------------
  66.   # * Initialize
  67.   #-----------------------------------------------------------------------------
  68.   def initialize(vport)
  69.     @region_id = $game_player.region_id
  70.     super
  71.   end
  72.   #-----------------------------------------------------------------------------
  73.   # * Update
  74.   #-----------------------------------------------------------------------------
  75.   def update
  76.     super
  77.     update_invisible if refresh_case
  78.   end
  79.   #-----------------------------------------------------------------------------
  80.   # * Update bitmap
  81.   #-----------------------------------------------------------------------------
  82.   def update_bitmap
  83.     super
  84.     update_invisible
  85.   end
  86.   #-----------------------------------------------------------------------------
  87.   # * Update Invisible
  88.   #-----------------------------------------------------------------------------
  89.   def update_invisible
  90.     @region_id = $game_player.region_id
  91.     unless $game_map.invisible_region?
  92.       bitmap.clear
  93.       return
  94.     end
  95.     bitmap.entire_fill(Color.new(0,0,0,220))   #在这里设定隐藏部分的颜色、不透明度
  96.     ($game_map.visiregs + [@region_id]).each do |visireg|
  97.       $game_map.regions[visireg].each do |pos|
  98.         x = pos[0] * 32
  99.         y = pos[1] * 32
  100.         bitmap.clear_rect(x,y,32,32)
  101.       end
  102.     end
  103.   end
  104.   #-----------------------------------------------------------------------------
  105.   # * Refresh case
  106.   #-----------------------------------------------------------------------------
  107.   def refresh_case
  108.     if $game_map.refresh_tilemask
  109.       $game_map.refresh_tilemask = false
  110.       return true
  111.     end
  112.     @region_id != $game_player.region_id
  113.   end
  114.   
  115. end

  116. #===============================================================================
  117. # ** Game_Map
  118. #===============================================================================

  119. class Game_Map
  120.   #-----------------------------------------------------------------------------
  121.   # * Public Attributes
  122.   #-----------------------------------------------------------------------------
  123.   attr_accessor :refresh_tilemask
  124.   attr_reader :regions
  125.   attr_reader :visiregs
  126.   #-----------------------------------------------------------------------------
  127.   # * Setup
  128.   #-----------------------------------------------------------------------------
  129.   alias theo_invistile_setup setup
  130.   def setup(map_id)
  131.     theo_invistile_setup(map_id)
  132.     record_regions
  133.     @refresh_tilemask
  134.   end
  135.   #-----------------------------------------------------------------------------
  136.   # * Record / pre-cache regions
  137.   #-----------------------------------------------------------------------------
  138.   def record_regions
  139.     @regions = {}
  140.     width.times do |w|
  141.       height.times do |h|
  142.         regid = region_id(w,h)
  143.         (@regions[regid] ||= []) << [w,h]
  144.       end
  145.     end
  146.     @visiregs = []
  147.     @map.note.split(/[\r\n]+/).each do |line|
  148.       if line =~ /<visireg\s*:\s*(\d+)>/i
  149.         @visiregs << $1.to_i
  150.       end
  151.     end
  152.   end
  153.   #-----------------------------------------------------------------------------
  154.   # * Invisible region?
  155.   #-----------------------------------------------------------------------------
  156.   def invisible_region?
  157.     @map.note[/<invisreg>/i]
  158.   end
  159.   
  160. end

  161. #===============================================================================
  162. # ** Game_Character
  163. #===============================================================================

  164. class Game_Character
  165.   #-----------------------------------------------------------------------------
  166.   # * Opacity
  167.   #-----------------------------------------------------------------------------
  168.   def opacity
  169.     return @opacity unless $game_map.invisible_region?
  170.     return 0 if region_id != $game_player.region_id
  171.     return @opacity
  172.   end  
  173. end

  174. #===============================================================================
  175. # ** Game_Player
  176. #===============================================================================

  177. class Game_Player
  178.   #-----------------------------------------------------------------------------
  179.   # * Opacity
  180.   #-----------------------------------------------------------------------------
  181.   def opacity
  182.     return @opacity
  183.   end  
  184. end

  185. #===============================================================================
  186. # ** Game_Event
  187. #===============================================================================

  188. class Game_Event
  189.   #-----------------------------------------------------------------------------
  190.   # * Stay Visible?
  191.   #-----------------------------------------------------------------------------
  192.   def stay_visible?
  193.     if @last_list != @list
  194.       @last_list = @list
  195.       return false unless @list
  196.       @stay_visible = false
  197.       @list.each do |command|
  198.         next unless [108,408].include?(command.code)
  199.         @stay_visible = true if command.parameters[0] =~ /<visible>/i
  200.       end
  201.     end
  202.     return @stay_visible
  203.   end
  204.   #-----------------------------------------------------------------------------
  205.   # * Opacity
  206.   #-----------------------------------------------------------------------------
  207.   def opacity
  208.     return @opacity if stay_visible? || !$game_map.invisible_region? ||
  209.       $game_map.visiregs.include?(region_id)
  210.     return 0 if region_id != $game_player.region_id
  211.     return @opacity
  212.   end
  213.   #-----------------------------------------------------------------------------
  214.   # * Screen Z value
  215.   #-----------------------------------------------------------------------------
  216.   def screen_z
  217.     return 25 if stay_visible? && region_id != $game_player.region_id
  218.     return super
  219.   end
  220.   
  221. end

  222. #===============================================================================
  223. # ** Spriteset_Map
  224. #===============================================================================

  225. class Spriteset_Map
  226.   #-----------------------------------------------------------------------------
  227.   # * Create Viewports
  228.   #-----------------------------------------------------------------------------
  229.   alias theo_invistile_create_vport create_viewports
  230.   def create_viewports
  231.     theo_invistile_create_vport
  232.     @tilemask = TileMask.new(@viewport1)
  233.     @tilemask.z = 50
  234.   end
  235.   #-----------------------------------------------------------------------------
  236.   # * Update
  237.   #-----------------------------------------------------------------------------
  238.   alias theo_invistile_update update
  239.   def update
  240.     theo_invistile_update
  241.     @tilemask.update
  242.   end
  243.   #-----------------------------------------------------------------------------
  244.   # * Dispose
  245.   #-----------------------------------------------------------------------------
  246.   alias theo_invistile_dispose dispose
  247.   def dispose
  248.     theo_invistile_dispose
  249.     @tilemask.dispose
  250.   end
  251.   
  252. end
复制代码
VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复 支持 1 反对 0

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
99
在线时间
12 小时
注册时间
2018-3-23
帖子
19
3
 楼主| 发表于 2019-3-31 03:34:05 | 只看该作者
有没有别的?这个好复杂...
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-26 17:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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