Advertisement Create a free account

Nesting roll query inside an ability call

Okay (sorry in advance for the wall of text) so I have been reading the many topic posts about how to nest ability calls inside roll queries, and that this is a common problem for people fairly new to using these macro forms. I tried myself to apply this to a roll query that was supposed to select between different traits (using the Pathfinder Official sheet): ?{Which Ability?| 1,%{selected|repeating_abilities_$6_trait}| 2,%{selected|repeating_abilities_$7_trait}| 3,%{selected|repeating_abilities_$8_trait}| 4,%{selected|repeating_abilities_$9_trait}| 5,%{selected|repeating_abilities_$10_trait}| 6,%{selected|repeating_abilities_$11_trait}| 7,%{selected|repeating_abilities_$12_trait}| 8,%{selected|repeating_abilities_$13_trait}| 9,%{selected|repeating_abilities_$14_trait}| 10,%{selected|repeating_abilities_$15_trait}| 11,%{selected|repeating_abilities_$16_trait}| 12,%{selected|repeating_abilities_$17_trait}| 13,%{selected|repeating_abilities_$18_trait}| 14,%{selected|repeating_abilities_$19_trait} } But I quickly found out that there are problematic characters that have a tendency to 'break' the parser? of the roll query, which either ends the script or causes, in my case, all of the abilities to roll in chat all at once. From what I've found out, by many hours trial and error, it seems I can't make a roll query of these particular rolls without changing the script of the roll abilities themselves (i.e. the particular character sheet abilities and not the call text as seen above) by replacing the problematic characters. That would be incredibly tedious to do it for every ability before setting up the roll call itself. So I have thought of doing this in a different way, but I don't  know how to make it work, here it is: %{selected|repeating_abilities_$ %{selected|Line-Value-List} _trait} What I am looking to do above is the opposite of my initial method; how do I nest the roll query inside the ability call? This way all I'd have to know or list out is the line of the ability and that's it! But every time I try it, it breaks the ability call. I realize that the parser has an order to how it completes each type of roll (i.e. Ability, Macros, Attributes etc) so that might explain why it breaks the call, but idk I am very new to this. Any help would be appreciated. If anyone has suggestions for a better way to do it, please! :) I would be greatly appreciative.
Forum Champion
Innovative, but I suspect you are running into an order of operations problem, as you said. This Stupid Trick may or may not help:  Query Ordering Without Affecting Functionality
Yeah this is the problem I was afraid would happen. I'm not sure I am good enough at applying the Query ordering to do that, I had a try with the link you posted, but the ability call still proceeds before the roll query is finished. I was thinking that maybe it can be linked to an attribute, that provides the line number to call from, but then if you want to edit it quickly you either have to know already what each value represents or use an API to allow a macro to edit the value as one operation.
Scott C.
Sheet Author
API Scripter
I would actually recommend looking at a different stupid trick; chat menus . The problem you will run into trying to do this with roll queries is that there's no way to replace the problem characters in the called abilities, which is what is causing the break in your macro. With chat menus, you don't have to worry about html encoding.