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
speakerQuestReferenceAliasThe alias whose actor says the line. The quest declares every alias a scene's actions name.
responsesIEnumerable<TopicResponse>The responses, said in order. A string converts to an unvoiced response.
Exceptions
- ArgumentNullException
speakerorresponsesisnull.- ArgumentException
responsesis 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
speakerQuestReferenceAliasThe alias whose actor says the line. The quest declares every alias a scene's actions name.
variantsIEnumerable<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 isnull.- ArgumentException
variantsis 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
speakerQuestReferenceAliasThe alias whose actor says the line. The quest declares every alias a scene's actions name.
responsesFunc<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
speakerorresponsesisnull.
Properties
Condition
Returns whether the line is said. Null means the line is always said.
public Func<QuestScene, bool>? Condition { get; init; }
Property Value
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
FacesTarget
Whether the speaker turns its body to face the target it looks at.
public bool FacesTarget { get; init; }
Property Value
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
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
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
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
Speaker
The alias whose actor says the line.
public QuestReferenceAlias Speaker { get; }
Property Value
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
Methods
Equals(SceneAction?)
public override sealed bool Equals(SceneAction? other)
Parameters
otherSceneAction
Returns
Equals(SceneLine?)
public bool Equals(SceneLine? other)
Parameters
otherSceneLine
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(SceneLine?, SceneLine?)
public static bool operator ==(SceneLine? left, SceneLine? right)
Parameters
Returns
operator !=(SceneLine?, SceneLine?)
public static bool operator !=(SceneLine? left, SceneLine? right)