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 .
×
Create a free account

SpinTokens with @{target|token_id} and Player Use Possible?

1586567561

Edited 1586573463
Dumbhuman
Pro
Marketplace Creator
I've been slowly setting up a SpellFX character to handle all sorts of AOE spell templates and now that I've gotten around to Spirit Guardians, I've realized how nice some spinning functionality would be.  There are a couple of hurdles to handing the players some nice shiny spinny stuff the way I'd like to though. 1. SpinTokens currently requires the IsGM script so players pushing a button with the command wouldn't do anything for them.  I might be able to hack away at the script and remove that restriction, but it would be slow and brutal butchery, I'm sure. 2. SpinTokens doesn't currently have any way (that I can see) for designating targets by providing token_id, which I'd really love to have because I'm already using @{target} syntax to send Spirit Guardians to the map layer (where we won't have to worry about clicking it) and have the caster carry it around with CarryTokens. If neither of these things happens, it certainly won't be the end of the world, but if they're relatively quick changes that could be provided as options then I'd love to see it happen. Edit: Here's a link to the SpinTokens script , just in case anyone would like to have a look.
1586579272
The Aaron
Roll20 Production Team
API Scripter
Sorry for the delay, that script is wretchedly old and I had to basically rewrite 90% of it... (out of a sense of personal pride, mind you. =D). I added in the ability for anyone to spin a token.&nbsp; If the player is a GM, they can set anything spinning.&nbsp; If they aren't, they can only spin what they can control.&nbsp; If the API issues a command (as will happen with CarryTokens and similar), it's treated as a GM. I've also added a --ids argument which will allow you to pass one or more ids for tokens to spin, for example: !spin-start 200 --ids @{target|first|token_id} @{target|second|token_id} Note that you must specify the spin rate right after !spin-start if you plan on using it. You can grab the very latest version here:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/SpinTokens/SpinTokens.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/SpinTokens/SpinTokens.js</a> I've also pushed it to Roll20 in a Pull Request so it should get added to the 1-click scripts next week or so. Here's the MUCH updated help: SpinTokens v0.4.2 SpinTokens provides a way to toggle tokens to be spinning at various rates. GMs can spin any tokens, while players are limited to the tokens they can control. Commands !spin-start [Seconds Per Cycle] [--help | [--ids | &lt;token_id&gt; | [&lt;token_id&gt; ...]]] Starts all specified tokens spinning. Tokens are specified by selecting them, and optionally by specifying their token_ids using the --ids argument. Seconds Per Cycle &nbsp;-- specifies how fast the tokens should spin. This is the number of seconds before the token spins around in one complete circle. A second hand would use the number 60, for example. --ids &nbsp;-- specifies additional tokens to apply the spin to. --help &nbsp;-- shows this help message. !spin-stop [--help | [--ids | &lt;token_id&gt; | [&lt;token_id&gt; ...]]] Stops all specified tokens from spinning. Tokens are specified by selecting them, and optionally by specifying their token_ids using the --ids argument. --ids &nbsp;-- specifies additional tokens to apply the spin to. --help &nbsp;-- shows this help message.
1586587454

Edited 1586587484
Dumbhuman
Pro
Marketplace Creator
Awesome!&nbsp; Many thanks, Aaron.&nbsp; I'm glad it's going to be accessible to a greater audience in the Roll20 Api Script Library too. I'm playing around with it right now and the ids are working well.&nbsp; I'll test the player functionality in a little bit.&nbsp; Out of curiousity, what's the smallest number able to be input for the fastest theoretical speed (as opposed to fastest perceived speed)?&nbsp; I've noticed that sometimes if I get too low (like .001) the help text springs up in chat, maybe because the number's getting rounded down to zero which makes the script think I didn't input a value at all.&nbsp; Other times though I've input as low as .0003 and not gotten the help to pop up.
1586588585
The Aaron
Roll20 Production Team
API Scripter
You can set it to any number that Javascript's parseFloat() will recognize.&nbsp; However, it only updates every 200ms, so it will start to get pretty choppy. It shows the help if nothing is selected or specified. My guess would be you accidentally clicked off the token, but there might be some other edge case where help pops up. =D
1586596891
Dumbhuman
Pro
Marketplace Creator
Yeah, it's well within the realm of possibility that there was some click-happy user error involved. Here's a little low-quality gif of it doing just what I wanted for Spirit Guardians: That's TokenMod to change the SpellFx target's image/size/etc as well as send it to the map layer, SpinTokens to animate it, and CarryTokens to get it to follow the caster.&nbsp; CarryTokens I think is a little tempermental, because sometimes after clicking the targets, nothing at all happens (including no TokenMod or SpinTokens), but then if I run the same process again it works. And I wasn't really thinking of applying a spin animation when I designed any of these spell effects, but here's a little montage of some spells where adding the spin already works pretty well to liven them up from their static forms.&nbsp; I'll probably tweak a few of them now that I know the capability is there. Low-quality gif giving a slight idea of what Fog Cloud, Ice Storm, Incendiary Cloud, Pyrotechnics (fireworks option), and Sleet Storm look like while spinning around: And finally, a little Meteor Swarm (in another very low-quality gif): Thanks for the fun I get to have with this!