Table of Contents

Class ConversationNode

Namespace
SuzerainModdingKit.StoryFragments.Conversation
Assembly
SuzerainModdingKit.dll

A dialogue line or choice in a conversation.

public class ConversationNode
Inheritance
ConversationNode
Inherited Members

Constructors

ConversationNode(ConversationNodeSelector, string, string, CharacterSelector, string, string, string, string)

Creates a new conversation node to override an existing node.

public ConversationNode(ConversationNodeSelector overrideTarget, string name, string text = null, CharacterSelector speakerSelector = null, string luaScript = null, string luaCondition = null, string sequence = null, string menuText = null)

Parameters

overrideTarget ConversationNodeSelector

A selector targeting the node to override.

name string

The unique identifier of the node.

text string

Optional: Override the text of the node.

speakerSelector CharacterSelector

Optional: Override the speaker of the node.

luaScript string

Optional: Override the script of the node.

luaCondition string

Optional: Override the condition of the node.

sequence string

Optional: Override the sequence of the node.

menuText string

Optional: Override the text shown in the options list. Ignored if the node isn't a choice (spoken by the player).

Exceptions

ArgumentException

Thrown if any arguments are invalid.

ArgumentNullException

Thrown if any required arguments are null.

ConversationNode(string, string, IReadOnlyList<ConversationNodeHook>, IReadOnlyList<ConversationNodeSelector>, CharacterSelector, string, string, string, string)

Creates a new custom conversation node.

public ConversationNode(string name, string text = null, IReadOnlyList<ConversationNodeHook> hooks = null, IReadOnlyList<ConversationNodeSelector> nextNodes = null, CharacterSelector speakerSelector = null, string luaScript = null, string luaCondition = null, string sequence = null, string menuText = null)

Parameters

name string

The unique identifier of the node.

text string

Optional: The text of the node.

hooks IReadOnlyList<ConversationNodeHook>

Optional: A list of hooks. Hooks are nodes that this node should attach (or hook) to. Hooks should only be used when trying to link to a node that you don't control (such as a node from vanilla Suzerain or another mod). If you control the node you are trying to hook to, you should add this node to the other node's NextNodes instead.

nextNodes IReadOnlyList<ConversationNodeSelector>

Optional: A list of next node selectors. These are the nodes that will show after this one. Only the first node with a successful condition will show. If the nodes are choices, all choice nodes with successful conditions will show.

speakerSelector CharacterSelector

Optional: The speaker of the line. If null, defaults to the player. If the speaker is the player, it will show up as a choice.

luaScript string

Optional: A Lua script to run when the dialogue is spoken.

luaCondition string

Optional: A Lua condition to determine whether the dialogue should be spoken or not.

sequence string

Optional: Conversation-related actions to perform when this dialogue is spoken. See ConversationNodeSequenceBuilder.

menuText string

The text shown in the options list. Ignored if the node isn't a choice (spoken by the player).

Exceptions

ArgumentException

Thrown if any arguments are invalid.

ArgumentNullException

Thrown if any required arguments are null.

Properties

Hooks

A read-only list of hooks. This is always an empty collection if the node is an override.

public ReadOnlyCollection<ConversationNodeHook> Hooks { get; }

Property Value

ReadOnlyCollection<ConversationNodeHook>

Remarks

Hooks are nodes that this node should attach (or hook) to.

IsOverride

Returns a boolean indicating whether the node is meant to override an existing node. (is OverrideTarget not null?)

public bool IsOverride { get; }

Property Value

bool

LuaCondition

Optional: A Lua condition to determine whether the dialogue should be spoken or not.

public string LuaCondition { get; }

Property Value

string

LuaScript

Optional: A Lua script to run when the dialogue is spoken.

public string LuaScript { get; }

Property Value

string

MenuText

The text shown in the options list. This may be null.

public string MenuText { get; }

Property Value

string

Remarks

The text shown in the options list. Possibly null. If null, the text shown will be the same as Text. If the node isn't a choice (spoken by the player), this property is ignored.

Name

The unique identifier of the node.

public string Name { get; }

Property Value

string

NextNodes

A read-only list of next node selectors. This is always an empty collection if the node is an override.

public ReadOnlyCollection<ConversationNodeSelector> NextNodes { get; }

Property Value

ReadOnlyCollection<ConversationNodeSelector>

Remarks

These are the nodes that will show after this one. Only the first node with a successful condition will show. If the nodes are choices, all choice nodes with successful conditions will show.

OverrideTarget

Optional: A selector targeting a node to override.

public ConversationNodeSelector OverrideTarget { get; }

Property Value

ConversationNodeSelector

Sequence

Optional conversation-related actions to perform when this dialogue is spoken.

public string Sequence { get; }

Property Value

string
See Also

SpeakerSelector

The speaker of the line. This property is optional. If null, defaults to the player. If the speaker is the player, it will show up as a choice.

public CharacterSelector SpeakerSelector { get; }

Property Value

CharacterSelector

Text

The text of the node. This may be null.

public string Text { get; }

Property Value

string