Zones (Passable and Impassable) in v1.1
RPG in a Box v1.1 brings the exciting new addition of the zone system! On top of the updates to the combat, skill, and stat systems, this will open up so many more possibilities for your games! Continue reading below for an overview of zones and how they can be used.
What is a Zone?
A zone is a box-shaped area within a map, defined by a position (using the tile coordinate system) and a size (measured in voxels). Zones can be either passable or impassable. Passable zones allow characters to pass through them freely, with options to trigger a script whenever a character enters or exits the zone. Impassable zones act as obstacles and prevent characters from passing through them, with an option to trigger a script whenever a character collides with the zone.

Zones are created and modified from the Map Properties tab in the Map Editor. When assigning scripts to zones, the built-in initiator
variable will contain the character that triggered the event. It should be noted that zones are only supported in free movement. Support for passable zones in grid-based movement will come in a future update.
Example Usages
- Blocking off areas to ensure they're inaccessible to the player
- Resetting the player when they fall off the edge of a map (see video below)
- Triggering a cutscene when the player enters a certain area of a map
- Applying a status effect to the player when they're in a healing zone or toxic zone
- And so much more!
The new First-Person Magic Shooter project template includes some uses of zones. The passable zone inside the room behind the locked door (the green area in the image below) triggers the end of the game when the player enters the zone. The impassable zone above that room's walls (the red area in the image below) prevents the player from jumping over the walls to bypass the locked door.

The colored boxes for zones in the Map Editor can be hidden using the new Display Zones button on the Map Editor toolbar. They can also be hidden along with other visual indicators by holding the Backtick (`) key, or Shift + Backtick (`) key to toggle all of them off.
Scripting
From a scripting perspective, there are several new Bauxite functions related to the management of zones. Below is a list of these new functions that are available to use:
Add Zone: Adds a new zone to the current map, with parameters for zone name, passability, position, width, depth, and height. The width, depth, and height are measured in voxels. For example, add_zone("toxic_zone", true, coord[0, 0, 0], 64, 64, 16)
will add a passable zone named "toxic_zone" at coordinate (0, 0, 0) with dimensions of 64 x 64 x 16 voxels.
Disable Zone: Disables a zone in the current map, e.g. disable_zone("toxic_zone")
. When a zone is disabled, scripts for that zone will not trigger. If the zone is impassable, it won't block the player when disabled.
Enable Zone: Enables a zone that was previously disabled via the "Disable Zone" function, e.g. enable_zone("toxic_zone")
.
Remove Zone: Removes a zone from the current map, e.g. remove_zone("toxic_zone")
.
Set Zone Script: Modifies a zone's script, with trigger options of CHARACTER_ENTER
and CHARACTER_EXIT
for passable zones and CHARACTER_COLLIDE
for impassable zones. For example, set_zone_script("toxic_zone", "apply_poison_status", CHARACTER_ENTER)
will cause the "apply_poison_status" script to be triggered whenever a character enters that zone.

Already using zones for your game or plan to use them? Comment below and let me know how they've helped out with your project or any ideas you may have for how they could be used!
In case you missed the first two posts covering v1.1, you can find them here:
Skill and Stat Updates in v1.1
Combat Updates in v1.1
Check out the full release notes for v1.1 here:
https://rpginabox.com/forum/d/254-release-notes-for-v11