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

Questions regarding macro to access rollable table image

1629900351

Edited 1629900668
Hello, had a question for the hive mind here, here goes.  So I'm attempting to set up a macro/script that my players can use when casting spells like shield/mage armor for instance on themselves or other's, by showing a input value after clicking the Cast Spell in Bar icon showing a list of names listed from the Rollable table along with their corresponding animated images that I purchased off of marketplace, ones the name of the spell has been picked a token of said spell/token from the rollable table pops onto the screen/map and utilizing Waypoint Autofollow for Tokens by Matt ( excellent script by the way ) The spell/token will then snap onto the charartor token ( On Top ) and will follow the token without the need of the player or DM to manually move the spell.  Now my question following above is thus...How do you do this ?? lol been playing around with marco to set it up but with no luck and not finding a way for it to "Pull" an image from the Rollable table ones the players has selected from the Input Value list that pops up when they click on the cast spells icon on the bar. Any help would be tremendously appreciated, thank you and hope to hear from some one soon. 
1629904072

Edited 1629904107
David M.
Pro
API Scripter
Wow, that's a lot! The SpawnDefaultToken script can generate an instance of a rollable table token on the map and set it to the appropriate side & size, as well as performing toFront or toBack operations. However, animated images don't play nicely with the API. If they work at all, you often get it to run once (or only partially) through the animation and then it stops. I just tested with animated images for rollable token sides and verified that the animation doesn't work right when the side is set on creation via Spawn or even after creation with token-mod. Once the animated token is Spawned, you *can* manually set the side to the same side it is already on(!) to get the animations to start working properly. Again, the problem is just some kind of bug with how the api interacts with animations.  Once the token is on the map, you can use your other scripts as normal. There *is* a version of Spawn in the works that will allow some more integrated workflows (using a combination of the scripts Scriptcards, SelectManager, and Plugger). When this is complete, you would be able to write a scriptcards macro to spawn the token, then pass that spawned token_id to another script that scriptcards would also fire off. Animations are still going to be an issue, though. Here's an example of a simple Spawn command to create an instance of the default token of a character named SpellEffectToken. The side is chosen via query. If the size is also variable, you would either need to make a more complicated query ( example ) with html replacements or use something like scriptcards to dynamically generate the Spawn command.  !Spawn {{ --name|SpellEffectToken --side|?{What Spell?|Mage Armor,1|Blur,2|Aid,3} --qty|1 --offset|0,0 --size|2,2 --order|toFront }} Note the qty & offset commands are note required, as they are set to the default values. I just put them in there to be explicit. Also note: when using toFront or toBack operations, the vtt will ignore these for tokens without vision and just stick them behind sighted tokens regardless of the commands.
So no simple script/marco for just pulling a name that's tied into a token inside the rollable table and have it drop it onto the screen ? 
1629931670
David M.
Pro
API Scripter
Let me make sure I understand what you are asking. You have a rollable table token (a multi-sided token whose sides are defined in a rollable table, and each side represents a different spell effect). You want to cast a spell by pushing a button, automatically creating an instance of the rollable table token on the map and also automatically setting it to the appropriate side? If so, then the macro I posted above can do this using the Spawn script. There are also many other options available with that script. However, the only way to get your animations to work properly is going to be to manually set the side of the multi-sided token, due to the api bug I mentioned above.   And, if you want to click a button and have something appear on a map, you will have to use an api script. Otherwise, the only other way is going to be dragging it manually from the journal. 
I once travelled down this path and spent alot of time making it work only to realize that A) Animated gifs and roll20 do not work well together, and B) most players lag out in roll20 so bad that any flashy schnazzy cool stuff that looks good when you are alone in a session look like dog poop in laggy friday night sessions, and C) Its just easier to put most of the prep into the actual story and campaign rather then trying to get roll20's software to function perfectly in a live session.  Theatre of the mind is best.  However here is a parting gift that has had immense mileage in all of my sessions with my tables: &{template:traits} {{name=?{Title of Message}}} {{source=}} {{description=[Spell](?{What URL?}) ?{Text you want to have displayed below the gif}}}
Upon further research myself I have come to this conclusion to a lot of people have...lol and well that's really unfortunate as I bought in quite a bit of the animated tokens packs in hopes to use this, more so when Roll20 say's is support's Webm/Gifs and letting us use what we purchased through their Marketplace only to come to realize that it only half works ( dealing with other problems with the Animated token/weather apart from this post ) So i will make do and press forward and hopes that they fix this and soon otherwise I may have to look for another platform.  Lol Thank for you for parting gift and your info, Question what does this one do ? Still very new to marcos and scripting 
Its a meme generator.  How many times while you are goofing off with friends do you want to post a funny animated gif like we do on discord?  Thats what this code does.  Lets you title it, lets you add a joke to the end, and then displays any gif URL in chat.  It only works when the image ends in a .gif.