Builder Zone

From Wherigo Foundation Wiki
Revision as of 13:25, 22 April 2018 by Ranger Fox (Talk | contribs) (Created page with "A zone is an area in the real world. In the course of the game, the player will visit various zones. You can make things happen when the player gets close to the zone, enters...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A zone is an area in the real world. In the course of the game, the player will visit various zones. You can make things happen when the player gets close to the zone, enters the zone, or leaves the zone.

A zone can contain items and characters.


Adding a Zone

To add a zone in the builder, choose Zones in the left sidebar. Click the Add button below the Zones list. Provide at least a name for the zone and a brief description.


Locating the Zone

Each zone has a shape with at least three sides. The shape is defined by its "corners", each of which is specified by latitude and longitude. The builder gives you several different ways to define a zone. Do this in the Zone Points panel on the lower left.

  • You can specify the corners individually. To do this, use the Add, Edit and Delete buttons to the right of the Points list.
  • You can set the "center" of the zone and allow the builder to generate a rectangular shape around that center point. To do this, use the Set button to the right of the latitude and longitude fields to set the center point. Then use the Generate button to set the length of the diagonal of the rectangle and generate the four corner points.
  • You can set the "center" of the zone based on an address. To do this, use the Create from Address button. Give the address and the length of the diagonal.
  • You can create the zone via the TerraServer mapping web site. To start this process, use the Create from Map button. This process seems cumbersome so it probably should be your last restort.


Distance and Proximity Settings

There are two different measures of the player's "closeness" to the zone: distance range and proximity range. Each is a distance such as 100 feet or 200 meters. Visualize these as bands of the specified widths surrounding the zone. As the player approaches the zone, he or she will first cross the boundary formed by the distance range, then the one formed by the proximity range, then the boundary of the zone itself.

As the player enters each band, an event associated with that band fires. By associating a script with each event, your cartridge can react to the the fact that the player has entered the band or zone. In addition, there is an event which fires when the user exits the zone. There are no exit events for the proximity and distance bands. However, the entry events for these bands fire again on the way out. When the player exits the zone, the proximity entry event fires again. Similarly, when the player exits the proximity band, the distance entry event fires again.

If you set the distance range to -1 in the builder, the distance entry event fires immediately upon cartridge startup (for initially active zones) or when first activate the zone (for initially inactive zones).

The distance setting also has an effect on zone visibility in the locations list. See the section //Active and Visible//, below.


Making Adjustments

Once you have defined your zone, you can check the shape and dimensions by using the View Shape button. You can see it in Google Maps by using the Edit Online button. This is much faster and easier to use than TerraServer.

  • To determine which corner is which, click a point in the list. The corresponding marker on the map changes color.
  • To move a point, simply drag it on the map.
  • To delete a point, double-click it in the list.
  • To visualize the proximity and distance bands, check the "Map it" boxes. You can also change the widths here.
  • When you have completed your changes, choose Save Changes. Then choose Close.
  • To discard your changes, choose Cancel and Ignore My Changes.

It is not clear if the player uses the center of the zone or its points to determine proximity. If you adjust the corners to such an extent that the center is no longer within the shape, you may wish to consider adjusting the center point as well.


Active and Visible

Tooltips in the builder imply that zone visibility in the location list is related to the distance range. This is true, but not apparent in the emulator (with a cartridge published locally). In addition to distance range, the engine uses the Visible and Active properties of a zone to control interaction with the player. The rules are as follows.

  • A zone is never visible unless the player is within the distance range of the zone. If the distance range is -1, this does not apply.
  • The Active property determines whether or not the engine processes events related to the zone. If the zone is inactive, events are not processed and the zone is not visible in the locations list (even if the Visible property is true and the player is sufficiently close to the zone).
  • The Visible property determines whether or not an active zone appears in the locations list when the player is sufficiently close to the zone.

You can set the distance range, as well as the initial values of the Active and Visible properties, in the builder when you create or edit a zone. You can change the state of the Active and Visible properties in event scripts. See the "Set a zone to active or inactive" and "Set a zone, item, character or task to visible or not visible." It is worth noting that you can set these properties of a zone from the script attached to any event, not just those events associated with the zone in question.

For a cartridge published locally to your PC (as opposed to being uploaded to the web site), the emulator observes different visibility rules. This is an aid to debugging the cartridge. In this situation, all zones are visible on the emulator map. Different colors distinguish visible from invisible zones.

Prior to the builder/engine release of 03/27/2008, there was an error in the emulator and PPC engines. Active, visible zones were shown in the locations list regardless of the distance setting or the player's proximity to the zone. As of 03/27/2008, active, visible zones are shown in the list only if the player is within the distance setting of the zone, or if distance is -1. This behavior matches the original behavior of the Colorado.