Skip to content

Commit 498d35a

Browse files
committed
Update match and condition node docs
1 parent 8cff45e commit 498d35a

18 files changed

+256
-122
lines changed

docs/latest/getting-started/create-condition-node.md

Lines changed: 35 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ description: |
33
Create a Condition Node
44
---
55

6-
<!-- TODO: add Parley examples folder -->
7-
<!-- TODO: redo screenshots as they will be out of date now -->
8-
96
Condition Nodes can be used to conditionally direct users down different
107
dialogue branches or even conditionally render options. They are designed to be
118
infinitely nested in theory and you can find all sorts of Dialogue Sequence
@@ -25,61 +22,38 @@ folder.
2522

2623
## Instructions
2724

28-
- Create a Condition Node using the `Insert` dropdown:
29-
30-
![Create Condition Node](../../../www/static/docs/create-condition-node/create-condition-node-button.png)
31-
32-
- Click on the created Condition Node in the graph view to open up the Condition
33-
Node Editor:
34-
35-
![Condition Node Editor](../../../www/static/docs/create-condition-node/condition-node-editor.png)
36-
37-
- Enter a high-level descriptive name for what the Condition Node represents.
38-
This is because it can be sometimes hard to work out what conditions are doing
39-
so the more info you can provide up front the better!
40-
41-
![Condition Node Editor Description](../../../www/static/docs/create-condition-node/condition-node-editor-description.png)
42-
43-
- Now choose a combiner for all of your conditions. Here we will choose `All`
44-
which means that all of the conditions have to pass in order for the Condition
45-
Node to be `true`.
46-
47-
![Condition Node Editor Combiner](../../../www/static/docs/create-condition-node/condition-node-editor-combiner.png)
48-
49-
- Next up is to define the conditions for the combiner. Click `Add Condition`.
50-
During the running of a dialogue sequence, each condition will be evaluated in
51-
turn and sent to the combiner to calculate whether the Condition Node is
52-
truthy (or not). Note, you create more than one condition for the combiner.
53-
54-
![Condition Node Editor Add Condition](../../../www/static/docs/create-condition-node/condition-node-editor-add-condition.png)
55-
56-
- Select a fact using the dropdown. In this case, we will select the
57-
`Alice gave coffee` fact. Facts are manually defined scripts that execute when
58-
a condition is evaluated and return a value to be checked later in the
59-
condition.
60-
61-
![Condition Node Editor Select Fact](../../../www/static/docs/create-condition-node/condition-node-editor-select-fact.png)
62-
63-
- Next, choose an operator. Here, we will use the `Equal` operator. This will be
64-
used to compare the result of the fact against a defined value (coming next!).
65-
66-
![Condition Node Editor Select Operator](../../../www/static/docs/create-condition-node/condition-node-editor-select-operator.png)
67-
68-
<!-- TODO: update the coercion note when this is finalised. -->
69-
70-
- Finally, choose a value to compare with. Here we set the value to `true`.
71-
Please note, Parley does perform a basic level of coercion so in this case,
72-
this will be a GDScript `bool`.
73-
74-
![Condition Node Editor Define Value](../../../www/static/docs/create-condition-node/condition-node-editor-define-value.png)
75-
76-
- Click the `Save` button in the Parley editor and there we have it! Our first
77-
Condition Node. Now connect this Node up with other Nodes (here, we define a
78-
basic setup for each possible input and output of the Condition Node):
79-
80-
![Define other Nodes](../../../www/static/docs/create-condition-node/define-other-nodes.png)
81-
82-
- You can test out your Dialogue Sequence by clicking the Test Dialogue Sequence
83-
from start button:
84-
85-
![Test Dialogue Sequence](../../../www/static/docs/create-condition-node/test-dialogue-sequence.png)
25+
![Create a Condition Node](../../../www/static/docs/create-condition-node/create-condition-node.gif)
26+
27+
1. Create a Condition Node using the `Insert` dropdown.
28+
2. Click on the created Condition Node in the graph view to open up the
29+
Condition Node Editor.
30+
3. Enter a high-level descriptive name for what the Condition Node represents.
31+
This is because it can be sometimes hard to work out what conditions are
32+
doing so the more info you can provide up front the better! In this example,
33+
we write: `Alice gave coffee`.
34+
4. Now choose a combiner for all of your conditions. Here we will choose `All`
35+
which means that all of the conditions have to pass in order for the
36+
Condition Node to be `true`.
37+
5. Next up is to define the conditions for the combiner. Click `Add Condition`.
38+
During the running of a dialogue sequence, each condition will be evaluated
39+
in turn and sent to the combiner to calculate whether the Condition Node is
40+
truthy (or not). Note, you create more than one condition for the combiner.
41+
6. Select a fact using the dropdown. In this case, we will select the
42+
`Alice gave coffee` fact. Facts are manually defined scripts that execute
43+
when a condition is evaluated and return a value to be checked later in the
44+
condition.
45+
46+
> [tip]: You can click on the pencil icon to the right of the Fact to view the
47+
> selected fact in the Godot GDScript editor and optionally edit it.
48+
49+
7. Next, choose an operator. Here, we will use the `Equal` operator. This will
50+
be used to compare the result of the fact against a defined value (coming
51+
next!).
52+
8. Finally, choose a value to compare with. Here we set the value to `true`.
53+
Please note, Parley does perform a basic level of coercion so in this case,
54+
this will be a GDScript `bool`.
55+
9. Click the `Save` button in the Parley editor and there we have it! Our first
56+
Condition Node. Now connect this Node up with other Nodes (here, we define a
57+
basic setup for each possible input and output of the Condition Node).
58+
10. You can test out your Dialogue Sequence by clicking the Test Dialogue
59+
Sequence from start button.

docs/latest/getting-started/create-end-node.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ description: |
33
Create an End Node
44
---
55

6-
<!-- TODO: add Parley examples folder -->
7-
86
An End Node defines the end of the Dialogue Sequence. Although Dialogue
97
Sequences do not require the presence of End Nodes to end a running Dialogue
108
Sequence, it is recommended to do so to make it clear to the Dialogue Sequence

docs/latest/getting-started/create-match-node.md

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ description: |
33
Create a Match Node
44
---
55

6-
<!-- TODO: add Parley examples folder -->
7-
86
A Match Node is useful for selecting the next node based on the well-known value
97
of a variable or expression. You can find all sorts of Dialogue Sequence
108
examples in the Parley
@@ -23,41 +21,27 @@ folder.
2321

2422
## Instructions
2523

26-
- Create a Match Node using the `Insert` dropdown:
27-
28-
![Create Match Node](../../../www/static/docs/create-match-node/create-match-node-button.png)
29-
30-
- Click on the created Match Node in the graph view to open up the Match Node
31-
Editor:
32-
33-
![Match Node Editor](../../../www/static/docs/create-match-node/match-node-editor.png)
34-
35-
- Enter a high-level descriptive name for what the Match Node represents. This
36-
is because it can be sometimes hard to work out what matches are doing so the
37-
more info you can provide up front the better!
38-
39-
![Match Node Editor Description](../../../www/static/docs/create-match-node/match-node-editor-description.png)
40-
41-
- Select a fact using the dropdown. In this case, we will select the
42-
`Snooker balls` fact. Facts are manually defined scripts that execute when a
43-
match is evaluated and return a value to be checked later in the match. These
44-
also define well-known values that are used to select against.
45-
46-
![Match Node Editor Select Fact](../../../www/static/docs/create-match-node/match-node-editor-select-fact.png)
47-
48-
- Now choose your cases you want to select against. Here we will choose all of
49-
the available cases including the fallback case. This means that even if we
50-
don't select on a case, the fallback will be chosen as the next path.
51-
52-
![Match Node Editor Cases](../../../www/static/docs/create-match-node/match-node-editor-cases.png)
53-
54-
- Click the `Save` button in the Parley editor and there we have it! Our first
55-
Match Node. Now connect this Node up with other Nodes (here, we define a basic
56-
setup for each possible input and output of the Match Node):
57-
58-
![Define other Nodes](../../../www/static/docs/create-match-node/define-other-nodes.png)
59-
60-
- You can test out your Dialogue Sequence by clicking the Test Dialogue Sequence
61-
from start button:
62-
63-
![Test Dialogue Sequence](../../../www/static/docs/create-match-node/test-dialogue-sequence.png)
24+
![Create a Match Node](../../../www/static/docs/create-match-node/create-match-node.gif)
25+
26+
1. Create a Match Node using the `Insert` dropdown.
27+
2. Click on the created Match Node in the graph view to open up the Match Node
28+
Editor.
29+
3. Enter a high-level descriptive name for what the Match Node represents. This
30+
is because it can be sometimes hard to work out what matches are doing so the
31+
more info you can provide up front the better! In this example, we write:
32+
`Alice coffee status`.
33+
4. Select a fact using the dropdown. In this case, we will select the
34+
`Snooker balls` fact. Facts are manually defined scripts that execute when a
35+
match is evaluated and return a value to be checked later in the match. These
36+
also define well-known values that are used to select against.
37+
38+
> [tip]: You can click on the pencil icon to the right of the Fact to view the
39+
> selected fact in the Godot GDScript editor and optionally edit it.
40+
41+
5. Now choose your cases you want to select against. Here we will choose all of
42+
the available cases including the fallback case. This means that even if we
43+
don't select on a case, the fallback will be chosen as the next path.
44+
6. Click the `Save` button in the Parley editor and there we have it! Our first
45+
Match Node.
46+
7. You can test out your Dialogue Sequence by clicking the Test Dialogue
47+
Sequence from start button.

examples/create-condition-basic.ds

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
{
2929
"id": "node:5",
3030
"type": "CONDITION",
31-
"position": "(900.0, 400.0)",
32-
"description": "Did Alice give coffee",
31+
"position": "(920.0, 340.0)",
32+
"description": "Alice gave a coffee",
3333
"combiner": "ALL",
3434
"conditions": [
3535
{
@@ -42,46 +42,46 @@
4242
],
4343
"edges": [
4444
{
45-
"id": "edge:1",
46-
"from_node": "node:1",
45+
"id": "edge:4",
46+
"from_node": "node:4",
4747
"from_slot": 0,
48-
"to_node": "node:5",
48+
"to_node": "node:2",
4949
"to_slot": 0,
5050
"should_override_colour": false,
5151
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
5252
},
5353
{
54-
"id": "edge:2",
55-
"from_node": "node:5",
54+
"id": "edge:5",
55+
"from_node": "node:3",
5656
"from_slot": 0,
57-
"to_node": "node:4",
57+
"to_node": "node:2",
5858
"to_slot": 0,
5959
"should_override_colour": false,
6060
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
6161
},
6262
{
63-
"id": "edge:3",
64-
"from_node": "node:5",
65-
"from_slot": 1,
66-
"to_node": "node:3",
63+
"id": "edge:6",
64+
"from_node": "node:1",
65+
"from_slot": 0,
66+
"to_node": "node:5",
6767
"to_slot": 0,
6868
"should_override_colour": false,
6969
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
7070
},
7171
{
72-
"id": "edge:4",
73-
"from_node": "node:4",
72+
"id": "edge:7",
73+
"from_node": "node:5",
7474
"from_slot": 0,
75-
"to_node": "node:2",
75+
"to_node": "node:4",
7676
"to_slot": 0,
7777
"should_override_colour": false,
7878
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
7979
},
8080
{
81-
"id": "edge:5",
82-
"from_node": "node:3",
83-
"from_slot": 0,
84-
"to_node": "node:2",
81+
"id": "edge:8",
82+
"from_node": "node:5",
83+
"from_slot": 1,
84+
"to_node": "node:3",
8585
"to_slot": 0,
8686
"should_override_colour": false,
8787
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"

0 commit comments

Comments
 (0)