Table of Contents

Class SceneLine

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

A dialogue action of a ScenePhase, in which the actor filling an alias says responses.

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

Constructors

SceneLine(QuestReferenceAlias, params IEnumerable<TopicResponse>)

Creates a line of one variant.

public SceneLine(QuestReferenceAlias speaker, params IEnumerable<TopicResponse> responses)

Parameters

speaker QuestReferenceAlias

The alias whose actor says the line. The quest declares every alias a scene's actions name.

responses IEnumerable<TopicResponse>

The responses, said in order. A string converts to an unvoiced response.

Exceptions

ArgumentNullException

speaker or responses is null.

ArgumentException

responses is empty.

SceneLine(QuestReferenceAlias, IEnumerable<IEnumerable<TopicResponse>>)

Creates a line of which the game says one variant, chosen at random each time the line plays.

public SceneLine(QuestReferenceAlias speaker, IEnumerable<IEnumerable<TopicResponse>> variants)

Parameters

speaker QuestReferenceAlias

The alias whose actor says the line. The quest declares every alias a scene's actions name.

variants IEnumerable<IEnumerable<TopicResponse>>

The variants, each its responses said in order, as in [["Hello."], ["Well met.", "What brings you here?"]].

Exceptions

ArgumentNullException

speaker, variants, or a variant is null.

ArgumentException

variants is empty, or a variant has no response.

SceneLine(QuestReferenceAlias, Func<Actor, IEnumerable<TopicResponse>>)

Creates a line whose responses are computed each time its phase begins.

public SceneLine(QuestReferenceAlias speaker, Func<Actor, IEnumerable<TopicResponse>> responses)

Parameters

speaker QuestReferenceAlias

The alias whose actor says the line. The quest declares every alias a scene's actions name.

responses Func<Actor, IEnumerable<TopicResponse>>

Returns the responses for the speaker it receives, said in order. It is called on the game's thread each time the line's phase begins, after OnPhaseBegin is raised for that phase. The line says nothing where it returns no response, throws, or returns a response whose voice file does not exist. The last two are logged.

Exceptions

ArgumentNullException

speaker or responses is null.

Properties

Condition

Returns whether the line is said. Null means the line is always said.

public Func<QuestScene, bool>? Condition { get; init; }

Property Value

Func<QuestScene, bool>

Remarks

It runs on the game's thread on each frame the scene plays, and the game reads its last result one frame later. An exception from it is logged and counts as false. Of two lines of one speaker in one phase, the first ends as it begins where the condition of the second is false. Two phases, each with one of the lines and a Condition, say the line of the phase whose condition is true.

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

FacesTarget

Whether the speaker turns its body to face the target it looks at.

public bool FacesTarget { get; init; }

Property Value

bool

Remarks

A speaker running a Follow action turns its head only.

IsSaidOnce

Whether each variant is said only once in this save and every later one, until RemoveFromJournalAndReset() resets its quest.

public bool IsSaidOnce { get; init; }

Property Value

bool

Remarks

A random line chooses among the variants not yet said, and a line whose variants have all been said says nothing. The saved state identifies a variant by its scene and its responses' texts, so a changed text is said again.

Exceptions

ArgumentException

The line's responses are computed.

LookTarget

The alias whose actor the speaker looks at while saying the line. The alias is an actor of the scene, so a scene whose alias is not filled with a living, loaded actor ends with ActorUnavailable.

public QuestReferenceAlias? LookTarget { get; init; }

Property Value

QuestReferenceAlias

Exceptions

ArgumentException

LooksAtPlayer is set as well.

LooksAtPlayer

Whether the speaker looks at the player while saying the line.

public bool LooksAtPlayer { get; init; }

Property Value

bool

Exceptions

ArgumentException

LookTarget is set as well.

Loop

The repetition of the line. Null means the line is not repeated.

public SceneLineLoop? Loop { get; init; }

Property Value

SceneLineLoop

Speaker

The alias whose actor says the line.

public QuestReferenceAlias Speaker { get; }

Property Value

QuestReferenceAlias

Remarks

The game shows no subtitle for a line the player says, so the quest shows each response's text as the player's subtitle.

Variants

The variants, each its responses in the order said. A line whose responses are computed has one variant with no response.

public IReadOnlyList<IReadOnlyList<TopicResponse>> Variants { get; }

Property Value

IReadOnlyList<IReadOnlyList<TopicResponse>>

Methods

Equals(SceneAction?)

public override sealed bool Equals(SceneAction? other)

Parameters

other SceneAction

Returns

bool

Equals(SceneLine?)

public bool Equals(SceneLine? other)

Parameters

other SceneLine

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

Operators

operator ==(SceneLine?, SceneLine?)

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

Parameters

left SceneLine
right SceneLine

Returns

bool

operator !=(SceneLine?, SceneLine?)

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

Parameters

left SceneLine
right SceneLine

Returns

bool