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
overrideTargetConversationNodeSelectorA selector targeting the node to override.
namestringThe unique identifier of the node.
textstringOptional: Override the text of the node.
speakerSelectorCharacterSelectorOptional: Override the speaker of the node.
luaScriptstringOptional: Override the script of the node.
luaConditionstringOptional: Override the condition of the node.
sequencestringOptional: Override the sequence of the node.
menuTextstringOptional: 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
namestringThe unique identifier of the node.
textstringOptional: The text of the node.
hooksIReadOnlyList<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
NextNodesinstead.nextNodesIReadOnlyList<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.
speakerSelectorCharacterSelectorOptional: The speaker of the line. If null, defaults to the player. If the speaker is the player, it will show up as a choice.
luaScriptstringOptional: A Lua script to run when the dialogue is spoken.
luaConditionstringOptional: A Lua condition to determine whether the dialogue should be spoken or not.
sequencestringOptional: Conversation-related actions to perform when this dialogue is spoken. See ConversationNodeSequenceBuilder.
menuTextstringThe 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
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
LuaCondition
Optional: A Lua condition to determine whether the dialogue should be spoken or not.
public string LuaCondition { get; }
Property Value
LuaScript
Optional: A Lua script to run when the dialogue is spoken.
public string LuaScript { get; }
Property Value
MenuText
The text shown in the options list. This may be null.
public string MenuText { get; }
Property Value
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
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
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
Sequence
Optional conversation-related actions to perform when this dialogue is spoken.
public string Sequence { get; }
Property Value
- 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
Text
The text of the node. This may be null.
public string Text { get; }