Skip to content

Gaslight 2.3.0 — !gaslight quick, nested splits, marketplace-safe staging - #2322

Merged
Alicekb merged 6 commits into
Roll20:masterfrom
KenanMillet:gaslight-quick
Sep 3, 2026
Merged

Gaslight 2.3.0 — !gaslight quick, nested splits, marketplace-safe staging#2322
Alicekb merged 6 commits into
Roll20:masterfrom
KenanMillet:gaslight-quick

Conversation

@KenanMillet

Copy link
Copy Markdown
Contributor

Gaslight 2.3.0 — !gaslight quick, nested splits, marketplace-safe staging

Summary

Adds a one-command setup (!gaslight quick), marketplace-safe token cloning, nested-split support via per-player page stacks, and quality-of-life improvements (optional auto-generated group names, merge-all, adaptive getting-started guide).

Depends on ScriptKit ≥ 1.4.0 (for the readable name generator). Part of the same bulk submission — please merge alongside the ScriptKit 1.4.0 PR. Gaslight guards the call (typeof ScriptKit.randomName) and falls back to an id-based name if an older ScriptKit is present, so it won't break, but 1.4.0 is required for the intended behavior.

What's new

!gaslight quick [group] [players...] — configure + split in one step. Clones the master page onto existing page copies and/or reusable GL-SCRATCH scratch pages (their settings + contents are cloned from the master, preserving z-order), configures the group, and splits — no manual setup/split. Requires the experimental/Jumpgate sandbox (uses graphic.createCopy). On merge, scratch pages are wiped and renamed back to GL-SCRATCH for reuse; real duplicates are left untouched. quick validates every target page up front and aborts atomically (no partial setup) if a page's z-order isn't initialized.

Marketplace-safe stagingstage/clone now uses graphic.createCopy when available, preserving Marketplace imgsrc and sides (previously these failed because createObj rejects Marketplace URLs). Auto-stage failures are now reported to the GM instead of failing silently.

Nested splits (per-player page stacks) — activating a second split no longer clobbers the first. Each player tracks a stack of the groups they belong to; merge returns each player to the most recent group they're still in (or the banner page). Because groups can involve different player sets, this is tracked per player.

!gaslight merge / merge-allmerge (no arg) now ends the most-recently-activated split (top of the stack); merge <group> targets a specific group anywhere in the stack; merge-all ends everything at once. (Behavior change: merge with no argument used to end all splits — that's now merge-all.)

Optional group namessetup and quick no longer require a group name; a readable name (e.g. arcane-dragon) is generated via ScriptKit. The first argument is treated as a player unless it doesn't resolve to a player.

Adaptive getting-started guide — the interactive guide walks the quick path on the experimental sandbox and the manual path otherwise; a standalone manual-setup guide is offered when quick is available.

Files changed

  • Gaslight/Gaslight.js — all of the above.
  • Gaslight/2.3.0/Gaslight.js — version snapshot.
  • Gaslight/script.json — version 2.3.0, previousversions, refreshed description/command list; ScriptKit added to dependencies.
  • Gaslight/README.md — quick-start (quick vs manual), command table, changelog, ScriptKit ≥ 1.4.0 requirement.

Testing

Tested in-game on the experimental sandbox:

  • quick with a master containing tokens (incl. Marketplace art), walls, doors, windows, pins, paths, and text → all object types clone with correct z-order; Gaslight config text and [GLS] script pins are excluded from clones.
  • Single split → merge → banner round-trips (repeatedly), including the new stack-based reassignment.
  • Scratch-page recycling on merge: scratch pages are wiped and renamed back to GL-SCRATCH; the master page keeps all its content (no cascade-deletion).
  • quick abort path when a scratch page's z-order is uninitialized (never viewed) — nothing is changed and the GM is told which pages to open.
  • Adaptive getting-started guide on both quick-capable and manual paths.
  • The ScriptKit name generator was exercised separately with an exhaustive 20,000-name round-trip (see the ScriptKit 1.4.0 PR).
  • script.json validated against script.json.schema.

Advanced nested/stacked multi-group scenarios with differing player sets are an uncommon case; the underlying stack logic was verified in isolation.

Notes

  • Behavior change to merge (no arg) documented above.
  • No changes to the on-page config format or existing linking/sync behavior.

- Add supportsCreateCopy() feature detection for graphic.createCopy (experimental sandbox)
- Add canStageToken() as the single copy-ability check, used by all staging paths
- stageTokenToPages uses createCopy when available (preserves marketplace imgsrc/sides), falls back to createObj
- onTokenAdded now reports staging failures to the GM instead of silently swallowing them
Configure + split in one step using existing page copies, filling any
shortfall from reusable GLS-SCRAP pages.

- Clones master page settings + contents (graphics via createCopy, plus
  paths/pathv2/text/pins/doors/windows) onto scrap pages, preserving z-order
  by creating in _zorder order (engine auto-fronts each new object)
- Seeds _zorder on pristine scrap pages to avoid the engine adjustZOrder crash
- Excludes Gaslight config text and [GLS] script pins from cloning
- isScriptPin now requires the linked handout to carry the [GLS] prefix
- On merge: wipes + renames scrap pages back to GLS-SCRAP (cascade suppressed
  via destroying guard); if all player pages were scrap, also strips the
  master's GM config text and restores its name
- Optional group name (auto-generated if omitted); requires experimental
  sandbox (graphic.createCopy); async with completion whisper
quick's auto-generated group name is now a readable fantasy name (e.g.
arcane-dragon) via ScriptKit.randomName, with a useCount check that skips
names already used by an existing group. Falls back to genId() if ScriptKit
is unavailable. Updated the quick help entry.
…ides

- Per-player page stacks: split/quick push each player's page; merge (no arg)
  ends the most-recently-activated split and returns each player to the most
  recent group they're still in (or the banner page). merge <group> targets a
  specific group anywhere in the stack.
- !gaslight merge-all — end all active splits at once
- Group name optional for setup and quick: readable name auto-generated via
  ScriptKit.randomName; first arg treated as a player unless it doesn't resolve.
  Shared resolveGroupName() helper.
- Adaptive getting-started guide (quick vs manual by createCopy availability,
  memoized) + standalone manual-setup guide registered only when quick exists;
  guide prompts resolve the actual group name dynamically.
- Scratch pages renamed GL-SCRATCH (was GLS-SCRAP), detected through 'Copy of'
  prefixes; shared stripCopyOf helper; all references via SCRATCH_NAME constant.
- Docs/handouts: 2.3.0 changelog; dropped redundant aliases and newSince
  (auto-fallback matches our versioning); removed unused GLS_TAG; user/dev
  handouts regenerate on the version bump.
…rding

- quick: validate all target pages' z-order up front and abort atomically if any
  page is uninitialized (never viewed) — no partial setup. Error lists the pages
  to open once so Roll20 initializes them.
- getting-started: compose the guide at registration (quick vs manual variant)
  instead of per-step when checks; keeps the experimental-sandbox tip on the
  manual variant.
- Correct z-order guidance: a page needs to be viewed once (not have an object
  placed) to initialize its _zorder.
- Add Gaslight/2.3.0/ version snapshot
- Update script.json: version 2.3.0, previousversions, description refreshed with
  the 2.3.0 changelog + command list (ScriptKit added as a dependency)
- README: quick vs manual quick-start, quick/merge-all commands, v2.3.0 + v2.2.2
  changelog entries, ScriptKit >= 1.4.0 requirement
@Alicekb
Alicekb merged commit 7f368b2 into Roll20:master Sep 3, 2026
1 check passed
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.

2 participants