A greeting that changes¶
Build a guard who meets the player once, recognizes them later and remembers a favor.
This recipe describes the Rules and their facts. Use the dialogue presentation you already have. In the Core examples, Speak provides a simple speech balloon; in your own project, choose the appropriate Game Creator instructions for your dialogue setup.
Prepare the interaction¶
Use Guard/Greeting as the category on each Rule and on the interaction's Run Story Director instruction.
Create a saved game variable called HelpedGuard, initially false. Set it to true when the player performs the favor. Story Engine will read that fact; it does not decide what counts as helping.
For each Rule below, keep Priority at Normal and Run Mode at One at a time.
Rule 1: First meeting¶
Mandatory Criteria
- Rule Has Not Played: This Rule
Response
New face, eh? Keep to the main road until you know your way around.
The response's first selection records the meeting in story history.
Rule 2: A familiar face¶
Mandatory Criteria
- Rule Has Played: First meeting
Response
Back already? You know the way. Mind the carts by the well.
This is the ordinary returning-visitor response. It can repeat.
Rule 3: An old debt¶
Mandatory Criteria
- Rule Has Played: First meeting
- Game Creator variable check:
HelpedGuardis true
Response
There you are. I told them what you did for us. You are welcome here.
When the player has helped, this Rule scores two points. The familiar-face Rule scores one. With both at Normal priority, the more specific response wins.
The help check is mandatory because the line would be untrue without it.
Try the three moments¶
| Test | Expected response |
|---|---|
| Reset the meeting's history and leave HelpedGuard false | First meeting |
| Interact again | A familiar face |
| Set HelpedGuard true and interact | An old debt |
Keep Rule Trace open while you try them. If a global Rule wins instead, check its criteria and priority.
To make the special thanks happen only once, add Rule Has Not Played: This Rule to An old debt. Later visits will return to the ordinary greeting. To create several equally suitable returning lines, duplicate the familiar-face Rule and change the wording.