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

Macro Query for Character Name to get Ability

Hey all, I'm trying to have something like 1d10+Char1Ability>1d10+Char2Ability but I'd like to query for the character name of these. Currently I have: @{Name}: [[?{Attack Extra Die?|No, 1|Yes, 2}d10+@{Attribute}]] VS\n ?{Faction|f1|f2|f3|f4} :[[?{Defend Extra Die?|No, 1|Yes, 2}d10+@{Faction|Attribute}]]}} These are currently character abilities. The issue is that every time I have an @ it defaults to the current sheet attribute name (so I end up with [this]|attribute as text). Is this even possible? Thanks all!
It would be helpful if you say which game and character sheet you are using and the actual macro you are using (cut and paste to see if there’s any errors). 
1660828094
Ziechael
Forum Champion
Sheet Author
API Scripter
You can't use a query to set a value and use that as part of an attribute call, you'll need to nest everything within the query: @{Name}: [[?{Attack Extra Die?|No, 1|Yes, 2}d10+@{Attribute}]] VS\n ?{Faction|f1,f1 :[[@{f1|Attribute}|f2,f2 :[[@{f2|Attribute}|f3,f3 :[[@{f3|Attribute}|f4,f4 :[[@{f4|Attribute}} + ?{Defend Extra Die?|No, 1|Yes, 2}d10 ]] You'd need to replace each instance of f1,f2,f3,f4 etc with the faction/sheet name but the above should do it.
@Jarren While I appreciate the offer and the effort that would take that's not really my goal here. I'd rather find the root cause than have someone have to interpret my code and then I have to interpret their answer. Plus the character sheet doesn't actually matter cause I added the 3 abilities with a mod, so all of this is custom anyway. @Ziechael Thanks! I had to modify it a bit to fit but learning that I can't query an attribute call is exactly what I wanted to know and you example worked great!
1660905829
Ziechael
Forum Champion
Sheet Author
API Scripter
No worries, glad it helped. The key to queries is to only put what you absolutely have  to in them. Anything that applies to every outcome should be left out of the query where possible. My example highlights that by putting the 'Defend extra die' query at the end instead of the beginning so that you didn't have to mess with html replacements due to having a query within a query :) Always happy to chat macros though, so any other issues, questions or learning curves I can help to smooth out, never hesitate to ask!