... | ... | @@ -62,7 +62,7 @@ At the end the player character will be able to talk to our NPC, Mr. Cube and as |
|
|
|
|
|
This setup will make sure that `MrCube` will say his name only the first time the player talks to him.
|
|
|
|
|
|
**Observe** the fact that the node has an icon on its top right corner - that means that it has an `Enter Condition`.
|
|
|
**Observe** the fact that the node has an icon on its top left corner - that means that it has an `Enter Condition`.
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -72,7 +72,7 @@ This setup will make sure that `MrCube` will say his name only the first time th |
|
|
- Set the `Participant Name` to `Player`
|
|
|
- Set the `Text` to `Could you change your color?`
|
|
|
- Add a `End Node` child from `Node 0`
|
|
|
- Make edge from `Node 1` to the newly created Nodes: `Node 2` and `Node 3`
|
|
|
- Make and edge from `Node 1` to the newly created Nodes: `Node 2` and `Node 3`
|
|
|
- On the edges leading to `Node 2` set the `Text` to `Ask him to change his color`
|
|
|
- On the edges leading to `Node 3` set the `Text` to `Leave`
|
|
|
|
... | ... | @@ -90,22 +90,39 @@ This setup will make sure that `MrCube` will say his name only the first time th |
|
|
- Set the `Participant Name` to `MrCube`
|
|
|
- Set the `Text` to `I can't keep changing my color all the time! Just leave me alone!`
|
|
|
|
|
|
This selector node automatically select the first child with satisfied conditions.
|
|
|
**This selector node automatically select the first child with satisfied conditions.**
|
|
|
|
|
|

|
|
|
|
|
|
### h. Add Variable to the NPC **Blueprint**
|
|
|
|
|
|
- Open the `MrCube` NPC **Blueprint**
|
|
|
- Add a new `Variable` named `ColorChangeRequestCount`
|
|
|
- Set the `Type` to `Integer`
|
|
|
- Compile & Save the **Blueprint**
|
|
|
|
|
|

|
|
|
|
|
|
### j. Setup `ColorChangeRequestCount` Condition and Enter Event
|
|
|
|
|
|
- Select the Edge from `Node 4` to `Node 5`
|
|
|
- Add a new `Condition`
|
|
|
- Set the `Condition Type` to `Check Class Int Variable`
|
|
|
- Set the `Participant Name` to `MrCube`
|
|
|
- Set the `Variable Name` to `ColorChangeRequestCount`
|
|
|
- Set the `Operation` to `<= (Is Less Than or Equal To)`
|
|
|
- Set the `Int Value` to `3`
|
|
|
|
|
|
Add the `Selector node` (the aqua one in the image), the two Speech nodes and the End node and place the edges based on the image.
|
|
|
|
|
|
Select the edge with the icon in it and add the condition.
|
|
|
|
|
|
This will check the `ColorChangeRequest` variable (you will have to type it the first time you use it) of the player character.
|
|
|
This will check the `ColorChangeRequestCount` variable (you will have to type it the first time you use it) of the player character.
|
|
|
|
|
|
If it is less than or equal to 3 `Mr. Cube` will be happy to change his color.
|
|
|
|
|
|
If it is less than or equal to 3 Mr. Cube will be happy to change his color.
|
|
|
This selector node automatically select the first child with satisfied conditions - so each time the player asks Mr. Cube to change its color it will either say the text of Node 6 or Node 7 depending on the variable value. The value will be modified by the dialogue in step 12.
|
|
|
|
|
|
This selector node automatically select the first child with satisfied conditions - so each time the player asks Mr. Cube to change its color it will either say the text of Node 6 or Node 7 depending on the variable value. The value will be modified by the dialogue in step
|
|
|
|
|
|
12.
|
|
|

|
|
|
|
|
|
11. Add the three End nodes. Set the edge texts to `Red`, `Green` and `Blue` from left to right. Add an enter event to the three end nodes. The Participant Name and the Event Type should be the same. Set the `Event Name` to `ColorToRed`, `ColorToGreen`, `ColorToBlue` from left to right.
|
... | ... | |