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
keystringThe saved-state name of the zone, unique among this plugin's zones and the same in every version of the plugin.
getCenterIdFunc<FormId<ObjectReference>?>Called at each check. A null result leaves the player outside, and an exception ends the zone's checks.
radiusfloatThe radius, in game units.
Returns
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
keyorgetCenterIdisnull.- ArgumentOutOfRangeException
radiusis zero or negative.- ArgumentException
This plugin created a zone with
keyalready.