Skip to content

Commit 9484560

Browse files
committed
Added FPS config
1 parent 669febf commit 9484560

3 files changed

Lines changed: 35 additions & 10 deletions

File tree

Sequence/0.2.0/Sequence.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// =============================================================================
2-
// Sequence v0.1.0
3-
// Last Updated: 2025-05-31
2+
// Sequence v0.2.0
3+
// Last Updated: 2026-06-01
44
// Author: Kenan Millet
55
//
66
// Description:
@@ -2312,7 +2312,12 @@ var Sequence = Sequence || (() => {
23122312
// Playback Engine
23132313
// =========================================================================
23142314

2315-
const PLAYBACK_FPS = 30;
2315+
const PLAYBACK_FPS_DEFAULT = 30;
2316+
const PLAYBACK_FPS = (() => {
2317+
const cfg = typeof globalconfig !== 'undefined' && globalconfig.sequence;
2318+
const val = cfg && parseInt(cfg['Playback FPS'], 10);
2319+
return (val && val > 0) ? val : PLAYBACK_FPS_DEFAULT;
2320+
})();
23162321
const PLAYBACK_INTERVAL_MS = Math.round(1000 / PLAYBACK_FPS);
23172322

23182323
/**

Sequence/Sequence.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// =============================================================================
2-
// Sequence v0.1.0
3-
// Last Updated: 2025-05-31
2+
// Sequence v0.2.0
3+
// Last Updated: 2026-06-01
44
// Author: Kenan Millet
55
//
66
// Description:
@@ -2312,7 +2312,12 @@ var Sequence = Sequence || (() => {
23122312
// Playback Engine
23132313
// =========================================================================
23142314

2315-
const PLAYBACK_FPS = 30;
2315+
const PLAYBACK_FPS_DEFAULT = 30;
2316+
const PLAYBACK_FPS = (() => {
2317+
const cfg = typeof globalconfig !== 'undefined' && globalconfig.sequence;
2318+
const val = cfg && parseInt(cfg['Playback FPS'], 10);
2319+
return (val && val > 0) ? val : PLAYBACK_FPS_DEFAULT;
2320+
})();
23162321
const PLAYBACK_INTERVAL_MS = Math.round(1000 / PLAYBACK_FPS);
23172322

23182323
/**

Sequence/script.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"script": "Sequence.js",
44
"version": "0.2.0",
55
"previousversions": [],
6-
"description": "# Sequence\n\nA general-purpose keyframe animation engine for Roll20 tokens. Record token movements and attribute changes in real time, then play them back on any token with smooth interpolation, easing, looping, speed control, and expression-driven values.\n\n## Features\n\n- **Record** — Move a token and change its attributes while Sequence captures each change as a timestamped keyframe.\n- **Playback** — Replay recordings on any token with smooth lerp interpolation between keyframes.\n- **Easing** — Per-attribute easing curves: `linear`, `sine`, `quad`, `cubic`, `expo`, `circle`, `power(n)`, `bezier(x1,y1,x2,y2)` (CSS cubic-bezier). Ease-in, ease-out, and ease-in-out all supported.\n- **Expressions** — Keyframe values can be expressions: `+rand(-140,140)`, `=clamp(prev+50,orig-200,orig+200)`, `=color.hsl(rand(0,360),100,50)`.\n- **Looping** — Loop indefinitely or N times, with `reset` (snap back) or `accumulate` (each cycle builds on the last) modes.\n- **Portable** — Recordings stored in `[Sequence] name` handouts. Copy a handout to another campaign to transfer an animation.\n- **Extensible** — External scripts can register custom attributes, expression functions, constants, and easing curves.\n\n## Quick Start\n\n1. Select a token and type `!sequence record my-animation`\n2. Move the token and change its attributes\n3. Type `!sequence stop` — the recording saves automatically\n4. Select any token and type `!sequence play my-animation`\n\n## Commands\n\n`!sequence record [name] [--attrs a,b,...]` — Start recording selected token(s)\n\n`!sequence stop` — Stop and save recording\n\n`!sequence pause` / `!sequence resume` — Pause/resume recording\n\n`!sequence play <name> [--loop] [--loops n] [--speed x] [--reverse] [--offset ms] [--only a,b] [--exclude a,b]` — Play a recording\n\n`!sequence preview <name>` — Play and auto-revert when finished\n\n`!sequence stop-play` / `!sequence pause-play` / `!sequence resume-play` — Control playback\n\n`!sequence list` — List all recordings\n\n`!sequence edit <name>` — Open the recording handout\n\n`!sequence delete <name>` — Delete a recording\n\n`!sequence add-attribute <name> <attr>` — Add an attribute column\n\n`!sequence remove-attribute <name> <attr>` — Remove an attribute column\n\n`!sequence add-row <name> <time>` — Add a blank keyframe row\n\n`!sequence sort <name>` — Sort keyframes by time\n\n`!sequence refresh <name>` — Regenerate handout from cache\n\n`!sequence man [topic]` — In-game help. Topics: `attr`, `func`, `vars`, `easing`, or any name\n\n`!sequence debug` — Show active sessions\n\n`!sequence dump-html <name>` — Print raw handout HTML to the API console\n\n`!sequence gen-dev-docs` — Generate the extension developer guide in your journal\n\n## Attributes\n\nAll standard graphic token properties are supported: `left`, `top`, `rotation`, `width`, `height`, `bar1_value`–`bar3_value`, auras, lighting, colors, booleans, and more. Run `!sequence man attr` in chat for the full list.\n\n## Extension API\n\nOther scripts can extend Sequence by listening for the `!sequence-ready` chat signal and calling:\n\n`Sequence.registerAttribute` / `Sequence.registerValueFunction` / `Sequence.registerTimingFunction` / `Sequence.registerPlaybackConstant` / `Sequence.registerEasing` / `Sequence.generateExtensionHandout`\n\nRun `!sequence gen-dev-docs` to generate the full extension developer guide.",
6+
"description": "# Sequence\n\nA general-purpose keyframe animation engine for Roll20 tokens. Record token movements and attribute changes in real time, then play them back on any token with smooth interpolation, easing, looping, speed control, and expression-driven values.\n\n## Features\n\n- **Record** \u2014 Move a token and change its attributes while Sequence captures each change as a timestamped keyframe.\n- **Playback** \u2014 Replay recordings on any token with smooth lerp interpolation between keyframes.\n- **Easing** \u2014 Per-attribute easing curves: `linear`, `sine`, `quad`, `cubic`, `expo`, `circle`, `power(n)`, `bezier(x1,y1,x2,y2)` (CSS cubic-bezier). Ease-in, ease-out, and ease-in-out all supported.\n- **Expressions** \u2014 Keyframe values can be expressions: `+rand(-140,140)`, `=clamp(prev+50,orig-200,orig+200)`, `=color.hsl(rand(0,360),100,50)`.\n- **Looping** \u2014 Loop indefinitely or N times, with `reset` (snap back) or `accumulate` (each cycle builds on the last) modes.\n- **Portable** \u2014 Recordings stored in `[Sequence] name` handouts. Copy a handout to another campaign to transfer an animation.\n- **Extensible** \u2014 External scripts can register custom attributes, expression functions, constants, and easing curves.\n\n## Quick Start\n\n1. Select a token and type `!sequence record my-animation`\n2. Move the token and change its attributes\n3. Type `!sequence stop` \u2014 the recording saves automatically\n4. Select any token and type `!sequence play my-animation`\n\n## Commands\n\n`!sequence record [name] [--attrs a,b,...]` \u2014 Start recording selected token(s)\n\n`!sequence stop` \u2014 Stop and save recording\n\n`!sequence pause` / `!sequence resume` \u2014 Pause/resume recording\n\n`!sequence play <name> [--loop] [--loops n] [--speed x] [--reverse] [--offset ms] [--only a,b] [--exclude a,b]` \u2014 Play a recording\n\n`!sequence preview <name>` \u2014 Play and auto-revert when finished\n\n`!sequence stop-play` / `!sequence pause-play` / `!sequence resume-play` \u2014 Control playback\n\n`!sequence list` \u2014 List all recordings\n\n`!sequence edit <name>` \u2014 Open the recording handout\n\n`!sequence delete <name>` \u2014 Delete a recording\n\n`!sequence add-attribute <name> <attr>` \u2014 Add an attribute column\n\n`!sequence remove-attribute <name> <attr>` \u2014 Remove an attribute column\n\n`!sequence add-row <name> <time>` \u2014 Add a blank keyframe row\n\n`!sequence sort <name>` \u2014 Sort keyframes by time\n\n`!sequence refresh <name>` \u2014 Regenerate handout from cache\n\n`!sequence man [topic]` \u2014 In-game help. Topics: `attr`, `func`, `vars`, `easing`, or any name\n\n`!sequence debug` \u2014 Show active sessions\n\n`!sequence dump-html <name>` \u2014 Print raw handout HTML to the API console\n\n`!sequence gen-dev-docs` \u2014 Generate the extension developer guide in your journal\n\n## Attributes\n\nAll standard graphic token properties are supported: `left`, `top`, `rotation`, `width`, `height`, `bar1_value`\u2013`bar3_value`, auras, lighting, colors, booleans, and more. Run `!sequence man attr` in chat for the full list.\n\n## Extension API\n\nOther scripts can extend Sequence by listening for the `!sequence-ready` chat signal and calling:\n\n`Sequence.registerAttribute` / `Sequence.registerValueFunction` / `Sequence.registerTimingFunction` / `Sequence.registerPlaybackConstant` / `Sequence.registerEasing` / `Sequence.generateExtensionHandout`\n\nRun `!sequence gen-dev-docs` to generate the full extension developer guide.",
77
"authors": "Kenan Millet",
8-
"roll20userid": "2614613",
8+
"roll20userid": "",
99
"dependencies": [],
1010
"modifies": {
1111
"graphic": {
@@ -26,5 +26,20 @@
2626
"notes": "read/write"
2727
}
2828
},
29-
"conflicts": []
30-
}
29+
"conflicts": [],
30+
"useroptions": [
31+
{
32+
"name": "Playback FPS",
33+
"type": "select",
34+
"options": [
35+
"5",
36+
"10",
37+
"15",
38+
"20",
39+
"30"
40+
],
41+
"default": "30",
42+
"description": "Frames per second for animation playback. Higher values are smoother but increase API load. 30 is recommended for most games; try 10-15 if you experience performance issues."
43+
}
44+
]
45+
}

0 commit comments

Comments
 (0)