Table of Contents

Class ScenePackage

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

An AI package the actor filling an alias runs in a ScenePhase.

public sealed record ScenePackage : SceneAction, IEquatable<SceneAction>, IEquatable<ScenePackage>
Inheritance
ScenePackage
Implements
Inherited Members

Remarks

A package that does not complete, such as a sandbox package, leaves the phase it ends in playing until the scene is stopped or the phase's EndsWhen returns true.

The player performs a package only while AI-driven. A scene with a package action whose alias the player fills sets that state as it begins to play and clears it as it ends. The state is one flag, so clearing it clears it for another mod that set it. A travel action whose alias the player fills runs Travel, or TravelAtRun for a speed of kRun or kJog. The radius does not apply to it, and two such actions running in one phase share the destination of the one listed last.

Constructors

ScenePackage(QuestReferenceAlias, LinkedRefPackage, QuestReferenceAlias)

Creates an action that runs a package record whose location or target is the actor's linked reference, with that link set to the reference filling linkedRef.

public ScenePackage(QuestReferenceAlias actor, LinkedRefPackage package, QuestReferenceAlias linkedRef)

Parameters

actor QuestReferenceAlias

The alias whose actor runs the package.

package LinkedRefPackage

The package record and the keyword of its link.

linkedRef QuestReferenceAlias

The alias whose reference the link is set to.

Remarks

The link is set to the reference from the scene's start until it ends, and is then restored to the reference it was set to before.

Exceptions

ArgumentNullException

actor, package, or linkedRef is null.

ScenePackage(QuestReferenceAlias, params IEnumerable<FormId<Package>>)

Creates an action that runs package records.

public ScenePackage(QuestReferenceAlias actor, params IEnumerable<FormId<Package>> packageIds)

Parameters

actor QuestReferenceAlias

The alias whose actor runs the packages.

packageIds IEnumerable<FormId<Package>>

The package records, in the order of the Creation Kit's package list.

Exceptions

ArgumentNullException

actor or packageIds is null.

ArgumentException

packageIds is empty.

Properties

Actor

The alias whose actor runs the package.

public QuestReferenceAlias Actor { get; }

Property Value

QuestReferenceAlias

Destination

The alias whose reference a travel package's actor travels to. The value is null for a package record or another destination.

public QuestReferenceAlias? Destination { get; }

Property Value

QuestReferenceAlias

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

LinkedPackage

The package record whose location or target is a linked reference, with the keyword of that link. The value is null for another package.

public LinkedRefPackage? LinkedPackage { get; }

Property Value

LinkedRefPackage

LinkedRef

The alias whose reference the link of LinkedPackage is set to. The value is null for another package.

public QuestReferenceAlias? LinkedRef { get; }

Property Value

QuestReferenceAlias

LocationDestination

The location alias whose location's world location marker a travel package's actor travels to. The value is null for a package record or another destination.

public QuestLocationAlias? LocationDestination { get; }

Property Value

QuestLocationAlias

PackageIds

The package records. A travel package has none.

public IReadOnlyList<FormId<Package>> PackageIds { get; }

Property Value

IReadOnlyList<FormId<Package>>

Radius

The distance from the destination at which a travel package's actor has arrived.

public uint Radius { get; }

Property Value

uint

Speed

The speed a travel package's actor travels at. A null value selects the package's default.

public PACKAGE_DATA.PreferredSpeed? Speed { get; }

Property Value

PACKAGE_DATA.PreferredSpeed?

Methods

Equals(SceneAction?)

public override sealed bool Equals(SceneAction? other)

Parameters

other SceneAction

Returns

bool

Equals(ScenePackage?)

public bool Equals(ScenePackage? other)

Parameters

other ScenePackage

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Travel(QuestReferenceAlias, QuestLocationAlias, uint, PreferredSpeed?)

Creates an action that runs a travel package, whose location is within radius units of the world location marker of the location filling destination.

public static ScenePackage Travel(QuestReferenceAlias actor, QuestLocationAlias destination, uint radius, PACKAGE_DATA.PreferredSpeed? speed = null)

Parameters

actor QuestReferenceAlias

The alias whose actor travels.

destination QuestLocationAlias

The location alias whose location's world location marker the actor travels to.

radius uint

The distance from the marker at which the actor has arrived.

speed PACKAGE_DATA.PreferredSpeed?

The speed the actor travels at. A null value selects the package's default.

Returns

ScenePackage

Exceptions

ArgumentNullException

actor or destination is null.

Travel(QuestReferenceAlias, QuestReferenceAlias, uint, PreferredSpeed?)

Creates an action that runs a travel package whose location is within radius units of the reference filling destination.

public static ScenePackage Travel(QuestReferenceAlias actor, QuestReferenceAlias destination, uint radius, PACKAGE_DATA.PreferredSpeed? speed = null)

Parameters

actor QuestReferenceAlias

The alias whose actor travels.

destination QuestReferenceAlias

The alias whose reference the actor travels to.

radius uint

The distance from the reference at which the actor has arrived.

speed PACKAGE_DATA.PreferredSpeed?

The speed the actor travels at. A null value selects the package's default.

Returns

ScenePackage

Remarks

An actor does not reliably reach a load door as the destination. To travel to a position, fill the destination with a marker CreateMarker(NiPoint3) creates.

Exceptions

ArgumentNullException

actor or destination is null.

TravelToPlayer(QuestReferenceAlias, uint, PreferredSpeed?)

Creates an action that runs a travel package whose location is within radius units of the player.

public static ScenePackage TravelToPlayer(QuestReferenceAlias actor, uint radius, PACKAGE_DATA.PreferredSpeed? speed = null)

Parameters

actor QuestReferenceAlias

The alias whose actor travels.

radius uint

The distance from the player at which the actor has arrived.

speed PACKAGE_DATA.PreferredSpeed?

The speed the actor travels at. A null value selects the package's default.

Returns

ScenePackage

Exceptions

ArgumentNullException

actor is null.

Operators

operator ==(ScenePackage?, ScenePackage?)

public static bool operator ==(ScenePackage? left, ScenePackage? right)

Parameters

left ScenePackage
right ScenePackage

Returns

bool

operator !=(ScenePackage?, ScenePackage?)

public static bool operator !=(ScenePackage? left, ScenePackage? right)

Parameters

left ScenePackage
right ScenePackage

Returns

bool