Table of Contents

Class GameTargetExtensions

Namespace
SkyrimForge.Game
Assembly
SkyrimForge.Game.dll

Provides extension members for GameTarget.

public static class GameTargetExtensions
Inheritance
GameTargetExtensions
Inherited Members

Methods

CenterOnCell(GameTarget, string)

Moves the player to the cell whose editor ID is editorId, as Papyrus's Debug.CenterOnCell does.

public static bool CenterOnCell(this GameTarget gameTarget, string editorId)

Parameters

gameTarget GameTarget
editorId string

Returns

bool

Whether the game found the cell.

Remarks

Call on the game's thread.

Exceptions

ArgumentNullException

editorId is null.

ArgumentException

editorId is empty, where Papyrus logs an error and moves nothing.

QuitGame(GameTarget)

Sets the flag the game's main loop tests to exit, as quitting to the desktop does.

public static void QuitGame(this GameTarget gameTarget)

Parameters

gameTarget GameTarget

ShakeCamera(GameTarget, IObjectReference?, float, float)

Shakes the camera, as Papyrus's Game.ShakeCamera does.

public static void ShakeCamera(this GameTarget gameTarget, IObjectReference? source = null, float strength = 0.5, float duration = 0)

Parameters

gameTarget GameTarget
source IObjectReference

The reference at whose position the shake originates, or null for the player's position.

strength float

The strength, from 0 to 1. A value outside that range is clamped to it.

duration float

The duration in seconds.

Remarks

Call on the game's thread.

get_CrosshairRef(GameTarget)

The reference under the crosshair. Null where the crosshair is over none.

public static ObjectReference? get_CrosshairRef(GameTarget gameTarget)

Parameters

gameTarget GameTarget

Returns

ObjectReference?

Remarks

The game builds its CrosshairPickData after a plugin starts and before the main menu opens. Call on the game's thread.

Exceptions

InvalidOperationException

The game has not built its CrosshairPickData yet.