DialogNodeBuilder
One node of a conversation, one method each: what the NPC says, what
the player may answer, and what the node does. Targets gathers the
nodes its choices go to, which start checks.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Values extends DialogValues |
- |
Targets extends string |
never |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DialogNodeBuilder<
Values,Targets>(name,values):DialogNodeBuilder<Values,Targets>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
values |
Values |
Returns
Section titled “Returns”DialogNodeBuilder<Values, Targets>
Methods
Section titled “Methods”choice()
Section titled “choice()”choice<
To>(text,to,choiceOptions?):DialogNodeBuilder<Values,Targets|To>
An answer the player may pick, which goes to the node to.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
To extends string |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
to |
To |
choiceOptions |
ChoiceOptions<Values> |
Returns
Section titled “Returns”DialogNodeBuilder<Values, Targets | To>
do(
action):DialogNodeBuilder<Values,Targets>
Runs action once as the node begins, before its line shows: what a
choice does in the world, such as a purchase.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
action |
(talk) => void |
Returns
Section titled “Returns”DialogNodeBuilder<Values, Targets>
end():
DialogNodeBuilder<Values,Targets>
Ends the conversation on the Interact key once the line shows.
Returns
Section titled “Returns”DialogNodeBuilder<Values, Targets>
say<
Line>(line):DialogNodeBuilder<Values,Targets>
The NPC’s line, with {name} for a value: "Moonleaf, {price} coins.".
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Line extends string |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
line |
CheckedLine<Line, ValueName<Values>> |
Returns
Section titled “Returns”DialogNodeBuilder<Values, Targets>