R10. Directed-opening helper sources
On this page
R10. Directed-opening helper sources
These are the supplied GDScript helpers used by the Clockmaker introduction. Keep their IDs and prepared character/asset data unchanged while matching the demo. Long lines continue at an extra indentation for print; the attached .gd files preserve exact source line breaks.
The small dial, menu and hint scripts are included too. Use the normal GDScript editor, apply each source and save. Some old demo action records say RunVisualScript even when their ID names one of these text scripts; the bundled runtime resolves that shared script call. Preserve the supplied recipe when matching the example.
menu#
Opens the built-in pause/menu screen.
func run(_context: Dictionary = {}) -> Variant:
Runtime.system_menu.show_pause()
return trueturn_one#
Checks numeral I against the winding sequence and advances or resets dial.
func run(_context: Dictionary = {}) -> Variant:
var sequence: Array = [3, 1, 2]
var step: int = int(Runtime.variables.get("dial", 0))
if 1 != sequence[clampi(step, 0, 2)]:
await SetVariable({"name":"dial", "value":0})
await ShowMessage({"text":"A soft click. The winding sequence resets.", "duration":1.3})
return false
step += 1
await SetVariable({"name":"dial", "value":step})
if step == 3:
await HideGUI({"guiId":"dial"})
await RunVisualScript({"scriptId":"ring_bell"})
else:
await ShowMessage({"text":"A clean click. The next turn is ready.","duration":0.8})
return trueturn_two#
Checks numeral II against the winding sequence and advances or resets dial.
func run(_context: Dictionary = {}) -> Variant:
var sequence: Array = [3, 1, 2]
var step: int = int(Runtime.variables.get("dial", 0))
if 2 != sequence[clampi(step, 0, 2)]:
await SetVariable({"name":"dial", "value":0})
await ShowMessage({"text":"A soft click. The winding sequence resets.", "duration":1.3})
return false
step += 1
await SetVariable({"name":"dial", "value":step})
if step == 3:
await HideGUI({"guiId":"dial"})
await RunVisualScript({"scriptId":"ring_bell"})
else:
await ShowMessage({"text":"A clean click. The next turn is ready.","duration":0.8})
return true