Skip to content

Hello Rule

Open Assets/GC2StoryEngine/Examples/Core/Scenes/1_HelloRule.unity.

This is the smallest example. Three Rules share the Greeting category:

Rule Purpose
First Meeting Welcomes the player once
Generic Fallback Provides a repeatable greeting
Annoyed Greeting Uses history and a higher priority to react after repeated fallback greetings

Play, then look underneath

Enter Play Mode and follow the scene's interaction prompts. Notice how the first greeting differs from later ones, and keep interacting to reach the annoyed response.

Open Rule Trace to see which Rule wins each request. Compare its required conditions, priority and score with the other greetings.

Change one line

Leave Play Mode. Open Rule Editor, find one of the greetings and edit the text in its Speak instruction. Save the scene and try it again.

If you changed First Meeting and it does not play, check its recorded history. Reset that Rule's history for a clean first-meeting test.

Try a small variation

Add another repeatable greeting with the same criteria and priority as the fallback, and give it different wording. Watch how equal candidates vary. Repeat avoidance is a preference between otherwise equal candidates, so it does not guarantee that a Rule will never repeat.

When this feels familiar, continue with Rules Playground.