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

Floating Platform Puzzle. GIF? Script?

I'm trying to create a platform "puzzle"/encounter where a series of floating platforms move around in a pre-determined loop before suddenly resetting back to their original position. While I could use GIMP to create a massive GIF by frame-by-framing each portion of the animation that would take hours and I'd have to manually create every platform movement and synch them all onto a giant GIF to get them all to work right. If I could, I'd even like to be able to add a little magical 'warp' effect to either the individual platforms or the whole room when they reset, as the platforms are essentially locked in a repeating time loop.  Is there some easier way to do this? Perhaps some sort of script to automate the movement each round? A command to make multiple gifs start and stop at the same time? A tool to turn a series of images into a smooth gif and handle in between movement frames instead of needing to hand create every frame? Help!
1597735535
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Why not just make each platform its own static graphic and move them with a script like Patrol or Waypoints? (I can't remember if either is available in one-click).
I've never worked with Patrol or Waypoints before, but if that would be a better answer than animating it into a single .gif that's great. I'm just looking for some way of having multiple platforms move in a pre-defined pattern until they reset, essentially looping every other round or so. 
1597752093
David M.
Pro
API Scripter
The Patrol script Keith mentioned sounds like the way to go based on your description. The movement of the platforms will be on even intervals and you can just set it and forget it. I've heard many people having problems with animated gifs on Roll20. Seems hit or miss. Just in case you wanted to trigger when the movement takes place (e.g. after each turn in the round), you could optionally set up macros for each position using token-mod to set the xy coordinates. !token-mod --set left|[[14*70-35]] top|[[10*70-35]]  Maybe put them in a chat button menu. If you wanted your "reset" to be more of a "poof" teleport effect, you could have the last macro in the sequence trigger an fx, move the token to the GM layer prior to the move, then move back to objects layer after the move. Something like: /fx nova-smoke @{selected|token_id} !token-mod --set layer|gmlayer !token-mod --set left|[[14*70-35]] top|[[10*70-35]] !token-mod --set layer|objects I haven't tried this, but seems like it would work. If there are multiple platforms, you would want to get the tokenIDs and hardcode them into the macros (including token-mod lines with the --ids command) so you wouldn't have to select each one individually each time. Anyway, like I said, it sounds like Patrol is probably going to work for you. It's just another option, depending on how you want it all to function. 
I don't understand much about the macros and scripts but I think that's what I would want? I want to be able to push a button and have these platforms all animate to their next "Position", until they reach a set point where they glitch out, there's magic sparkies, and they hard reset back to their original position. What is Token Mod and how would I go about doing that? I realize I could just use a multi state image but I want the players to actually see these platforms rotating and moving and resetting, especially if I could make one that just loops the animation and another that lets me cycle it for round-by-round movement during a combat encounter. 
1597837686
David M.
Pro
API Scripter
Token-mod is an extremely flexible script that allows all kinds of modifications to token properties. It is available as a 1-click install on your API scripts page. &nbsp;&nbsp; Start typing "token" in the drop down menu to find it faster. Once you select it, scroll down and click "Add script" Now, Token-mod can do a lot, so the help is extensive. If you go into your game and type...&nbsp; !token-mod --help ...you'll get a full description of all the commands. You will probably want to increase the width of your chat window for readability, 'cause it's a lot! The examples in my previous post should get you started on relevant commands. There are tons of great scripts out there that will make your life much easier.&nbsp; Some scripts are not on the 1-click and so must be manually installed. To do that, you must find and copy the source code (likely from the github, link below), and then on your api scripts page, click on "New script", paste the code, give it a name in the Name field, then scroll down to "Save Script". If it installs properly, you will see stuff happening in your black "API Output Console" and no big pink error messages will show up. If you get a pink error message, that means your API sandbox has crashed and must be restarted. No scripts will work when the sandbox is crashed. If it happened when saving a script, that means the script has errors (maybe you missed some characters during copy/paste). Those will have to be corrected before your sandbox can be restarted. If you are in your game and all of a sudden your scripts stop working, open a window to your api scripts page and click the button to re-start the sandbox. Here's a bunch of scripts on the Roll20 github that can be manually installed: <a href="https://github.com/Roll20/roll20-api-scripts" rel="nofollow">https://github.com/Roll20/roll20-api-scripts</a> Some of these are also on the 1-click, so that is the preferred method as they will get auto-updated with newest versions. These are all user-contributed. If you see some that sound interesting, I'd suggest searching the forums for some more info about them, and then click on the script folder and locate the file that ends in ".js". Click on that to access the code and continue manually installing as described above. Have fun!&nbsp; &nbsp;
1597838976

Edited 1597839065
fyi, i would not use command line help for token-mod, it broke my chat and i had to clear my chat archive. :(&nbsp; instead it convenient comes with a handout that has all the options you can use with it.
1597839396
David M.
Pro
API Scripter
I did a little more testing, and it looks like the "teleport" method I hypothesized previously (temporarily sending to GM layer to perform the move) doesn't quite work. The move happens, but there is something about calling the layer switching commands in rapid succession that does not work. I believe it is because each command is performed asynchronously. If that doesn't mean anything to you, don't worry about it, but what it actually means is that the "poof, teleport" effect will actually just look like "poof, slide". A few options 1) Don't worry about it and just deal with the fact that the platforms will slide back to origin point (obviously easiest) 2) Create separate macros/abilities to a) move to GM layer, b) move token positions, c) move back to object layer (note this will make them disappear for a while for the PCs while you futz around with button clicking. (a little more setup, but should overcome the asynchronous issues.) 3) Find some other api script that performs true teleports. This one looks promising, and has lots of documentation at the top of the code, but I haven't ever used it before. (might be perfect for your application, might be a pain, might not have the right triggers, YMMV) <a href="https://gist.github.com/finalfrog/124f67ad84204546caf16fffd84115e4" rel="nofollow">https://gist.github.com/finalfrog/124f67ad84204546caf16fffd84115e4</a> Regardless of what you decide to do, I highly recommend using API chat buttons for this, and therefore character sheet Abilities rather than collections Macros. So one click would bring up a menu of buttons in the chat window (e.g. Pos 1, Pos2, ....). Here is some information on api chat buttons. Note if you use a character sheet ability, you won't have to deal with the html replacements discussed in the following link. Just create a dummy character sheet and set the "represents" property of the platform token to that character sheet, then add your macro code as new "abilities" on that portion of the character sheet. Then make the main menu-generating ability a token action so you just have to select the token and click the ability from the upper left of the window to initiate the chat button menu. <a href="https://wiki.roll20.net/API:Chat#API_Command_Buttons" rel="nofollow">https://wiki.roll20.net/API:Chat#API_Command_Buttons</a>
1597839712
David M.
Pro
API Scripter
aisforanagrams, I've used it many times without a problem (and conversely randomly broken my chat with simple die rolls), but I had forgotten about the handout! That is going to be a much more convenient way to read the info anyway. Thanks!&nbsp;
1597842799

Edited 1597842813
it could be the confluence of scripts i installed for the game. could be something's not playing nice with others (i just upgraded my account last week and just started experimenting with scripts couple of days ago so i installed a bevy of scripts to play around with).
1597842991
David M.
Pro
API Scripter
Honestly, I think it just randomly happens sometimes as the chat archive fills up.&nbsp;
1597850155
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
One of the advantages to the handout is that it can be read outside of game. That link can be bookmarked, and you've got very easy access to the documentation at all times.