Skip to content

Commit 6f20790

Browse files
committed
Add group node and action store docs
1 parent 9f7ff32 commit 6f20790

File tree

15 files changed

+240
-103
lines changed

15 files changed

+240
-103
lines changed

docs/latest/examples/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ raise
99
[a GitHub issue](https://github.com/bisterix-studio/parley/issues/new?category=ideas).
1010

1111
- [Basic Action Node](https://github.com/bisterix-studio/parley/blob/main/examples/create-action-basic.ds)
12+
- [Basic Group Node](https://github.com/bisterix-studio/parley/blob/main/examples/create-group-basic.ds)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ folder.
3939
> [tip]: You can click on the pencil icon to the right of the Action to view the
4040
> selected script in the Godot GDScript editor and optionally edit it.
4141
42-
1. Choose a value to pass to the Action Node. This must be a value understood by
42+
6. Choose a value to pass to the Action Node. This must be a value understood by
4343
the underlying script (chosen in the previous step). In this example, we set
4444
to: `4h`.
45-
2. Click the `Save` button in the Parley editor and there we have it! Our first
45+
7. Click the `Save` button in the Parley editor and there we have it! Our first
4646
dialogue sequence with an Action Node.
47-
3. Now connect this Node up with other Nodes to continue the Dialogue Sequence
47+
8. Now connect this Node up with other Nodes to continue the Dialogue Sequence
4848
with your awesome game writing!
49-
4. You can test out your Dialogue Sequence by clicking the Test Dialogue
49+
9. You can test out your Dialogue Sequence by clicking the Test Dialogue
5050
Sequence from start button.

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,37 @@ description: |
33
Create a Group Node
44
---
55

6-
A Group Node gives the ability to: TODO
6+
As its name suggests, a Group Node gives the ability to group Nodes that fall
7+
within its boundary in the Parley Dialogue Sequence graph view. You can find all
8+
sorts of Dialogue Sequence examples in the Parley
9+
[`examples`](https://github.com/bisterix-studio/parley/tree/main/examples)
10+
folder.
11+
12+
## Pre-requisites
13+
14+
- Ensure you have familiarised yourself with the
15+
[Group Node](../nodes/group-node.md) docs.
16+
- Parley is [installed](./installation.md) and running in your Godot Editor.
17+
- You have created a basic Dialogue Sequence before. Consult the
18+
[getting started guide](./create-dialogue-sequence.md) for more info.
19+
20+
## Instructions
21+
22+
![Create a Group Node](../../../www/static/docs/create-group-node/create-group-node.gif)
23+
24+
1. Create a Group Node using the `Insert` dropdown and resize the created node
25+
accordingly using the resize button in the bottom right of the node.
26+
2. Click on the created Group Node in the graph view to open up the Group Node
27+
Editor.
28+
3. Enter a name for what the Group Node represents. Try and keep it as
29+
descriptive as possible! In this example, we write: `My lovely group`
30+
4. Choose the colour you want for the Group Node using the colour picker until
31+
you get the colour that works for you.
32+
33+
> [tip]: Any node that overlaps with the Group Node will be considered part of
34+
> the Group Node group.
35+
36+
5. Move the Group Node around and note the nodes inside group boundaries moving
37+
with the Group Node.
38+
6. Have a play around by adjusting the size of the Group Node or moving nodes in
39+
and out of the Group Node boundaries to group and ungroup as you see fit!

docs/latest/getting-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ deploy to your game.
99

1010
The documentation assumes you have the latest version of
1111
[Godot](https://godotengine.org/) installed on your system and have also
12-
[installed the Parley plugin](./installation.md).
12+
[installed the Parley plugin](../getting-started/installation.md).

docs/latest/getting-started/installation.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,14 @@ Your settings should look like the following:
7070

7171
![parley-store-paths](../../../www/static/docs/installation/parley-store-paths.png)
7272

73+
<!-- TODO: move up -->
74+
7375
### Activate
7476

7577
1. From the menu choose Project->Project Settings, click the Plugins tab and
76-
activate Gut. Once activated, the GUT Panel will appear at the bottom of your
78+
activate Plugin. Once activated, the Parley will appear at the top of your
7779
editor:
7880

79-
![Gut Panel Location](_static/images/gut_panel_where.png)
80-
81-
### Setup directories for tests
82-
83-
The next few steps cover the suggested configuration. Feel free to deviate where
84-
you see fit.
81+
<!-- TODO: fix -->
8582

86-
1. Create directories to store your tests and test related code (suggested
87-
config)
88-
- `res://test`
89-
- `res://test/unit`
90-
- `res://test/integration`
83+
<!-- ### Setup stores -->

docs/latest/getting-started/register-action.md

Lines changed: 36 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,94 +3,56 @@ description: |
33
Register an Action
44
---
55

6-
TODO
6+
Actions are resources in Parley used to execute defined functionality during the
7+
running of a Dialogue Sequence. For example, an Action could contain
8+
functionality to: emit a signal, register a journal entry, or update state.
79

8-
Actions are resources in Parley used to: TODO.
10+
Actions are stored in an action store which can be configured in the Parley
11+
settings.
912

10-
<!-- For example, one might want to display different dialogue
11-
depending on whether Alice gave a coffee or not.
12-
13-
Facts are stored in a fact store which can be configured in the Parley settings.
14-
15-
In this guide, we will create a fact that can be used to create a Condition Node
16-
in the corresponding
17-
[create a Condition Node guide](./create-condition-node.md).
13+
In this guide, we will create a action that can be used to create an Action Node
14+
in the corresponding [create an Action Node guide](./create-action-node.md).
1815

1916
## Pre-requisites
2017

2118
- Ensure you have familiarised yourself with the
22-
[Condition Node](../nodes/condition-node.md) docs.
19+
[Action Node](../nodes/action-node.md) docs.
2320
- Parley is [installed](./installation.md) and running in your Godot Editor.
2421
- You have created a basic Dialogue Sequence before. Consult the
25-
[getting started guide](./create-dialogue-sequence.md) for more info. -->
26-
27-
<!-- TODO: update when Parley supports creation of Fact -->
28-
29-
<!-- ## Instructions
30-
31-
> **Note:** it is assumed that the default Parley settings are used for the fact
32-
> store and it is stored at: `res://facts/fact_store_main.tres`
22+
[getting started guide](./create-dialogue-sequence.md) for more info.
3323

34-
- Create a Fact script (ensure that it extends the `FactInterface` class) at:
35-
`res://facts/alice_gave_coffee_fact.gd`
24+
## Instructions
3625

37-
```gdscript
38-
extends FactInterface
26+
![Register an Action](../../../www/static/docs/register-action/register-action.gif)
3927

40-
func execute(_ctx: Dictionary, _values: Array) -> bool:
41-
print('Alice did indeed give coffee')
42-
# Note, you can return any value here, it doesn't
43-
# necessarily have to be a bool
44-
return true
45-
```
28+
> [info]: it is assumed that the default Parley settings are used for the fact
29+
> store and it is stored at: `res://facts/fact_store_main.tres`. You can find
30+
> more information on changing the default Parley settings
31+
> [here](../reference/parley-settings.md).
4632
47-
- [OPTIONAL] If the return type of your fact, is **not** of type `bool`, it is
48-
recommended to return well-known values of the fact (for example, when using a
49-
[Match Node](../nodes/match-node.md)). For example:
33+
- Create an Action script (ensure that it extends the `ParleyActionInterface`
34+
class) at: `res://actions/advance_time_action.gd`
5035

5136
```gdscript
52-
extends FactInterface
53-
54-
enum Ball {
55-
RED = 1,
56-
YELLOW = 2,
57-
PINK = 6,
58-
BLUE = 5,
59-
}
37+
extends ParleyActionInterface
6038
61-
func execute(ctx: Dictionary, _values: Array) -> int:
62-
return ctx.get('ball', 0)
63-
64-
func available_values() -> Array[Ball]:
65-
return [
66-
Ball.RED,
67-
Ball.YELLOW,
68-
Ball.PINK,
69-
Ball.BLUE,
70-
]
39+
func execute(_ctx: Dictionary, values: Array) -> int:
40+
print("Advancing time by %s" % [values[0]])
41+
return OK
7142
```
7243

73-
- Open up the inspector for `res://facts/fact_store_main.tres` in the Godot
74-
Editor and click `Add Element`:
75-
76-
![Add Element](../../../www/static/docs/register-fact/add-element.png)
77-
78-
- Then, click the empty element and choose `New Fact`:
79-
80-
![Click Empty Element](../../../www/static/docs/register-fact/click-empty-element.png)
81-
82-
- Now populate the fact ID by using the same element ID (recommended but not
83-
essential) and choose a sensible name for the Fact in the store:
84-
85-
![Populate basic fact data](../../../www/static/docs/register-fact/populate-basic-fact-data.png)
86-
87-
- Then, drag the fact script created earlier to the `<empty>` ref field:
88-
89-
![Drag Fact Script](../../../www/static/docs/register-fact/drag-fact-script.png)
90-
91-
<!-- TODO: change/remove this when supported Parley -->
92-
93-
<!-- - Finally, reload the Godot project and the new fact should be available to use
94-
in Parley!
95-
96-
![Reload Godot Editor](../../../www/static/docs/register-fact/reload-godot-editor.png) -->
44+
1. Open up the `ParleyStores` dock in the Godot Editor and click `Add Action`.
45+
2. Give your new action an ID. In our example, we use: `main:advance_time`.
46+
3. Give your new action a name. In our example, we use: `Advance Time`.
47+
4. Link your created action script with the Action using the resource inspector
48+
(labelled `Ref`).
49+
50+
> [tip]: You can use the resource editors in `ParleyStores` to quickly navigate
51+
> to the relevant resource for editing. You can also add resources using the
52+
> resource editor dropdown field instead of dragging.
53+
54+
5. You should now see that the Action is available in the Action node dropdown
55+
options. Select `Advance Time` in the options to associate it with the
56+
selected Action Node.
57+
6. Test out your new Action within the Dialogue Sequence by clicking the Test
58+
Dialogue Sequence from start button.

docs/latest/nodes/group-node.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
---
22
description: |
3-
A Group Node defines: TODO.
3+
A Group Node gives the ability to group Nodes that fall
4+
within its boundary in the Parley Dialogue Sequence graph view.
45
---
56

6-
A Group Node defines: TODO.
7+
As its name suggests, a Group Node gives the ability to group Nodes that fall
8+
within its boundary in the Parley Dialogue Sequence graph view. This is designed
9+
to aid organisation of large dialogue sequences where nodes that are part of the
10+
same group will be moved when the Group Node moves.
11+
12+
As the description implies, a group node is only applicable during game
13+
development rather than run-time.
14+
15+
![group-node](../../../www/static/docs/group/group-node.png)
16+
17+
They have the following characteristics:
18+
19+
## Name
20+
21+
The name of the Group Node. Try and keep it as descriptive as possible to help
22+
identify what the group represents!
23+
24+
## Colour
25+
26+
The background colour of the Group Node. This helps distinguish different group
27+
nodes from each other.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description: |
3+
Parley settings
4+
---
5+
6+
Parley settings: TODO.

docs/toc.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const toc: RawTableOfContents = {
3535
["create-condition-node", "Create a Condition Node"],
3636
["create-match-node", "Create a Match Node"],
3737
["create-action-node", "Create an Action Node"],
38-
["create-group-node", "Create an Group Node"],
38+
["create-group-node", "Create a Group Node"],
3939
["create-end-node", "Create an End Node"],
4040
["register-fact", "Register a Fact"],
4141
["register-action", "Register an Action"],
@@ -74,6 +74,12 @@ const toc: RawTableOfContents = {
7474
title: "Examples",
7575
pages: [],
7676
},
77+
reference: {
78+
title: "Reference",
79+
pages: [
80+
["parley-settings", "Parley settings"],
81+
],
82+
},
7783
},
7884
},
7985
};

examples/create-group-basic.ds

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"title": "",
3+
"nodes": [
4+
{
5+
"id": "node:1",
6+
"type": "START",
7+
"position": "(2060.0, 1747.0)"
8+
},
9+
{
10+
"id": "node:2",
11+
"type": "DIALOGUE",
12+
"position": "(2440.0, 1700.0)",
13+
"character": "uid://ceouii84qmu0w::alice",
14+
"text": "Hello"
15+
},
16+
{
17+
"id": "node:3",
18+
"type": "DIALOGUE",
19+
"position": "(2960.0, 1700.0)",
20+
"character": "uid://ceouii84qmu0w::bob",
21+
"text": "Hey"
22+
},
23+
{
24+
"id": "node:4",
25+
"type": "DIALOGUE",
26+
"position": "(3480.0, 1700.0)",
27+
"character": "uid://ceouii84qmu0w::carol",
28+
"text": "Hi"
29+
},
30+
{
31+
"id": "node:5",
32+
"type": "END",
33+
"position": "(4020.0, 1740.0)"
34+
},
35+
{
36+
"id": "node:6",
37+
"type": "GROUP",
38+
"position": "(2340.0, 1580.0)",
39+
"name": "My lovely group",
40+
"node_ids": [
41+
"node:2",
42+
"node:3",
43+
"node:4"
44+
],
45+
"colour": "(0.5377, 0.653, 0.7188, 1.0)",
46+
"size": "(1580.0, 580.0)"
47+
}
48+
],
49+
"edges": [
50+
{
51+
"id": "edge:1",
52+
"from_node": "node:1",
53+
"from_slot": 0,
54+
"to_node": "node:2",
55+
"to_slot": 0,
56+
"should_override_colour": false,
57+
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
58+
},
59+
{
60+
"id": "edge:2",
61+
"from_node": "node:2",
62+
"from_slot": 0,
63+
"to_node": "node:3",
64+
"to_slot": 0,
65+
"should_override_colour": false,
66+
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
67+
},
68+
{
69+
"id": "edge:3",
70+
"from_node": "node:3",
71+
"from_slot": 0,
72+
"to_node": "node:4",
73+
"to_slot": 0,
74+
"should_override_colour": false,
75+
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
76+
},
77+
{
78+
"id": "edge:4",
79+
"from_node": "node:4",
80+
"from_slot": 0,
81+
"to_node": "node:5",
82+
"to_slot": 0,
83+
"should_override_colour": false,
84+
"colour_override": "(0.4118, 0.4118, 0.4118, 1.0)"
85+
}
86+
],
87+
"stores": {
88+
"character": [],
89+
"fact": []
90+
}
91+
}

0 commit comments

Comments
 (0)