Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

[New] SwapTokenPositions

1776790691

Edited 1776913211
SwapTokenPositions v1.0.0 SwapTokenPositions is a Roll20 Mod (API script) that allows GMs and players to quickly swap the positions of two selected tokens on the same page. It features customizable animation effects, persistent global settings, and clear chat feedback. Key Features Seamless Swapping : Select exactly two tokens and run `!swap-tokens` to switch their positions. Two Animation Styles : beams : Arcane beams cycle between tokens before the swap. transport : Vertical light columns and shimmer effects at both locations. Fully Customizable : Adjust duration (1-10s), beam types, and burst effects via command flags. Persistent GM Defaults : GMs can save their favourite configurations globally using the --save flag. Instant Swaps : Set FX to none for a silent, instantaneous relocation. Macro Support : Use --install-macro to automatically create a global "SwapTokens" macro. How to Use Basic Command `!swap-tokens` (Swaps the two currently selected tokens using your default settings) Customization Parameters `--duration <1-10>` : Seconds to play the animation. `--mode <beams|transport>` : The animation style. `--beam-fx <value>` : (Options: none, beam-magic, beam-fire, beam-frost, beam-holy, beam-death) `--burst-fx <value>` : (Options: none, burst-holy, burst-magic, explode-fire, burn-holy, etc.) Examples `!swap-tokens --mode transport` `!swap-tokens --duration 5 --beam-fx beam-fire --mode beams` `!swap-tokens --beam-fx none --burst-fx none (Instant swap)` GM Management Commands `--save` : Save current flags as the new defaults (e.g., !swap-tokens --duration 3 --save). `--show-settings` : View your current persistent defaults in chat. `--reset-settings` : Restore factory defaults. `--install-macro` : Automatically creates a global "SwapTokens" macro. `--help` : Opens the in-game help menu. Installation Copy the source code. Create a new script in your Campaign's API Settings. Paste the code, save, and you're ready to go! Download the source code via Dropbox . View the files in the GitHub pull request . The Roll20 One-Click installation is coming soon. View the introduction video .
1776796738

Edited 1776796753
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi MidNiteShadow7! I have a player whose character has this ability. Does your script allow a player to swap positions with a token they do not control (another PC, for example)?
1776807068

Edited 1776807195
keithcurtis said: Hi MidNiteShadow7! I have a player whose character has this ability. Does your script allow a player to swap positions with a token they do not control (another PC, for example)? At the moment, it only moves tokens you can select. I need to check the mods' ability (still new to Roll20 & DnD) to use names and/or IDs. I was going to look to expand to that. Although the player cannot do it, the DM can do it for them using this mod.
1776808245
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you set the script up to read token IDs, then it can be done with an @{target|token_id} in the macro.
keithcurtis said: If you set the script up to read token IDs, then it can be done with an @{target|token_id} in the macro. Thanks. I'll take a look and work on an update.
I have edited the OP  to add links to  the files in the GitHub pull request  and another to  view the introduction video  on YouTube .