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

Repeating NPC action macro not going above 6

I am making a homebrew statblock for a tarrasque and it has 8 actions. I'm making token action for it to speed up combat once it ensues and I'm using %{selected|repeating_npcaction_$0_npc_action} for the macro. 0-6 work fine until I get above %{selected|repeating_npcaction_$6_npc_action}, once I get to 7 there is no more output. 
1675193657

Edited 1675194031
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Confirmed. That's very odd. I can't figure it out. No variation (such as adding a 0 before the 7, or trying a later number seems to work either. Edit: And no error message on 7, 8 or 9. Not unt il $10. Edit Edit: That should be #6 for Swallow, since numbering begins on $0. But it still doesn't display.
1675194146
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try deleting and re-importing the creature. I was able to get  {selected|repeating_npcaction_$6_npc_action} call up the Swallow action after that.
I tried deleting and re-importing the tarrasque after that, and it did work up to  {selected|repeating_npcaction_$6_npc_action}, but once I added another action and needed  {selected|repeating_npcaction_$7_npc_action} it didn't work.
There’s a bug that I’ve never fully tracked down that misnumbers repeating items. Try unlocking the section, moving an item, then locking it. Close the sheet. Reopen it, and reverse the process to put the item back into the last position and see if that works. If that’s what’s happening then probably for some reason the next one in the series is being numbered some higher number and there’s a gap for some reason, but reordering the section should hopefully reset the numbers. 
And you might interested in a similar but different approach:  5E Universal Chat Menu for PCs and NPCs . 
1675209075

Edited 1675209089
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jarren said: And you might interested in a similar but different approach:  5E Universal Chat Menu for PCs and NPCs .  Does that bypass the numbering re-order issue?
keithcurtis said: Jarren said: And you might interested in a similar but different approach:  5E Universal Chat Menu for PCs and NPCs .  Does that bypass the numbering re-order issue? Yes, possibly sort of inadvertently. If you have 7 repeating actions, but the last one gets misnumbered as #8, then the menu would hide the missing #7 and display #8. The limitation is that the chat menu is only set up to display up to 10 repeating actions, so if it got misnumbered as #11, then it just wouldn’t show up, but you also won’t see any error messages. 
1675334255

Edited 1675334780
Oosh
Sheet Author
API Scripter
This looks like a bug: The three legendary npcaction rows are pushing the indexing out by 3 - if you delete those first, then add your extra row, you'll find the indexing works as expected. Looks like someone forgot to terminate their regex/string match when grabbing everything in the repeating section in the indexing function :) Found that by sheer luck in about 30 seconds - my regex search to find the repeating rows in Tarrasque (I was actually looking for rows with bogus data) came back in just the right order to make the issue stick out like dogs' balls. Bascially, someone's done a match on 'repeating_${sectionName}' instead of 'repeating_${sectionName}_' with the significant trailing underscore. I'm sure every script author has done the same at some point.