## Capture scenario for the tutorial (A12): the real ClientSession playing the tutorial ## offline, driven by its scripted player (TutorialPilot) until `step` begins, then held ## there so the HUD's tutorial card shows that step's instruction and progress. ## ## Stages: move (just landed), build (build mode on, the ghost showing) and tide (the ## last step, with the tide post and the line to beat). extends Node3D const DT: float = 1.0 / Tuning.TICK_RATE_HZ const LIMIT_FRAMES: int = 300 * Tuning.TICK_RATE_HZ @export var step: String = "move" @export var match_seed: int = 3 var _session: ClientSession func _ready() -> void: _session = ClientSession.new() _session.input.autoplay = true _session.play_tutorial(match_seed) add_child(_session) _session.set_process(false) var wanted: int = Tutorial.STEP_NAMES.find(step) var frames: int = 0 while frames < LIMIT_FRAMES and _session.tutorial.step < wanted: _session.pump(DT) frames += 1 if _session.tutorial.step != wanted: push_error("tutorial capture: never reached step '%s' (stopped at '%s')" % [step, _session.tutorial.step_name()]) return # A moment into the step: long enough for build mode to come on, too short for the # script to finish it. for _frame: int in 6: _session.pump(DT) if _session.tutorial.step != wanted: push_error("tutorial capture: step '%s' was over before the picture" % step) return _session.input.map_open = false _session.input.buttons = 0 _session.hud.show_state(_session.hud_state()) _session.view.settle() _session._show_charts(DT) _session.tutorial_card.show_tutorial(_session.tutorial, true) func _process(_delta: float) -> void: # The session is held still; only the card is laid out again as its labels settle. if _session != null and _session.tutorial_card != null: _session.tutorial_card.show_tutorial(_session.tutorial, true)