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

[Request]Tokenfate upgrade?

I'm trying to make using a beholder less ridiculous as the DM.  To do this I've created a table for all the rays and now I just need a way to call target choices into the same recursive template.  My issue here is that the only thing I'm aware of that lets me use my selected tokens in the template is tokenfate but tokenfate is not compatible with templates, it makes its own thing in chat.  My original idea was to just do 2 tables, 1 with all the players and their minions character names, and then the other the eye ray entries, and then marry them into a large npctraits template output saying X gets Y ray, A gets B ray, and G gets H ray.  The problem with that is that I have no idea what the targets actually will be other than quickly editing the table constantly as players go invisible or hide or players summon creatures.  So I'm left with a bandaid solution.  Spit out the recursive tables command with the 3 eye rays numbered 1, 2, and 3 and then just have tokenfate above it spitting out its 3 target choices.  Is there a script out there that does tokenfate but lets you spit it out into a template?
1644525670
timmaugh
Forum Champion
API Scripter
The metascripts can help with this. You can construct template parts on the fly and output a final templated message when you're done. They can walk over a set of tokens or a set number of things (like rays), ending their process when that's done. I'm not familiar with a "beholder" or what that entails, or how your game play would go... to know what difficulties we'd be trying to surmount. But if you can explain a little of that mechanic, I think I could put an example together that would do what you want. Here is an example of the metascripts working recursively over a set of things and outputting a templated message at the end.
1644527203

Edited 1644528615
A beholder is a creature that on his turn, picks X targets and then does a different random ray to each target, never duplicate rays(cause the rays are unique and can't target more than one creature).  So because targets are only things he can see in range of his ability, the target options each turn will shift, normally I do token-fate api which lets you do a multiselect of tokens and randomly picks X out of the selection and displays them in chat as the chosen characters.  Then I spit out the npcaction on the beholder template but its very very very long and a wall of text, I was trying to trim that npcaction down to just the 3 random eye rays(yes right now I don't have a good solution to prevent duplications so I just add at the bottom of the template an apichat button that is just an individual reroll command for the eye rays incase of duplicates).   It would seem when I removed "/w gm " from my reroll command it broke the api chat button.  Maybe @theaaron can diagnose this problem? [Reroll](!rt &{template:npcaction} {{rname=Rerolled Duplicate}} {{description=[[1t[BeholderRays]]]}}) I figured out what broke the button, one of the Eye ray table options had a set of parenthesis that was throwing the apichat button off.  Html replacement fixed it.  
Ok nope, I really cannot figure out why my api chat button that is running a recursive table command is breaking when its not whispering to a GM.  I'm at my wits end I cannot figure out what is going on.   /w gm [Reroll](!rt &{template:npcaction} {{rname=Rerolled Duplicate}} {{description=[[1t[BeholderRays]]]}}) When the above has /w gm inserted after !rt inside the api chat button then the command works.  When it is like above, in chat it appears like the image above this post, a dead link or underlined text, no longer a button to press.  At first I thought maybe the /w gm was some how allowing for a unique character to escape but recursive tables appears to use the other slash for escapes.  
1644529678
The Aaron
Roll20 Production Team
API Scripter
Try replacing the : in &{template:npcactions| with an HTML escape and see if that works?
1644529742
The Aaron
Roll20 Production Team
API Scripter
Calling abilities off of a mule character might make for a cleaner experience here, and avoid a bunch of the escaping.
When there are multiple things in a macro button or token action, apichat buttons need to have escapes to prevent it from auto expanding when you fire the other non chat button command in the macro/token action.  So since I couldn't get that button to work as an apichat button, I then moved it to its own tokenaction box on the macro mule.  Its a workaround I guess but its really weird how it breaks the apichat syntax when nothing in the command is breaking it.  I looked at the rollable tables outputs and theres a bunch of commas and periods, you don't have to escape commas unlesss they are in a query, periods never need to be.  There is a single Dash would that break apichat or recursive tables?
i know this is a little off topic, but why not just use two decks? one deck of potential targets (the pcs and their soon to be dead weight.... erm... friends...)  and one deck with the various rays , and just discard any targets that are invalid for whatever reason?
1644581398

Edited 1644582273
Because the targets can be summons and npcs they have with them.  If I could preplan the targets I could use my original plan of a rollable table, plus cards in roll20 are clunky, the whole point of the project was to make the beholder encounters more streamlined and less click heavy and wall-of-text-ey.  My now final project appearance is I have an eye ray token action and an apichat button in the eye ray token action that I press for tokenfate to spit out its target choices.  Then I have a second token action button for rerolled eye rays(and in the case of legendary single rays).  Those token actions meaty commands are in a macro mule.  Then I went to collections and have a macro ability call for both those buttons that I toggle as global token actions for any npc I have selected when I plan on using a beholder in any of my sessions.  I wish that I could get the above command to work with apichat buttons but something in that command breaks the syntax for apichat buttons and I have no clue what, I spammed the button so many times that if it is a symbol in the actual meat of the rollable table, it would have to be in every table option.  The only unique symbol that is questionable is there is a Dash in every option of the rollable table but I don't think you can escape stuff in a rollable table, whenever I do they appear as their true symbols when I see them in the table after the edit so /shrug.  Maybe a dev will answer since its kinda a roll20 issue as the wiki does not say anything about buttons that would tell me what I'm doing wrong.  The error for the record, is not that it auto expands, its that the syntax is broken and the button appears as an underlined normal text, which...if you ever try to print a gif in chat using the same syntax, usually means the syntax inside the parenthesis is improper.  (Doesn't end in an image file name) but obviously this is an apichat button not an image link, but they use the same syntax.  Oh one more thing, what is really weird about it is that if I insert "/w gm " into the command the apichat button suddenly begins to work pristinely, but I don't want to whisper the legendary/reroll eye stalk as its for the players to see, and when I tried to use unwhisper api to work around that, it gave the weirdest error wall of text I have ever seen in roll20 so something is all sorts of weird with this and I am totally giving up and just going with 2 token actions instead of 1.