|
| 1 | +--- |
| 2 | +description: | |
| 3 | + Create an Action Node |
| 4 | +--- |
| 5 | + |
| 6 | +An Action Node gives the ability to execute functionality during the processing |
| 7 | +of a Dialogue Sequence. For example, emitting a signal, registering a journal |
| 8 | +entry, or updating state. You can find all sorts of Dialogue Sequence examples |
| 9 | +in the Parley |
| 10 | +[`examples`](https://github.com/bisterix-studio/parley/tree/main/examples) |
| 11 | +folder. |
| 12 | + |
| 13 | +## Pre-requisites |
| 14 | + |
| 15 | +- Ensure you have familiarised yourself with the |
| 16 | + [Action Node](../nodes/action-node.md) docs. |
| 17 | +- Parley is installed and running in your Godot Editor. |
| 18 | +- You have followed the [instructions](./register-action.md) to add the relevant |
| 19 | + actions to the system. |
| 20 | +- You have created a basic Dialogue Sequence before. Consult the |
| 21 | + [getting started guide](./create-dialogue-sequence.md) for more info. |
| 22 | + |
| 23 | +## Instructions |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +1. Create an Action Node using the `Insert` dropdown. |
| 28 | +2. Click on the created Action Node in the graph view to open up the Action Node |
| 29 | + Editor. |
| 30 | +3. Enter a high-level descriptive name for what the Action Node represents. This |
| 31 | + is because it can be sometimes hard to work out what actions are doing so the |
| 32 | + more info you can provide up front the better! In this example, we write: |
| 33 | + `Advance time [4h]` |
| 34 | +4. Choose the type of Action you want from the dropdown. In this example, we |
| 35 | + choose: `Script`. |
| 36 | +5. Select the Action you want execute as part of this Node. In this example, we |
| 37 | + choose: `Advance Time`. |
| 38 | + |
| 39 | +> [tip]: You can click on the pencil icon to the right of the Action to view the |
| 40 | +> selected script in the Godot GDScript editor and optionally edit it. |
| 41 | +
|
| 42 | +1. Choose a value to pass to the Action Node. This must be a value understood by |
| 43 | + the underlying script (chosen in the previous step). In this example, we set |
| 44 | + to: `4h`. |
| 45 | +2. Click the `Save` button in the Parley editor and there we have it! Our first |
| 46 | + dialogue sequence with an Action Node. |
| 47 | +3. Now connect this Node up with other Nodes to continue the Dialogue Sequence |
| 48 | + with your awesome game writing! |
| 49 | +4. You can test out your Dialogue Sequence by clicking the Test Dialogue |
| 50 | + Sequence from start button. |
0 commit comments