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
This post has been closed. You can still view previous posts, but you can't post any new replies.

NPC Actions as Token Action Ability

I was using the following Ability: ```%{Selected|NPCAction1} ``` &nbsp;with the "show as Token Action" checkbox checked to add a Token Action for attacks/abilities. However I have somehow manage to break it! I switched over to the Darker Dungeon character sheets, from the Roll20 5e sheet, to check it out and then switched back after, after some weeks, fiddling around with it. Now the Token Actions are giving me the following error: ``` No ability was found for %{Selected|NPCAction1}``` I am not sure if this issue is a result of an non backwards compatible API update or if it was as a result of the switch. I did some googling and trawling through the forum looking at changelogs but didn't turn up anything useful. I am pretty new to Roll20 but am an experienced programmer and like to think I would be able to navigate my way around macro construction however I am struggling a little. Is there any way of telling reliably from the sheets what the names for each of the attributes/actions/abilities are? I did find the docs for the char sheet ( <a href="https://wiki.roll20.net/DnD5e_Character_Sheet" rel="nofollow">https://wiki.roll20.net/DnD5e_Character_Sheet</a> ) but it provides little to no info about the NPC actions. Also tried dev tools inspecting the markup for any pointers and turned up some of the command names in the value attributes of the hidden inputs, but again I couldnt find anything related to NPC actions. Any pointers would be appreciated
1556412260
GiGs
Pro
Sheet Author
API Scripter
You can find the character sheet html on roll20's github , and examine the sheet there for attribute names. If this was caused by the campaign switch (not sure why that would cause it, though it could bloat your sheet with unneccessary attributes), you might be able to roll the sheet back to a date before you switched campaigns. You can find an option for that in the campaign settings page.
Hmmm, I don't actually see a "roll back option anywhere on the&nbsp; campaigns/campaignsettings /id page. Although it would be a pain to roll it back to where I was before as I have added a bunch of stuff since then. Any other ideas floating about?
1556468142
The Aaron
Roll20 Production Team
API Scripter
Rolling back is a Pro feature, I believe.
Hello Tarquin, Rolling back is Pro feature. However, I will pass this along to the devs.&nbsp; So they can provide additional assistance, please let us know what the name of the campaign this issue is happening in. Thanks.
1556470025

Edited 1556470307
I feel like it must just be an API change or Bug. I created a fresh campaign to test it out (ID: 4579198) . I set the character sheet to 5e Roll20, made an NPC, gave it an attack action and added an ability to roll the attack action with the macro: %{Selected|NPCAction1} and it gave me the same result. The error: No ability was found for %{Selected|NPCAction1} I am using Chrome latest (74.0) and Windows 10.
1556471327

Edited 1556471453
This is what I use for attacks as token actions. %{selected|repeating_npcaction_$0_npc_action}
I was just debugging through the code and found an object with a list of actions which included that in it, although it had the index of the action rather than the "$0", which i am assuming gets replaced. The object, which is: d20.journal.customSheets.availableRolls also prints out the following macros, if you're interested. <a href="https://pastebin.com/jiEDecjV" rel="nofollow">https://pastebin.com/jiEDecjV</a> I can tell the code is is pretty old and been iterated on for quite some time, even in its transpiled state. Looks like a nightmare to maintain.&nbsp; This will sort my issue though, thanks Mike
Hey Tarquin, Did Mike's advice help you out?
Yeah it did, thanks.