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

Character atribute Query

1559670509

Edited 1559670567
Why does this not work? @?{who|Character1,{Devron|Character2,{Marked|Selected,{selected}|character_backstory} Assuming of course there is a Devron and Marked characters and that the OGL 2.0 Character sheet has the "character_backstory" attribute. It produces  "@{Devron|character_backstory}" instead of "born on a dark and stormy night.." I want to include this query on pretty much all my macro's so I don't have to constantly rely on "selected" or making separate macros per character.
1559673217

Edited 1559673409
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This is due to the order of operations . The short summary of which is: Abilities then Attributes then queries then inline rolls then slash command rolls (like /r and /gmroll) and finally one level of html replacement. EDIT: reviewing the order of operations, I also realized the wiki has some incorrect information. Step 5 in the order of operations does not exist, or rather roll queries are handled after the iteration has been done.
1559675711
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Question: Step 3, "Variables are substituted". Does that mean attribute calls?
1559676884
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
keithcurtis said: Question: Step 3, "Variables are substituted". Does that mean attribute calls? Yep.
Well I tried making the query a nested ability, which still didn't work as it didn't run the whole ability, just cut/pasted it in. @{%{MrMacro|CharaList}|character_backstory So is this a lost cause, or can there be a work around?
1559698636
GiGs
Pro
Sheet Author
API Scripter
There's no way to build an attribute call from its parts.  Scott mentioned the order of operations above. The first thing roll20 does when resolving a macro, is look up attributes. So it tries to run this @{%{MrMacro|CharaList}|character_backstory before it looks up the %{MrMacro|CharaList} value, so there's not a complete attribute and it fails.
1559704094
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
GiGs said: There's no way to build an attribute call from its parts.  Scott mentioned the order of operations above. The first thing roll20 does when resolving a macro, is look up attributes. So it tries to run this @{%{MrMacro|CharaList}|character_backstory before it looks up the %{MrMacro|CharaList} value, so there's not a complete attribute and it fails. Actually, the abilities are expanded first, but they aren't "run". So the query in the ability isn't run. As an example, let's say you have the following ability: Test Now, let's say you have the attribute call above: @{%{MrMacro|CharaList}|character_backstory} This will be expanded so that the parser sees an attribute call that looks like this: @{test|character_backstory} This doesn't help with the ask in this thread of course, since if you used a roll query instead of just test, you'd get the following attribute call: @{?{query|option 1|option 2}|character_backstory} but since the query isn't resolved until after the attribute call, it doesn't work.