Table of Contents

Interface ITriggerZoneFactory

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

Creates zones around references that raise events as the player enters and leaves them.

public interface ITriggerZoneFactory

Remarks

The zones are checked on the game's thread each quarter second of unpaused time while a game and the player are loaded. The player is inside a zone while within its radius of the center, measured in three dimensions, and in the center's worldspace or interior cell. Call members on the game's thread.

Methods

Create(string, Func<FormId<ObjectReference>?>, float)

Creates a zone of radius units around the reference getCenterId returns.

ITriggerZone Create(string key, Func<FormId<ObjectReference>?> getCenterId, float radius)

Parameters

key string

The saved-state name of the zone, unique among this plugin's zones and the same in every version of the plugin.

getCenterId Func<FormId<ObjectReference>?>

Called at each check. A null result leaves the player outside, and an exception ends the zone's checks.

radius float

The radius, in game units.

Returns

ITriggerZone

Remarks

The inside state is stored in this plugin's saved state, so a save loaded with the player inside raises no OnEnter. Callable from a plugin's start, before the game has data or a save.

Exceptions

ArgumentNullException

key or getCenterId is null.

ArgumentOutOfRangeException

radius is zero or negative.

ArgumentException

This plugin created a zone with key already.