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

MORE broken code GRRRRRRRR

I took a 1.5 year hiatus from Roll20 and I swear I have had so much trouble with my old code no longer working. I'm trying to add Lair Token Actions to my red dragon and the code spits out blank text: see the screen shots: This is my code, with the token action above and the blank. Note that the code for Multiattack above it works perfectly fine. Below is my character sheet with "magma erupt" in the 6th action. Everything above it works fine. The two Lair actuons below it also do not work:
1609950748
Jordan C.
Pro
API Scripter
What happens if you enter just the contents manually into chat? Is it the same result?
It does the same thing. Blank
1609952092

Edited 1609953243
Jordan C.
Pro
API Scripter
Hmm, I am having the same issue now when I create custom entries in repeating sections. I'm not sure if this is a known issue or not.  As a temporary solution, you can call the ability directly by finding the ID of the repeating attack in the Developer Tools (ctrl+shift+i for windows chrome). I can walk you through that if that's the route you want to take and need help grabbing it. It would end up looking something like this: %{Adult Red Dragon|repeating_npcaction_-MQNaCZh9K-kG0LXP-of_npc_action} Edit: Weirder still, it only happens on Red dragons so far for me.
OOF. That's a lot of code. Id love it if you walked me through
1609954064

Edited 1609954256
Jordan C.
Pro
API Scripter
Sorry I gave the complicated way originally - here is the easiest: Go to the action as if you were going to click it from the character sheet. Instead, click and hold to drag it down to the macro bar which will make a button for it. From there you can click the button, cursor into the chat window, then press the Up Arrow to see what the chat output was. Copy paste that into the ability. Here are some screenshots: Button Created by Dragging - Chat Command Sent by Button - 
Perfect. That Worked! Thank you! Can I trouble you with another strange issue I am  having?
1609955803
Jordan C.
Pro
API Scripter
Go for it!
You know. I took care of the problem using your same method above. Unless you would like to hear it, for future reference?
1609956755
Jordan C.
Pro
API Scripter
Couldn't hurt for anyone that stumbles across a similar problem and needs the solution!
1609957558

Edited 1609957709
Same Red Dragon character sheet. I have the trait "Varient Spell Casting." Originally when I made this character sheet (about 1.5 years ago) I had the following spells in the copy: Chromatic Orb, Scorching Ray, Fireball, Wall of fire, Wall of Stone. Today, I edited that copy so that the spells are now: Fireball, Wall of Fire, Wall of Stone, Cloudkill, Immolation When I used the editted token action the old copy was still showing (except if I used the button directly from the character sheet). I fixed it with your method but interestingly when I copied my old code back into the token action, it reverted back to showing the old incorrect copy in the chat window.
1609957958

Edited 1609958569
Jordan C.
Pro
API Scripter
Hmm this is getting interesting; that falls in line with something I just discovered on my end. There appears to be ghost actions somewhere in the sheet because after continuing past the number of actions that dragon had, it would still return blank when it should  be returning an error along the lines of  You tried to use the repeating section row at index 10 for repeating_npcaction, but there doesn't seem to be a row at that index. Funnily enough, when I got to $9 in my instance, the attack I created was returned. So for actions $6-$8 there are just blank, ghost actions. This might explain your scenario if when you deleted the action it wasn't actually deleted and instead the new trait just filled in the next number. So if you tried "repeating_npctrait_$2..." instead of $1 I would bet that you get the new description. These screenshots illustrate what I mean (hopefully): Results after adding a new action - 
Actually no. I put in a "2" and I got the error you described above: You tried to use the repeating section row at index 2 for repeating_npctrait, but there doesn't seem to be a row at that index. No attribute was found for @{selected|repeating_npctrait_$2_name} You tried to use the repeating section row at index 2 for repeating_npctrait, but there doesn't seem to be a row at that index. No attribute was found for @{selected|repeating_npctrait_$2_desc}
1609958711
Jordan C.
Pro
API Scripter
Verrrry strange... I imagine that issue in particular might go away if a new dragon is created then. For what it's worth, this seems to be the case for all dragons as far as I can tell.
Though I do like your solution I wish I new the source of the problem better. I have a lot of custom monsters and monster templates that might be screwed up.I also dont like that it no longer shows the name of the creature in the chat window stat block.
1609959436

Edited 1609959512
Jordan C.
Pro
API Scripter
I would think custom monsters and new monsters would be fine, since I imagine this is an issue that came about from the creation of the monster for the Monster Manual and the transitions Roll20 made to sheets, though it would be hard to say without going through all of them and trying to find the common issue. As for the name in the template that should  just be resolvable by going into the settings and changing "hide" to "show"
I do have it set to show. I think it's because the code was copied form the macro bar, which isn't tied to a specific character sheet. Is It?
1609962622

Edited 1609964698
Jordan C.
Pro
API Scripter
Quick Edit: the code is linked directly to the sheet since the ID is specifically for that characters attack and no other attack can share that ID. Ah, I never notice this issue before. The output calls "@{ Character |charname_output}" which turns into {{charname= character_name }} but the traits template uses {{source= source }} ( it looks like previously it was the npc atk template? ) You can 'hack' this in the trait description, or you can add "{{source=@{selected|character_name}}}" to the ability macro which would look like this: %{selected|repeating_npctrait_$0_-npc_roll_output} {{source=@{selected|character_name}}} This version is good for monster template sheet abilities. To 'hack' the trait description you would do something like this: Trait description}} {{source=Character Name This makes it so even pressing the button shows the template you are looking for but it would require manually changing each description.
Jordan C. said: Hmm this is getting interesting; that falls in line with something I just discovered on my end. There appears to be ghost actions somewhere in the sheet because after continuing past the number of actions that dragon had, it would still return blank when it should  be returning an error along the lines of  You tried to use the repeating section row at index 10 for repeating_npcaction, but there doesn't seem to be a row at that index. Funnily enough, when I got to $9 in my instance, the attack I created was returned. So for actions $6-$8 there are just blank, ghost actions. I discovered this little bug as well when creating new actions for custom NPCs. Not sure if it only occurs for the D&D 5E by Roll20 sheet or others, but there's actually a simple fix.  If you ever have this happen, or create a new action/trait/legendary action/reaction and your repeating commands aren't working, click on the unlock button for that section, and move an item (I typically just move the bottom item up). Lock the section. Unlock, and move the item back into its original place. That 'resets' the counter reference on the items and they'll be listed as $0, $1, $2, ... $n again.
1610022800
Jordan C.
Pro
API Scripter
That's a nice trick!
1610090384
Oosh
Sheet Author
API Scripter
You can also check the repeating row order with @{selected|_reporder_npcaction}, though the Attribute may not exist if no rows have ever been moved.
I'm having this issue again with traits this time. Its showing the description of the monster tried I made a copy of, instead of the new copy I added. I tried your trick Jarren. but it didn't work. Perhaps its because there is only one reaction to begin. I tried adding a 2nd trait to attempt this trick and it still didn't work. Jordan's trick works. but its a band aid, and it's bunking up my monster creation process? any other suggestions?
Dan K. said: I'm having this issue again with traits this time. Its showing the description of the monster tried I made a copy of, instead of the new copy I added. I tried your trick Jarren. but it didn't work. Perhaps its because there is only one reaction to begin. I tried adding a 2nd trait to attempt this trick and it still didn't work. Jordan's trick works. but its a band aid, and it's bunking up my monster creation process? any other suggestions? Hmm, everywhere I've done this has reset the ability numbering.  Are you able to get the trait to fire with a different number? What is the macro you are using?