Skip to content

Choreograph v1.0.0 - #2297

Open
KenanMillet wants to merge 49 commits into
Roll20:masterfrom
KenanMillet:Choreograph-v1.0.0
Open

Choreograph v1.0.0#2297
KenanMillet wants to merge 49 commits into
Roll20:masterfrom
KenanMillet:Choreograph-v1.0.0

Conversation

@KenanMillet

Copy link
Copy Markdown
Contributor

Choreograph 1.0.0: Meta-Sequencer for Token Effects

Summary

Initial public release of Choreograph — a meta-sequencer that orchestrates effects across groups of tokens by defining scenes in handouts. Scenes specify who gets affected (filters), when they fire (delay expressions), and what happens (command templates). Choreograph doesn't animate anything itself; it schedules other scripts.

What's Included

Core engine:

  • Scene handout system (parameters, variables, scene table with Filter/Delay/When/Command/Notes)
  • Token filtering: *, role=X, name=X*, layer=X, status=X, !negation, boolean expressions
  • Per-token delay expressions: stagger(), propagate(), distance(), rank(), rand(), wave()
  • Command templates with ${expr} substitution (full JS evaluation)
  • Cast system with named roles, stored in [Cast] handouts
  • Scene chaining and recursion with depth limiting
  • Looping (--loop, --loop N, --loop N --sync)
  • Sync barriers (wait for child scenes/animations to finish)
  • When column for conditional row execution
  • Required parameter validation

Built-in commands:

  • Scene management: new, list, edit, delete, refresh, add-row
  • Playback: run, stop, pause, resume, status
  • FX: unified fx command (auto-detects spawnFx vs spawnFxBetweenPoints, supports token IDs, coordinates, or selected tokens, resolves custom FX by name)
  • Cast: cast add/remove/list/show/delete

Interactive tutorials (6 guided walkthroughs):

  • Your First Scene, Roles & Casts, Filters & Delay, Variables & Templates, Looping & When, Chaining & Recursion
  • Progressive series building a ritual summoning scene with real FX

Extension API:

  • registerFunction, registerTokenVariable, registerConstant, registerParameterType
  • registerLifecycleHook, registerSyncParticipant
  • onSceneStart / onSceneFinish signals
  • waitForScene() helper for ScriptKit guides

Dependencies

  • SelectManager (required)
  • ScriptKit (required — framework for help, examples, tutorials)
  • Sequence (recommended — animation playback)

Tested

  • All 6 tutorials tested end-to-end
  • Scene chaining with sync barriers (parent waits for looping child to finish)
  • FX command with prefab types, token IDs, coordinates, and custom FX
  • Required parameter validation (abort with error)
  • Cast role-based filtering in actors(), role(), cast()

…me:/desc: filters, tiered sorting, bold highlights
…wizard with auto/interactive steps, role assignment, and replayable via !choreograph guide
…ne-barrage example, fix replay --cast, fix null crash, quote-strip filters
…, suppress child scene cards, fix step numbering
…ample

- Add 'when' column to scene table (generateSceneHtml + parser)
- Add evalExpr() for general-purpose variable evaluation (preserves any type)
- Fix --role regex to not capture --flags as IDs (negative lookahead)
- Chain-lightning example: recursive beam using when + --role + cast().without()
- Remove debug logs
- Add roles array to scene struct with min/max enforcement
- Roles table in handout HTML + parser
- Pre-run validation: error if role under min
- Max enforcement: trim to last N after scene load
- --cast + --role merge (no longer mutually exclusive)
- mergeRoleFlags helper with negative-lookahead regex
- Guide steps inherit min/max from scene.roles
- role(name) / role_ids(name) shorthand for cast/cast_ids with role filter
- Examples updated to use role() and declare scene.roles
- Auto-generate param steps in guide (token/path = selection, others = ?{} queries)
- CSV-style array parser for comma-separated param values
- parseCSV utility (splits on commas, respects double-quoted segments)
- Store param values on guide state, append as --flags in synthetic run
- Fix child status card: use runtimeOpts.parent for suppression
- Add 'parent' to knownFlags (prevents leaking as scene param)
… enriched

- Move itemId + enrichArray out of buildTokenScope to module level
- token[] params resolved as enriched arrays (supports .select/.without/.first etc)
- path[] params also enriched
- Guide triggers for scenes with promptable params (even if no manual guide steps)
- Restore chain-lightning example, remove debug logs
…bounced handout regen, remove internal guide/example system (use ScriptKit)
…ration completeness (missing commands, versions, items)
Add six progressive ScriptKit tutorials building a ritual summoning scene:
your-first-scene, roles-and-casts, filters-and-delay, variables-and-templates,
looping-and-sync, chaining-and-recursion.

Remove !choreograph ping command (sendPing dropped from globals).
- Add section headers (Parameters, Variables, Scene) above each table
- Add empty row to Variables table so it renders as a proper table
- Skip entirely empty rows during parse (prevents phantom entries)
- Use <br> in empty cells to prevent row collapse in Roll20 renderer
… card

- Add signal/slot system: Choreograph.onSceneStart(fn) and Choreograph.onSceneFinish(fn)
  Both return unsubscribe functions. Listeners receive { name, instanceId, cast, params }.
- Delay completion card by 500ms so it doesn't step on the last command output
- Use signals in tutorial step 6 to auto-advance after scene finishes
  (replaces polling approach)
- Add Choreograph.waitForScene(name) public helper (signal-based, replaces polling)
- Replace all inline onSceneStart/onSceneFinish blocks with ...waitForScene()
- filters-and-delay: use explode-death FX instead of broken emoji echo
- filters-and-delay: convert step 7 to raw HTML, focus on demonstrated concepts
- filters-and-delay: add dynamic help handout links with anchors
- your-first-scene: require min 4 tokens selected (ScriptKit select gate)
- Fix duplicate closing brace syntax error in roles-and-casts
- Fix actors() and actor_ids() to use params.__ctx.castData for role-based filtering
- variables-and-templates: use role() shorthand instead of actors()
- variables-and-templates: step 6 waits for scene finish
- filters-and-delay: fix step 7 help handout links (dynamic ID lookup)
- fx command: accept single token ID as alternative to x/y coordinates
- fxbetween command: accept two token IDs as alternative to coordinate pairs
- variables-and-templates: use breath-fire FX instead of echo commands
- variables-and-templates: add sacrifice variable, simplify dist expression
- variables-and-templates: add step to vary cultist distances
- Fix actors()/actor_ids() to use castData for role-based filtering
… logs

- Rename looping-and-sync to looping-and-when
- Teach When column with practical use case (disable echo rows with false)
- Add conditional When step (dist < 200)
- Remove false claims about expressions re-evaluating each loop cycle
- Remove fxbetween debug logging
…me scope var

- sync delay rows now queue their commands into the next chunk (fire after sync resolves)
- sync rows without commands still work as pure barriers
- Fix sync participant race: track childrenSeen flag to handle fast child completion
- Fix sync participant: wait for children to appear before giving up (async load)
- Add castName to expression scope (available in delay/when/command templates)
- chaining-and-recursion tutorial: use , clean 2-row ritual pattern
- Remove all debug logging
- Add required parameter validation: scenes abort with error if params without defaults are missing
- Fix: don't show status card when executeScene returns null (failed to start)
- variables-and-templates: add parameter teaching steps (required vs default)
- variables-and-templates: fire breath row uses speed param instead of hardcoded 0.2
- Add castName to scope for use in command templates
- Add sceneLink()/castLink() helpers that generate clickable journal links
- Convert all [Scene] and [Cast] references in tutorial steps to dynamic links
- Falls back to <code> text if handout doesn't exist yet
- Update header date, add fx/fxbetween to header commands
- ScriptKit registration: expanded changelog, added fx/fxbetween commands,
  signals API, castName template var, fixed loop/chain docs accuracy
- README: added When section, fx/fxbetween, castName, sync row commands,
  signals API, accurate looping/chaining docs, full changelog
- script.json: clean description with feature summary and commands
- Single !choreograph fx command replaces both fx and fxbetween
- Auto-detects spawnFx vs spawnFxBetweenPoints: two points = between, one = point
- Three strict modes: coordinate (numeric args), token ID (non-numeric), selected (no args)
- Custom FX resolved by ID (starts with -) or name lookup
- Remove fxbetween command entirely
- Update tutorials, header, ScriptKit registration, README, script.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant