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 .
×

[Bug?] Can access some repeating attributes from chat, but not from the API?

1458349103

Edited 1458383688
I've noticed that some repeating attributes can be referenced from the chat, but not from the API. For example, I'm using the 5E Shaped Character sheet, and in the chat window I can enter: input: @{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote} output: {{emote=}} However, if use `sendChat("Zzzax", "@{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote}")` within a script, I get the error: Error: Unable to find attribute named repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote for character Zzzax(-K89cK2F-k7OcZp2cETQ) in chat command. This is far from the only attribute I've found with this problem. I wouldn't really care, except I'm trying to work around a similar issue with repeating abilities, since I can use the chat window to use repeating abilities input: %{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_SpellCast} output: ... (properly templated output) ... but again, not the API, as `sendChat("Zzzax", "%{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_SpellCast}")` gives me the error ERROR: Unable to find ability repeating_spellbooklevel1_SpellCast for character Zzzax I've tried using the new `$0` syntax instead of the UUID, but that doesn't seem to make a difference. I've also tried creating a wrapper ability that calls `%{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_SpellCast}`, but even though `%{Zzzax|wrapper}` works in the chat pane, `sendChat("Zzzax", "%{Zzzax|wrapper}")` produces ERROR: Unable to find ability repeating_spellbooklevel1_SpellCast for character Zzzax
1458354442
The Aaron
Pro
API Scripter
What happens if you use getAttrByName(charId,'repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote')
I get Error: No attribute or sheet field found for character_id -K89cK2F-k7OcZp2cETQ named repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote
1458385813

Edited 1458387340
Lucian
Pro
API Scripter
For the record, I also get this behaviour. I can't get abilities within repeating sections to execute via the API sendChat even though the same thing works in the chat window. Interestingly, I don't get errors, it just spits out the expression I put in with the %{} stripped off the outside.   EDIT: Weird, I was sure I didn't get an error in the log before, but now I do - the same one as Noah. It *also* spits out the stripped version in the chat window. Bug?
Lucian, when I use sendChat() with a repeating section's ability, I get the expression with the %{} stripped off output to the chat window too, I'm seeing the Error messages in the API Output Console.
1458387486
Lucian
Pro
API Scripter
Noah E. said: Lucian, when I use sendChat() with a repeating section's ability, I get the expression with the %{} stripped off output to the chat window too, I'm seeing the Error messages in the API Output Console. Yeah, sorry, I think I was confused. I can get getAttrByName and findObjs({..}) to work for attributes in repeating sections though. You might want to try checking the casing of your ids, or using findObjs with&nbsp;{caseInsensitive:true}. The API is particular about the casing of attribute names in a way that the rest of the system isn't (see&nbsp;<a href="https://app.roll20.net/forum/post/3051396/unhelpful-discrepancy-between-getsectionids-and-findobjs/?pageforid=3051396#post-3051396" rel="nofollow">https://app.roll20.net/forum/post/3051396/unhelpful-discrepancy-between-getsectionids-and-findobjs/?pageforid=3051396#post-3051396</a>).
1458387641
Lucian
Pro
API Scripter
Noah E. said: I get Error: No attribute or sheet field found for character_id -K89cK2F-k7OcZp2cETQ named repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote Also, are you sure that the spell in question has an emote? Attributes are lazily created, so this field might not exist even though the repeating section does and other attributes can be accessed ok. Try with&nbsp; getAttrByName(charId,'repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_name') and see what happens.
1458387987
Lucian
Pro
API Scripter
Hmmm. I've just noted on my bug report that there's a suspicious similarity between some of the stuff I reported&nbsp; here and what's going on here - note how the error messages include repeating section references with the IDs stripped out in both cases. I think Roll20 are doing something really broken with repeating section references somewhere...
Lucian H. said: Noah E. said: I get Error: No attribute or sheet field found for character_id -K89cK2F-k7OcZp2cETQ named repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote Also, are you sure that the spell in question has an emote? Attributes are lazily created, so this field might not exist even though the repeating section does and other attributes can be accessed ok. Try with&nbsp; getAttrByName(charId,'repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_name') and see what happens. I can access some repeating attributes (spellname for one) but not others. If lazy creation were an issue than wouldn't `@{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote}` in the chat window not show me anything? As it is, it shows me `{{emote=}}`, which is correct. (note I'm looking up spell_var_emote, not spellemote) If capitalization were an issue, then I'd expect `sendChat("Zzzax", "@{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_SPELLNAME}")` not to work, but it does.
1458390536
Lucian
Pro
API Scripter
Noah E. said: If lazy creation were an issue than wouldn't `@{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_spell_var_emote}` in the chat window not show me anything? As it is, it shows me `{{emote=}}`, which is correct. Ah sorry, I should have read more carefully. &nbsp;I have a *bad* feeling that this may be related to the fact that the sheet doesn't obey the rules laid out by rule20, which state that attribute names must be unique across the whole namespace of the sheet, not just within their section. What happens if you delete all but one spell and then try again? If capitalization were an issue, then I'd expect `sendChat("Zzzax", "@{Zzzax|repeating_spellbooklevel1_-KD0r0iG5mJQkV1mYgSn_SPELLNAME}")` not to work, but it does. Capitalisation is an issue for findObjs and possibly also getAttrByName. When you sendChat it uses a different system. Lucian
1458398886
The Aaron
Pro
API Scripter
Also note that sendChat() and the chat panel in game have different parsers. Working in one (sadly) is not an indicator it will work in the other.&nbsp;
1458398934
Lucian
Pro
API Scripter
The Aaron said: Also note that sendChat() and the chat panel in game have different parsers. Working in one (sadly) is not an indicator it will work in the other.&nbsp; Indeed. That's exactly what's giving rise to the issue we're seeing, I guess. :-(
1459015656
Lucian
Pro
API Scripter
Good news: <a href="https://app.roll20.net/forum/post/3123867/api-sendchat-cant-trigger-repeating-section-abilities/" rel="nofollow">https://app.roll20.net/forum/post/3123867/api-sendchat-cant-trigger-repeating-section-abilities/</a>
Lucian - glad to hear it's working for you, but running repeating actions is still a problem for me in the 5E Shaped character sheet. Using the chat window to input: %{Nozzlefizz|repeating_spellbooklevel2_$1_SpellCast} gives me whereas in a script, using sendChat("Nozzlefizz", "%{Nozzlefizz|repeating_spellbooklevel2_$1_SpellCast}") yields with a whole host of errors: "Error: Unable to find attribute named repeating_spellbooklevel2_1_spellconcentration for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spellritual for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_description for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_higher_lvl for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_attack for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_attack_damage for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_attack_second_damage for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_attack_crit for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_save_second_damage for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_bonuses for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_healing for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_source for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_toggle_gained_from for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named spellcomponents_material_var for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named spell_var_emote for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named spell_var_save for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named spell_var_save_damage for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named spell_var_effects for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." "Error: Unable to find attribute named spell_var_output_higher_lvl_query for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command." Different than it used to be, but still non-functional. It seems like some attributes work, some don't. For example, both the chat window and `sendChat` evaluate `@{Nozzlefizz|repeating_spellbooklevel2_$1_spellname}` to "Shatter". By contrast, entering @{Nozzlefizz|repeating_spellbooklevel2_$1_spell_var_emote} in the chat window yields {{emote=evokes a sudden loud, painfully intense, ringing noise}} but in a script, using sendChat("Nozzlefizz", "@{Nozzlefizz|repeating_spellbooklevel2_$1_spell_var_emote}") sends Nozzlefizz|repeating_spellbooklevel2_$1_spell_var_emote to the chat window, and logs the following in the API output console "Error: Unable to find attribute named repeating_spellbooklevel2_1_spell_var_emote for character Nozzlefizz(-K8-O8mHzyqS3szpPr92) in chat command."
1459152358
Lucian
Pro
API Scripter
Hey - could you post a new bug in the bugs forum, linking to the old post and saying that the issue isn't completely fixed?