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

Roll query not working right

I've been trying to write a macro that uses a roll query with a roll template to do my character's attack or optionally full attack in one roll template. I put the two iterative attacks in a single roll query and to just do a single attack I just hit backspace to clear the roll query so the iterative text shouldn't be in the macro. However I'm having three issues: (1) when removing the iterative text in the roll query when it pops up, the second iterative still shows up in the roll template, (2) I get a malformed roll query between the "Iteratives?" query and "Hasted?" query that says " STR mod? +?{Attack modifiers?: " with a default value of "0", (3) said malformed query appears to have replaced the "STR mod?" query specifically in the attacks of the first iterative and the haste attack, but not in the crit confirm for those attacks. Here's the macro in question (sorry for wall of text): &{template:pf_generic} {{character_name=Rock}} {{name=Attack}} {{Main=[[1d20 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6} +1 +floor(?{STR mod?|@{Strength}}*1.5) +?{Bonus dmg?|0}]] [[1d20 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6}+?{Weapon damage?|2d6} +2*(?{STR mod?|@{Strength}} +?{Bonus dmg?|0})]]}} ?{Iteratives?|{{It.1=[[1d20 -5 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6} +1 +floor(?{STR mod?|@{Strength}}*1.5) +?{Bonus dmg?|0}]] [[1d20 -5 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6}+?{Weapon damage?|2d6} +2*(?{STR mod?|@{Strength}} +?{Bonus dmg?|0})]]}} {{It.2=[[1d20 -10 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6} +1 +floor(?{STR mod?|@{Strength}}*1.5) +?{Bonus dmg?|0}]] [[1d20 -10 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6}+?{Weapon damage?|2d6} +2*(?{STR mod?|@{Strength}} +?{Bonus dmg?|0})]]}}} ?{Hasted?|{{Haste=[[1d20 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6} +1 +floor(?{STR mod?|@{Strength}}*1.5) +?{Bonus dmg?|0}]] [[1d20 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]][[?{Weapon damage?|2d6}+?{Weapon damage?|2d6} +2*(?{STR mod?|@{Strength}} +?{Bonus dmg?|0})]]}}} I would think that the roll queries that get called in the Main attack should set the values for their respective calls later in the macro so that the "Iteratives?" and "Haste?" queries would see the input values, but it appears to go top to bottom cross-referencing any new queries with ones already found. Is there a way around this/some way to make a functionally similar macro?
1429618532

Edited 1429618543
Gen Kitty
Forum Champion
Sadly, these are the kinds of macros that make my eyes glaze over. Those who know: Do roll templates HAVE to be in one long line of characters or can they use white space to better organize sections? Ok, the first thing that catches my eye is this: {{Main=[[1d20 +1 +@{class-0-bab} +?{STR mod?|@{Strength}} +?{Attack modifiers?|0}]] I know nothing about roll templates, but I do know about [{( matching )}] and I'm troubled by the extra } after strength. Additionally, you can not use a roll-query to reference an attribute-call. Go through your macro and doublecheck that you have perfectly matching {} () and [], and then remove all your roll-queries that try to summon attributes. For {} matching, I strongly suggest picking up notepad++ and enable one of the programming modes that checks for matching. (I will edit this post when I'm on the desktop and have my notepad++ in front of me)
1429628489
Lithl
Pro
Sheet Author
API Scripter
GenKitty said: I'm troubled by the extra } after strength. That closing brace matches the open brace for the roll query; no problem there.
1429630731
The Aaron
Pro
API Scripter
Brian said: GenKitty said: I'm troubled by the extra } after strength. That closing brace matches the open brace for the roll query; no problem there. Are you sure about that? it's on the end of an @{strength}, @{strength} } would seem like an error...
1429631007

Edited 1429633197
Ziechael
Forum Champion
Sheet Author
API Scripter
The Aaron said: Brian said: GenKitty said: I'm troubled by the extra } after strength. That closing brace matches the open brace for the roll query; no problem there. Are you sure about that? it's on the end of an @{strength}, @{strength} } would seem like an error... I thought that, but he's right: ?{STR mod?|@{Strength}} even though the query won't work since it is calling an attribute...
1429632410
Gen Kitty
Forum Champion
Everyone's right who said it is closing the roll-query. That's what I get for peering at intricate macros at the end of my day without notepad++ to do {} matching for me :>
1429633897
The Aaron
Pro
API Scripter
Ah, so it is!
Sadly in my brief testing with roll templates it does not look like you can have part of it be on a new line to format nicer. When you say I can't use roll queries to reference an attribute-call, do you mean the "?{STR mod?|@{Strength}}" query shouldn't work? When I click the macro that works fine, it properly fills in the default value of @{Strength} (in this case 5). I just went through and double-checked the braces and they all match just fine. One thing I did notice when using the macro though was that for the "Iteratives?" and "Haste?" prompts, they only display a little bit of the roll queries default value (only shows "{{It.1=[[1d20 -5 +1 +10 +?{STR mod?" for instance). I'm wondering if that's the source of the issue, where the roll query prompts for that little chunk of the iterative/haste attack and still puts in the rest of the default value regardless of whether I keep or remove the prompt text, and secondly the position of the "STR mod?" query so it gets a little messed up by being split by the initial query.