Fog of War Version: 1.0 Author: modern algebra Date: July 6, 2010
Version History
<Version 1.0> 07.06.2010 - Original Release Description
This script allows you to create "fog of war" on specified maps. This is a concept familiar to RTS games as it is used to hide the movement of enemy units when they are not in range of your own units. This script brings that concept to RMVX, and allows for two layers: a permanent one that is cleared forever once a unit explores the area, and a temporary one that is clear only for as long as it is within range of a unit. You can use either layer or both for any given map.
This script also allows for other events (not just the player) to have vision, and will hide other events not within direct vision of a unit unless you specify that event to show anyway.
Features
Allows you to give any map you want a fog of war, a great feature for dungeons Has the ability to use two layers of fog of war, one that is cleared permanently once it comes in to sight, and one that is only cleared for as long as it is within sight Uses separate autotiles for each layer, with the ability to change the opacity of each You can use either or both layers for any given map Events that are under the fog of war will not be shown, unless the current page of it is tagged with a special comment (for using events as a third map layer) Sight is not limited to the player - you can also give an event sight by including a special comment on its page Can use diamond shaped clear or circular clear for any unit with sight Screenshots Instructions
Please see the header of the script for instructions.
Script
Script is very long. Please retrieve it either from the
text document or
demo .
Bug Fixes
Spoiler for Exit Site Uncleared :
If you re-enter a fog of war map at a different place than you exited, the sight radius will still be cleared at the site you exited. This patch fixes that:
#============================================================================== # Clear Temporary Layer Patch # Bug fix for Fog of War 1.0 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Description: # # There was a bug in the previous version where if you re-entered a map with # fog of war at a different location than you exited, the sight radius from # when the player exited would still be there. This patch fixes that bug. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # Paste this into its own slot below Fog of War but still above Main. #============================================================================== class Tilemap_FogofWar #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias ma_hos_initz_fow_6yh2 initialize def initialize (*args) # Eliminate the top layer $game_system.paint_fog ($game_map.map_id, 0, 2816) $game_player.update_fow ma_hos_initz_fow_6yh2 (*args) # Run original method end end
Credit
Thanks
Wachunga, for the RMXP script that inspired the creation of this one Zeriab, for the Table Printout script Heartofshadow, for a bug report Support
Please post in this topic at RMRK if you require support, no matter when this topic was last posted in. Do not PM me.
Known Compatibility Issues
No currently known compatibility issues, but it may interact strangely with some fog scripts.
Demo
See
attached Graphics
I have attached a few fog of war autotiles as samples and free for use.
"FogOfWar" and
"FogOfWar2" I made myself, while
"FogOfWar Wachunga" is a resized version of the sample autotile Wachunga used in his RMXP script. All FogOfWar autotiles must be saved in System.
Also, the script has "FogOfWar2" built into it, and it will use that autotile if you have no fog of war autotiles in the System folder.
Author's Notes
I remember using Wachunga's Fog of War script when I first started using RMXP. It's a nice idea, so I figured I'd write my own RMVX one.