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

Accessing weapon attributes in "D&D 5e (2024) Sheet" macros

I've searched through various bits and pieces here, and it looks like previously we could access weapon attributes by doing `repeating_attack_$X_attr`, but it looks like we can't now. I can see there's a legacy attribute listed in the Attributes section, but I can't work out how to use it. Does anyone know if this is possible?
1740436321
Gauss
Forum Champion
Hi Tom HS, The D&D 5e 2024 by Roll20 character sheet is not built the same as previous character sheets. There are no attributes inherently exposed like in previous non-Beacon sheets. Instead the Devs need to expose the attribute intentionally.  At this time that means that most macros we would have made for previous sheets cannot be made with the 2024 sheet. If there is an attribute you don't see and would like exposed I would file a report with the Devs via the Help Center .
1740517579

Edited 1740517704
Nora C.
Roll20 Team
Hey gang! We actually did previously have the method Tom asked about working but some macro work might have affected that specific type of attribute. We've identified the cause and are sending the fix to testing. While we work on fixing that, there's a newer way to do things that we've confirmed is still working -   @{selected|repeating_attack("$0", "attr")}   will work for almost every property that previously existed. "$0" Here would be the place that the attack appears in on the list of attacks (since computers start counting from 0, the first item would be 0, second would be 1, That same repeating_attack() method also supports individual IDs, for what it's worth. I'm to be talking with the team to find a way to more easily expose those attack IDs to make a nicer experience with writing macros.
Is there a reason the syntax is different from the old repeating list item calls, and well, from all old attribute calls?
1740523821

Edited 1740523858
Nora C.
Roll20 Team
Again, the old syntax is also supposed to work, it is just broken right now. For the old syntax, we just break up the attribute you give us and feed it through the  repeating_attack() method behind the scenes The more technical reason is Beacon doesn't use repeating sections in the same way as legacy sheets - each sheet can be made with a variety of more modern Javascript frameworks that all have their own ways to do the equivalent of what our legacy system's repeating section tool has.
1740543290
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nora C. said: Hey gang! We actually did previously have the method Tom asked about working but some macro work might have affected that specific type of attribute. We've identified the cause and are sending the fix to testing. While we work on fixing that, there's a newer way to do things that we've confirmed is still working -   @{selected|repeating_attack("$0", "attr")}   will work for almost every property that previously existed. "$0" Here would be the place that the attack appears in on the list of attacks (since computers start counting from 0, the first item would be 0, second would be 1, That same repeating_attack() method also supports individual IDs, for what it's worth. I'm to be talking with the team to find a way to more easily expose those attack IDs to make a nicer experience with writing macros. Does this mean that if we use  @{selected|repeating_attack("$0", "name")} , we should expect chat to return the name of the first entry in the repeating attack section? Because I can't make that happen.
1740591558

Edited 1740591601
Nora C.
Roll20 Team
keithcurtis said: Does this mean that if we use  @{selected|repeating_attack("$0", "name")} , we should expect chat to return the name of the first entry in the repeating attack section? Because I can't make that happen. That would be because the names for repeating attacks on the 2014 sheet were stored under "atkname" , and we set up macros to work the same way on the 2024 sheet.
1740596856
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Nora! I have run some tests and have some questions: Since the documentation on the 2014 sheet and roll templates seems to have been removed from the Help Center last I checked, how is a user supposed to discover the attribute for the name of a repeating attack ("atkname", in this case)? It appears that only one query can be made per chat entry, otherwise the whole line fails. This makes anything like a Chat Menu impossible. It also makes any kind of macro that reports multiple bits information about a single repeating item impossible (say, an attack name and its damage). The index is taken from the Combat list pane of the character sheet. The indices are  counted from this list in order, but the reference only returns an answer if the item on that line is an attack. And an attack seems to be defined as anything that does damage. This includes things that do damage on a saving throw (Fireball), but exclude things with an attack roll that do not do damage (Telekinetic shove). This leads to a list that is rather arbitrary, with many unexpected gaps. Of the 17 items on my sample character's combat list, only 8 returned anything. As items are equipped or unequipped, the attacks and not-attacks appear or disappear from the list. This makes checking by index impossible if you want to keep a character macro consistent in behavior. The macro's behavior will constantly change if you switch from dagger to sword, for example. Checking by ID number is theoretically possible, but it is in no way exposed to the user, not even by use of the inspector. I understand that this is the first iteration and that some way of calling actions will come after this method of calling attribute names, but if this shows the path of the intended implementation, I can's see how any of this is intended to be used. This experience feels like the intent is to fill the letter of the feature, but does not address its intent or usability at all. Can you give an example of how this could be useful during actual play? The indexing is arbitrary, constantly changing due to equipage or spell load, only one attribute can be called at a time. This is not intended to be antagonistic, since the Devs have obviously spent time and effort making this work, but I want to understand what the intent is. I can't see any use for it in this present state. For reference, here were my calls. Each one had to be entered into its own chat message, they could not be called together either separated by returns or in the ad hoc fields of the default template. 0 - @{selected|repeating_attack("$00", "atkname")} 1 - @{selected|repeating_attack("$01", "atkname")} ... 17 - @{selected|repeating_attack("$17", "atkname")} // this last one is intended to fail. As you can see below, the error message is unreadable in light mode Also for reference, here is a screen shot of the test character's Combat slide:
We just did a bit of testing and were able to access multiple attacks and multiple attributes in one template, so it's possible that the macro is malformed, or possible that you're running into one of the "can't access this specific attack bug" that you noticed. I think there's a bit of confusion here that I'd like to clarify: these attributes are not the long-term path for the 2024 sheet. This is previous 2014 data backward compatibility, so the intention here is to support what people have done in the past. Once we've gotten over that hurdle, we can actually move forward and give access to the cool things people can do with our data instead of looking back. The intent is not to use this in some new way that we invented ourselves, but to make it possible to use macros that previously existed. That being said, we're not there yet, obviously. IDs will be available in the sheet as part of our token action supporting work, which we are currently in the middle of. We also have a few bugs logged for non-attacks or other combat options not showing correctly, because our attack list isn't exactly like the 2014 attack list. It is true that the indexes are in order, and if you change the list, then the indexes are then out of order. Unfortunately, we're not going to be able to resolve that because it's a reality of how indexing works.
Are these complet macros because none of them are working for me
1740701712

Edited 1740702862
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I could only get "Unarmed Attack" to respond today. None of the others that were working yesterday are working today. I tried on a different character and was able to get it to report correctly, though if there is a missing line the entire sequence fails: This works /w gm &{template:default}{{name=Attack Name text}}{{0 = @{selected|repeating_attack("$00", "atkname")}}}{{1 = @{selected|repeating_attack("$01", "atkname")}}}{{2 = @{selected|repeating_attack("$02", "atkname")}}} This returns an empty template: /w gm &{template:default}{{name=Attack Name text}}{{0 = @{selected|repeating_attack("$00", "atkname")}}}{{1 = @{selected|repeating_attack("$01", "atkname")}}}{{2 = @{selected|repeating_attack("$02", "atkname")}}}{{3 = @{selected|repeating_attack("$03", "atkname")}}} Trying to suppress the error message with  &{noerror}  made no difference.
keithcurtis said: I could only get "Unarmed Attack" to respond today. None of the others that were working yesterday are working today. I tried on a different character and was able to get it to report correctly, though if there is a missing line the entire sequence fails: This works /w gm &{template:default}{{name=Attack Name text}}{{0 = @{selected|repeating_attack("$00", "atkname")}}}{{1 = @{selected|repeating_attack("$01", "atkname")}}}{{2 = @{selected|repeating_attack("$02", "atkname")}}} This returns an empty template: /w gm &{template:default}{{name=Attack Name text}}{{0 = @{selected|repeating_attack("$00", "atkname")}}}{{1 = @{selected|repeating_attack("$01", "atkname")}}}{{2 = @{selected|repeating_attack("$02", "atkname")}}}{{3 = @{selected|repeating_attack("$03", "atkname")}}} Trying to suppress the error message with  &{noerror}  made no difference. Thanks Keith, Only worked for one of my players but its a start.
Nora C. said: Again, the old syntax is also supposed to work, it is just broken right now. For the old syntax, we just break up the attribute you give us and feed it through the  repeating_attack() method behind the scenes The more technical reason is Beacon doesn't use repeating sections in the same way as legacy sheets - each sheet can be made with a variety of more modern Javascript frameworks that all have their own ways to do the equivalent of what our legacy system's repeating section tool has. Is it really an upgrade if it means losing a standardised way of accessing data from sheets? As I understand, all this work on attributes on the 2024 sheet is backwards compatibility specific to that sheet, and as such inapplicable to any other beacon sheet. The more modern frameworks may be more convenient for people making the sheets, but if it makes data less accessible to users, that may not be a net benefit.