Skip to content
napolitanod edited this page Dec 29, 2021 · 6 revisions

The following methods are available on the api either on dangerZone or game.modules.get('danger-zone').api

triggerZone (zoneName, sceneId, options = {})

ASYNC triggers the given zone on the given scene or the world zone. Note that the danger doesn't need to have a world zone part configured in order to trigger it as a world zone. In order to give players the ability to call this in macro you must have the module socketlib installed and active in the world and the GM must have enabled the API for players (this is done in the Danger Zone configuration settings)

  • @param {string} zoneName - the zone's title or the danger's title if triggering a world zone.
  • @param {string} sceneId - the scene id. If '' is passed in then the current scene is used.
  • @param {object} options - optional object with configuration data as follows

    e.g. {activeOnly: true, location: {x:2090, y:1090 , z:8}, scope: 'scene'

    activeOnly {boolean} - if set to true, the zone won't trigger if it is not active

    location {object} {x:,y:,z:} - bypasses zone targeting. Provide x,y pixel and z elevation for danger to target

    scope {string} - options: 'scene', 'world'. indicates that the zone executed should be limited to either a scene zone or a world zone. Leave blank to check both (the scene's zones will be checked first).

toggleZone (zoneName, sceneId)

ASYNC toggles the active indicator for the given zone on the scene

  • @param {string} zoneName - the zone's title
  • @param {string} sceneId (optional) - the scene id. If left blank then the current scene is used.

enableZone(zoneName, sceneId)

ASYNC activates the given zone on the scene

  • @param {string} zoneName - the zone's title
  • @param {string} sceneId (optional) - the scene id. If left blank then the current scene is used.

disableZone(zoneName, sceneId)

ASYNC deactivates the given zone on the scene

  • @param {string} zoneName - the zone's title
  • @param {string} sceneId (optional) - the scene id. If left blank then the current scene is used.

addHighlightZone(zoneName, sceneId, identifier)

ASYNC Adds the highlight of the zone to the given scene within the highlight layer

  • @param {string} zoneName - the zone's title
  • @param {string} sceneId (optional) - the scene id. If left blank then the current scene is used.
  • @param {string} identifier (optional) - an identifier that user provides that differentiates this highlight layer from other highlight layers created for this zone

destroyHighlightZone(zoneName, sceneId, identifier)

Deletes the highlight of the zone from the given scene within the highlight layer

  • @param {string} zoneName - the zone's title
  • @param {string} sceneId (optional) - the scene id. If left blank then the current scene is used.
  • @param {string} identifier (optional) - an identifier that user provided when highlight was created that differentiates this highlight layer from other highlight layers created for this zone

Clone this wiki locally