# YarnCheck Compiles and plays the project's Yarn scripts from the terminal, without opening Unity. It uses the Yarn Spinner assemblies that ship inside `NightclubArcadia/Packages/dev.yarnspinner.unity/Runtime/DLLs`, so it always compiles against the exact compiler and virtual machine the game runs — not a NuGet copy that could drift. ## Why The EditMode suite lints Yarn *source* with regexes (`CandidateYarnLintTests`). This runs the compiled program instead, which catches a different class of bug: a branch that can never be reached because a flag was written earlier in the same node, a detour chain that never returns, a menu that recurses instead of looping. Those are invisible to a source lint and expensive to find by playtesting. ## Usage ``` cd tools/YarnCheck # compile everything; exit code 1 and diagnostics on failure dotnet run -- ../../NightclubArcadia/Assets/Dialogue # compile, then play a node, choosing option 0, then 0, then 3 dotnet run -- ../../NightclubArcadia/Assets/Dialogue Chair_Interaction 0 0 3 ``` Picks are consumed as the run needs them. Leftover picks start the node again — that models the player walking away and coming back, which is how these scenes are actually played: ``` # ask the bartender questions, leave, return, and order a drink dotnet run -- ../../NightclubArcadia/Assets/Dialogue Bartender_Talk 2 2 0 0 ``` Output is the line / command / node-enter / node-exit trace, the options at each choice, and every declared variable's final value. ## What it does not model - **Unity commands are printed, not executed.** `<>`, `<>` and `<>` are stepped over, so `$check_result` stays `false` and any check-gated branch shows its failure side. Read traces with that in mind. - **Yarn functions are stubbed** in `ProjectLibrary()`: `top_skill` mirrors the real tie behaviour (first argument wins), `alias_name` returns an obvious placeholder, `skill_rank` returns 0. If a shipping function's behaviour changes in a way that steers dialogue, update the stub to match. - **Variables start from their `<>` defaults** every run. There is no save state. ## Requirements .NET 9 SDK. Bump `` in `YarnCheck.csproj` if you move to another version.