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

Possibly just missing something...

1481406922

Edited 1481406998
[Deleted]
Sheet Author
Hey guys, I feel like I should know this, but it's slipping me right now. I'm trying to write a query to call a variety of macros, all pretty short stuff, just for consolidation's sake, but I seem to be unable to do it. It seems the only way to do this is to get the macro field to recognize the macro it is calling, with the drop down auto-fill list, otherwise, it does nothing. No big deal, just start over right? Heh, uh, no... When you auto-fill, it creates an extra [spacer] at the end. Now, you can't have that in a query macro, it doesn't work, so, remove the spacer right? Well, now it's not autocompleted, and the whole thing fails to do anything but output basic "#macro" text. Am I missing something or can you not condense macros like this? Which would be strange, considering that the only useful reason I can think of to reference macros inside macros is this....
1481407500
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Can you post the code that you're using? Both an example macro that is being nested and what your query macro looks like. I'm not quite understanding your point about not being able to have a space in the query.
#AttackBardBuff /me begins playing <a href="https://youtu.be/uT3SBzmDxGk" rel="nofollow">https://youtu.be/uT3SBzmDxGk</a> granting her allies a +[[{floor(@{level-class1}/4), 5}kl1]] to their attack! #ACBardBuff /me begins playing <a href="https://youtu.be/m9xqO9kKqyk" rel="nofollow">https://youtu.be/m9xqO9kKqyk</a> granting her allies a +[[{floor(@{level-class1}/4), 5}kl1]] to their AC! **Disclaimer, do not listen to the youtube links unless you like cello music. Bard-Buffs ?{Which Buff|Attack,#AttackBardBuff|AC,#ACBardBuff} ^results in nothing. It just spits out the blob #AttackBardBuff&nbsp;&nbsp; or&nbsp;&nbsp;&nbsp; #ACBardBuff without doing anything with the macro text. ?{Which Buff?|Attack,#AttackBardBuff |AC,#ACBardBuff } ^is how it wants me to write it, but results in a fillable text box that outputs errors no matter what I type in it.
1481409585
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
SFX said: Bard-Buffs ?{Which Buff|Attack,#AttackBardBuff|AC,#ACBardBuff} I would not use this form, as once it works, the contents of the macros will be displayed in the selection box instead of the macro call. See the&nbsp; order of operations wiki for more details. Note that the wiki is actually incorrect in one aspect; Attributes and abilities are expanded recursively up to 99 levels deep. Then roll queries are processed up to 99 levels deep. There is no (that I have found) reexpansion of attributes/abilities after the roll queries are entered. The problem that you are seeing where "#AttackBardBuff" is output to chat is because you need a space after the macro call: ?{Which Buff|Attack,#AttackBardBuff |AC,#ACBardBuff } This is because the macro parser reads from the hashtag through to the first space. If there is no space, it can't find a macro by the correct name. ^results in nothing. It just spits out the blob #AttackBardBuff&nbsp;&nbsp; or&nbsp;&nbsp;&nbsp; #ACBardBuff without doing anything with the macro text. ?{Which Buff?|Attack,#AttackBardBuff |AC,#ACBardBuff } ^is how it wants me to write it, but results in a fillable text box that outputs errors no matter what I type in it. Either of these will work, but I would recommend this second one for better display. The problem that you are having with this one is with your nested macros, not the query itself. Roll queries end at the first end curly brace they encounter. Since rolls are processed after roll queries, the end curly brace and comma in your grouping for the keep highest are still there which causes an improper parse of the selection or an end to the query respectively. The way around this is by using html escapes (one escape for every roll query inside which you are nesting) in place of problem characters. See the&nbsp; Advanced roll query wiki for more details.
Ahh.... so yeah, I was just being dumb then... I knew about html escapes and didn't think to apply it, derp
1481410115

Edited 1481410166
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
heh, I only realized it because I just spent the last two days pounding my head against the exact same issue while setting up some fairly complex macros for a pathfinder game I just started in (the game doesn't use the pathfinder character sheet), Otherwise I wouldn't have realized it at all.
So, now I'm hitting this wall. I've got the one macro Bard Buffs ?{Which Buff?|AC Buff,/me begins playing <a href="https://youtu.be/m9xqO9kKqyk" rel="nofollow">https://youtu.be/m9xqO9kKqyk</a> granting her allies a #BardBuff to their AC!|Attack Buff,/me begins playing <a href="https://youtu.be/uT3SBzmDxGk" rel="nofollow">https://youtu.be/uT3SBzmDxGk</a> granting her allies a #BardBuff to their attack!} Which just seems more stable... #BardBuff +[[{floor(@{level-class1&#125;/4)&#44; 5&#125;kl1]] and I get TypeError: c is undefined Not sure where I'm messing up now, but it again, feels like something I should know....
TypeError: c is undefined Attribute calls (e.g. @{level-class1}) that are not placed within one of tabs of a Character Window (e.g. within a field on the Character Sheet Tab or within an Ability on the Attributes & Abilities Tab ) must use a keyword to let the parser know which Character you intend to call that Attribute from (e.g. @{selected|level-class1}).
1481419663
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Woops, sorry, forgot to point that out.
SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "A" found. Fixed #BardBuff to read: +[[{floor(@{Aella&#124;level-class1&#125;/4)&#44; 5&#125;kl1]] Half the time, it gives me a popup with half the macro written in it, half the time, I get the above error.
1481421931
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The problem with doin these as global macros is that the global macros eat the html replacements when you open and resave them. Make sure your problem characters are still escaped: +[[{floor(@{Aella|level-class1}/4)&amp;#44; 5&amp;#125;kl1]]
1481423464

Edited 1481423491
[Deleted]
Sheet Author
OOOOOOOOOOOOOOOOOOOOO Every time you open the macro, you have to retype the &; characters.... That's why mine kept messing up lol. I got it now though, tyvm for the help guys. :D
1481425526
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
glad you've got it working.