Skip to content

ScriptKit 1.4.0 — Random Name Generator - #2321

Merged
Alicekb merged 2 commits into
Roll20:masterfrom
KenanMillet:scriptkit-random-name
Sep 3, 2026
Merged

ScriptKit 1.4.0 — Random Name Generator#2321
Alicekb merged 2 commits into
Roll20:masterfrom
KenanMillet:scriptkit-random-name

Conversation

@KenanMillet

@KenanMillet KenanMillet commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

ScriptKit 1.4.0 — Random Name Generator

Summary

Adds a random, human-readable name generator to ScriptKit so scripts can mint friendly identifiers (e.g. arcane-dragon) instead of opaque random strings. This is a purely additive, backward-compatible change — no existing API or behavior is modified.

What's new

New public API:

  • ScriptKit.randomName(scriptName, useCount?) — returns the next fantasy-themed adjective-noun name for the given plugin key. Optionally accepts a useCount(base) => number callback to override the suffix-count source (e.g. to check live game objects).
  • ScriptKit.useName(scriptName, name) — record a use (increments the base's count). Returns the new count.
  • ScriptKit.dropName(scriptName, name) — release a use (decrements; removed at ≤ 0). Returns the new count.
  • ScriptKit.nameCount(scriptName, name) — how many times the base name has been used (0 if unused).

How it works:

  • Names come from a shared seeded shuffle over 100 adjectives × 100 nouns (10,000 unique bases). The seed is persisted in state, so the ordering is stable across sandbox restarts.
  • Each plugin (keyed by the scriptName argument) gets a random starting offset, so different plugins begin on different names.
  • Once a base has been used, a numeric suffix is appended (arcane-dragon-2, arcane-dragon-3, …), driven by the (default) per-plugin usage counts.
  • useName / dropName / nameCount key on the base name; a trailing -N suffix is stripped automatically, so callers can pass either the base or the full returned name.
  • randomName does not require ScriptKit.register; per-plugin state is created lazily on first use.

Dictionaries: 100 adjectives + 100 nouns, no duplicates, no adjective/noun overlap, 2–5 words per starting letter (excluding x, which has no common readable words).

Files changed

  • ScriptKit/ScriptKit.js — the generator implementation, plus a dev-docs topic and a 1.4.0 changelog entry in the self-registration.
  • ScriptKit/1.4.0/ScriptKit.js — version snapshot.
  • ScriptKit/script.json — version → 1.4.0, previousversions updated, description refreshed.
  • ScriptKit/README.md — new "Random Name Generator" section + changelog entry.

Testing

  • Exercised the generator end-to-end with a throwaway plugin that generates all 10,000 base names, then a full second lap (20,000 total), calling useName after each with the default count source. Confirmed:
    • no duplicate names across all 20,000 generations,
    • the first lap yields 10,000 unique bare bases (no suffixes),
    • the second lap yields the same bases with -2 suffixes,
    • dropName returns every count to 0.
  • Confirmed the seeded shuffle produces a stable ordering across sandbox restarts and that two different plugin keys start on different names.

Notes

  • Backward compatible: no changes to existing commands, registration, help, migrations, or handout behavior. Existing scripts are unaffected.
  • No new dependencies.

Add ScriptKit.randomName / useName / dropName / nameCount for readable,
fantasy-themed adjective-noun IDs (e.g. arcane-dragon).

- Shared seeded shuffle (persisted seed) over 100x100 adjective/noun pairs;
  each plugin gets a random starting offset so plugins begin on different names
- randomName(scriptName, useCount?) — useCount(base)=>number optionally overrides
  the default count source (the plugin's own tracked counts)
- Collision suffixing (-2, -3, ...) driven by per-plugin, plugin-owned use counts
- useName/dropName/nameCount key on the base name (trailing -N auto-stripped)
- Dictionaries: 100 words each, no duplicates, no adjective/noun overlap,
  2-5 words per starting letter (x excluded), alphabetically sorted rows
- Dev-docs topic + changelog entry
- Add ScriptKit/1.4.0/ version snapshot
- Update script.json: version 1.4.0, previousversions incl. 1.3.0, description
  refreshed with the name-generator changelog
- README: document ScriptKit.randomName / useName / dropName / nameCount and add
  a v1.4.0 changelog entry
@Alicekb
Alicekb merged commit 43d8d9a into Roll20:master Sep 3, 2026
2 checks 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