设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
搜索附件  
同能RPG制作大师 › 附件中心 › 同能RM技术讨论区 › RPG Maker VA 讨论区 › Basic Evented Fog of War: Basic Evented Fog of War-3.jpg

Basic Evented Fog of War: Basic Evented Fog of War-3.jpg

 

Basic Evented Fog of War:
Evented Fog Of War FOW Demo

This is a basic demo demonstration how you can use eventing to design a basic fog of war system.

No real instructions required, the evented system is pretty simple to follow.

If you have suggestions of how to improve or make more efficient please share.

Features:


  • Unexplored Fog
  • Previously Explored Fog
  • Current sight
  • Enemy invisible when in fog
Event Requirements:

1 - Parallel

1 - Common Event

Code Requirements:

You will need map extensions provided here and in demo:

http://forums.rpgmakerweb.com/index.php?/topic/25040-ace-useful-script-call-reference/

Spoiler#--------------------------------------------------------------------------
#Modifications
#--------------------------------------------------------------------------
#Changed Line 88 in Game_Event
#from
# if near_the_screen? && @stop_count > stop_count_threshold
#to
# if @stop_count > stop_count_threshold
#--------------------------------------------------------------------------
# REGION MANIPULATION
#--------------------------------------------------------------------------
class Game_Map
def setTileRegion(reg_x,reg_y,reg_id)

if reg_id > 63 || reg_id < 0
reg_id = 0
end

@thirdvalue = "%14b" % self.data[reg_x, reg_y, 3]

# binary split of the two elements
@bLEFT = @thirdvalue[0,6] # REGION ID IN BINARY
@bRIGHT = @thirdvalue[6,8] # SHADOW ID IN BINARY

@bLEFT = "%6b" % reg_id

@newvalue = @bLEFT.to_s + @bRIGHT.to_s
@newvalue = @newvalue.to_i(2)

self.data[reg_x, reg_y, 3] = @newvalue

end
def getTileRegion(reg_x,reg_y)

# gets a 14 bit long binary string from the map data array
@thirdvalue = "%14b" % self.data[reg_x, reg_y, 3]

# binary split of the two elements
@bLEFT = @thirdvalue[0,6] # REGION ID IN BINARY
@bRIGHT = @thirdvalue[6,8] # SHADOW ID IN BINARY

# converts the binary string back to an integer and returns
return(@bLEFT.to_i(2))

end
def getTileShadowID(reg_x,reg_y)

# gets a 14 bit long binary string from the map data array
@thirdvalue = "%14b" % self.data[reg_x, reg_y, 3]

# returns binary split of the two elements
@bLEFT = @thirdvalue[0,6] # REGION ID IN BINARY
@bRIGHT = @thirdvalue[6,8] # SHADOW ID IN BINARY

# converts the binary string back to an integer and returns
return(@bRIGHT.to_i(2))

end


#--------------------------------------------------------------------------
# MAP MANIPULATION
#--------------------------------------------------------------------------
def getTileIDByLayer(x,y,layer)
return(self.data[x,y,layer])
end

def setTileIDByLayer(x,y,layer,tile_ID)
self.data[x,y,layer] = tile_ID
end


end


#--------------------------------------------------------------------------
# Save Tile Manipulation
#--------------------------------------------------------------------------
class Game_System
def changeTileByInternalID(map_id,x,y,layer,intID)
initialize_pos_list(map_id, layer)
tid = intID
@swapped_pos_tiles[map_id][layer][y] = [] if @swapped_pos_tiles[map_id][layer][y].nil?
@swapped_pos_tiles[map_id][layer][y][x] = tid
$game_map.load_new_map_data
end
end
#--------------------------------------------------------------------------
# Battler Additions
#--------------------------------------------------------------------------
class Game_Battler < Game_BattlerBase
def wtype_equipped?(wtype_id)
return weapons.any? {|weapon| weapon.wtype_id == wtype_id }
end

def atype_equipped?(atype_id)
return armors.any? {|armor| armor.atype_id == atype_id}
end
end



Demo:

http://s000.tinyupload.com/?file_id=06010062965139142906

Screen:




本贴来自国际rpgmaker官方论坛作者:Quailar处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/basic-evented-fog-of-war.38029/
Basic Evented Fog of War: Basic Evented Fog of War-3.jpg
         同一主题附件:
    Basic Evented Fog of War-1.jpg
    Basic Evented Fog of War-2.jpg
    Basic Evented Fog of War-3.jpg
简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)
关闭

幸运抽奖

社区每日抽奖来袭,快来试试你是欧皇还是非酋~

立即查看

Loading...

QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

GMT+8, 2026-10-5 03:33 , Processed in 0.089353 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部