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

Macro to show or hide the token action of a character ability

Hi, Wondering if anyone is aware of a macro command that will tick or un tick the show as a token action box for a character sheet ability. I'm trying o create something that will make certain abilities appear as token actions in certain situations. Hope that makes sense
It is possible only with a Mod script. You'll have to specify how/when you want those Token Actions to appear or disappear for more help.
1746356362
timmaugh
Forum Champion
API Scripter
Yes... Check out my ShowButtons script. The script isn't built to let you establish a game event that will trigger the change, if that's what you're looking for. It still requires you to push a button to make the change... But it works well for situations like multiform, shapeshifting, wild shape, etc.
Timmaugh / Jarren, Thank you both for responding  The ShowButtons script looks to do what I'm looking for so will have a play around and see how it goes
Timmaugh, Really like the show buttons script and will definitely be using this. I'm wondering if there is a command to hide all abilities. My thought is to initially hide all abilities then show the ones you want so to avoid updating macros every time a new ability is added to a character sheet.
1746533756
timmaugh
Forum Champion
API Scripter
Glad you like the script, FFR. That's a good feature to add.... I'll see if I can knock that out and get it added to the script.
Timmaugh, If that's doable that will be amazing and a real game changer 
Hi Timmaugh, Might be pushing things a bit but wondering if there is a command that will show a token action from another character. For example if I had a character called "spell book" with the spells set up as abilities could another character called "mage" show token actions for spell book abilities ?
FFR said: Might be pushing things a bit but wondering if there is a command that will show a token action from another character. For example if I had a character called "spell book" with the spells set up as abilities could another character called "mage" show token actions for spell book abilities ? A token can only show Token Actions from the character sheet that it is linked to (and Collections Macros). A  Token Action on 'Mage' could reference attributes from 'Spell Book', but a token linked to 'Mage' cannot reference the Token Actions from 'Spell Book.' Alternatively, a script could transfer Token Actions from one character sheet to another. The issue might be with attribute references depending on how the Token Actions are written. 
Jarren, Thanks for the response. I though I was pushing it a bit. I currently have the spells as character abilities so will continue with that approach.
1747158139
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Well, technically, you could have this situation Character A has Action A Character B has Action B The contents of Action B could be %{Character A|Action A} It should work, but you'd need to make sure that the Action being referenced will work for Character B. I.e. it shouldn't use unspecified references, but work off of specific references like @{selected|attribute}. Depending on the complexity of the Action, this could be trivial or fiendishly complicated. 
timmaugh said: Glad you like the script, FFR. That's a good feature to add.... I'll see if I can knock that out and get it added to the script. Timmaugh, I now have Show Buttons working really well in my game. Just checking in to see if you had any luck with the hide all command and if so what would the command be ?
1747933076
timmaugh
Forum Champion
API Scripter
I did push that to the 1-click repo. I hadn't written anything about it, because I thought I'd missed the cut-off for this week's merge, but I just checked and it has gone through. So, yes, you should be able to use the keyword 'all' in reference to ALL of a given character's abilities or ALL macros you have access to in either a  --show  or  --hide  ...argument. And then you can proceed from there. So...examples... say you want to... Show ONLY Bob's "PotatoCraft" ability... !showbuttons --hide Bob|all --show Bob|PotatoCraft Show all macros except "UnstoppablePotato"... !showbuttons --show all --hide UnstoppablePotato Let me know if that isn't clear or if, for whatever reason, it doesn't work for you.
Timmaugh, Really appreciate you spending time on this. I can't get it work at the moment. Tried a combined hide all and show macro with no luck so set up a test macro "!showbutton  --hide 'Fighter 1'|all" hoping this would hide all token actions but it didn't hide any and produced a blank report. Tried in default and experimental mod library with same result.
1748010801
timmaugh
Forum Champion
API Scripter
*sounds of clanking metal and hammering* *perhaps some muttering*
1748010905

Edited 1748011072
timmaugh
Forum Champion
API Scripter
Can you confirm what version of ShowButtons you have? If you install the ScriptInfo script, then run: !scriptinfo ...you should get a panel with all of the scripts in your game that use Aaron's script-registration trick to store information (of which ShowButtons is one). What version does ShowButtons show as?
1748011492
timmaugh
Forum Champion
API Scripter
Yeah... it seems to be working for me...? Here is the result of a "--hide Igtharian|all" followed by a "--show" of an ability which was already showing (so it wouldn't show up on this report). All of the listed buttons disappeared, and the single one remained.
Timmaugh, Mines coming up with version 1.01. In the mod settings on the drop down it has latest or 1.01 so I guess that's the problem. I'll keep an eye open and see if version 1.02 comes up soon.
1748105144
timmaugh
Forum Champion
API Scripter
OK... I just checked the Roll20 repo and the new version IS there... If it doesn't come through automatically, let me know and I can try to get someone to look at what could be going on. But, additionally, you might be able to get the new version by removing the old one and reinstalling it from the 1-click. That would (hopefully) get the latest code into your game.
Timmaugh, Really appreciate you're patience with this. Tried deleting the script and reinstalling from the 1-click. When installing it only gives the v1.01 option.
1748435030
timmaugh
Forum Champion
API Scripter
There is apparently a manual step Roll20 must perform after performing the merge which they think did not happen last week. When they merge this week's requests and perform that step, the new code should deploy for you. I just checked the repo, though, and there are still pull requests sitting there (as of 8:30am ET) dating from a few days ago, so I'm not sure when the merge will happen or if it was missed. I'll try to stay on top of this and poke people if it doesn't happen today. =D
Timmaugh, Much appreciated. I'll keep checking in on my game and if I notice the update I'll let you know
Timmaugh, Looks like version 1.02 is updated now. Tested in game and the show or hide all works to perfection. Thank you so much for adding that feature which is a major game changer for our group.
1748606944
timmaugh
Forum Champion
API Scripter
Excellent! Let me know if you have any trouble are have suggestions for other features.