Your first reaction¶
For this first lesson, make one Rule print a greeting in Unity's Console when you enter Play Mode. This gives you a small, reliable result before adding characters, dialogue panels or animations.
You need Game Creator Core and Story Engine. The example scenes and optional Game Creator modules are not required.
1. Make a place for the Rule¶
Open a small test scene. Create an empty GameObject and name it First greeting.
In Add Component, choose Game Creator > Story Engine > Rule. Give the Rule the label Welcome to the village.
Set its Category to FirstLesson. Leave Priority at Normal and Run Mode at One at a time.
2. Give it a condition¶
Under Mandatory Criteria, choose Add Criteria and search for Always True. Add that condition and leave it enabled.
This is a simple way to say, "this Rule is allowed to run." Later, you will replace it with a fact about your game.
An empty Rule does not match
A Rule needs at least one passing, enabled criterion. Leaving both criteria lists empty does not create a fallback.
3. Add a response¶
In the Rule's Instructions list, add Game Creator's Log Text instruction. Enter:
Log Text writes to Unity's Console. It is just a convenient first response. A finished Rule can use other Game Creator instructions to show dialogue, move a character, play a sound or change the world.
4. Ask the Director to choose¶
Create another empty GameObject called Start the story. Add a Game Creator Trigger, set its event to On Start, and add Run Story Director to its instruction list.
Set that instruction's Category to FirstLesson. Leave If Busy at Try Another and Wait For Rule To Finish off.
The category names must match. Global Rules, which have an empty category, can also take part, so use a small test scene without competing global Rules.
Save the scene.
5. Try it¶
Open Window > General > Console, then enter Play Mode. Your greeting should appear once when the Trigger starts.
If it does not, check that both GameObjects are active, the Rule is enabled, and Always True is enabled. Then open Rule Trace to see whether the Director was called and what it found.
6. Make it remember¶
Leave Play Mode. Replace Always True with Rule Has Not Played and choose This Rule in its Rule field.
The greeting is now a first-time response. After it has run, another Director request will need a different matching Rule. You have the beginning of a changing conversation.
Story history can survive a scene reload. For a clean test, use the History tab in Story Insights to reset the relevant Rule's history. Clearing Rule Trace only clears the explanation list.
Where to go next¶
Try the changing greeting recipe to add a returning-visitor response. If you would rather start with dialogue already on screen, open Hello Rule and edit one of its Speak instructions.