This script allows you to control fog of war using region tiles. Each map can assign multiple different regions of fog. Different fog regions are separate from one another.
Script calls are used to show or hide region fog.
You will also need this image: region_fog_tileset
Place this script below Bit Switches and above Main.
Place the “region_fog_tileset” image into your Graphics/System folder
Creating your region fog
The basic note-tag is given as follows:
<region fog> region: x, switch: y </region fog>
Where x and y are both numbers. You can have as many region fogs as you want on a single map. You can assign the same switch to multiple regions, across different maps as well. The basic note-tag requires you to specify the region and its corresponding switch.
If you require more advanced options, or don’t want to use all of the options
available, use the extended note-tag as follows:
<region fog: 2> switch: 2 tile: 1 </region fog>
Which will designate region 2 as a region fog, whose visibility is based on
bit-switch 2, and uses fog tile 1.
Custom Fog Tiles
By default, the fog tile you get is black. If you look at the region_fog_tileset image, you will see a 32×32 black square near the top-left.
Each tile has an ID. The top-left tile is tile 0, which is no fog.
The one next to it is tile 1, which is the default black fog. You can add your
own fog tiles as well, and reference in the extended note-tag if you want
specific regions to use specific fog tiles.
Changing Fog Visibility
To show or hide the a region fog, you will need to change the value of the
switch. These are bit switches, so you won’t be able to use the “Control
Switches” event command to change them.
To hide the fog, make the script call
To show the fog, make the script call
Here’s a sample region fog setup:
<region fog> region: 1, switch: 1 region: 2, switch: 2 region: 3, switch: 1 </region fog>
This means that the fog for regions 1 and 3 use the same bitswitch.
If you called
This would hide the fog for both region 1 and region 3.
An equivalent setup using the extended note-tag would be as follows:
<region fog: 1> switch: 1 </region fog> <region fog: 2> switch: 2 </region fog> <region fog: 3> switch: 1 </region fog>
It is more verbose, the extended note-tag provides more options and not every option is required.