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

Nesting a Rollable Query within a Rollable Query for a Macro

1522350966

Edited 1522351010
So I've been playing around with a macro to make a macro for an advanced combat weapon with multiple ammo types on two different firing setting that affect the to hit chance. Here is what I have so far: /em ?{Stablised?|  Yes,   /em Stabilises her rifle and lines up to fire ([[d20+37]]) hitting for, ?{Ammo Type?| Armour Piercing, [[5d10+10]] with 25% armour bypass with her Armour Piercing Rockets. | Heavy Electronic Piercing, [[6d10]] with stun for [[1d6]] turns and has a 25% armour bypass with her Heavy Electronic Piercing Rockets . | Armour Piercing Fragmentation, [[1d8+3]] on direct hit and [[1d6+2]] for up to 330ft away with a 15% ([[d100]]) chance to shred 40% of armour and 20% of damage will bypass armour with her Armour Piercing Fragmentation Rockets. | Fragmentation, [[2d8+6]] on direct hit and [[2d6+4]] for up to 330ft away with a 20% ([[d100]]) chance to shred 50% of armour with her Fragmentation Rockets. | Concussion, [[2d4+4]] on impact with 85% ([[d100]]) chance to stun, 45% ([[d100]]) chance to deafen, 45% ([[d100]]) chance to blind from debris and 15% ([[d100]]) chance to knock prone. } |   No, Character fires her rifle unstablised for quickness or for emergency effect, lines up to fire ([[d20+37]]) hitting for, ?{Ammo Type?| Armour Piercing, [[5d10+10]] with 25% armour bypass with her Armour Piercing Rockets. | Heavy Electronic Piercing, [[6d10]] with stun for [[1d6]] turns and has a 25% armour bypass with her Heavy Electronic Piercing Rockets. | Armour Piercing Fragmentation, [[1d8+3]] on direct hit and [[1d6+2]] for up to 330ft away with a 15% ([[d100]]) chance to shred 40% of armour and 20% of damage will bypass armour with her Armour Piercing Fragmentation Rockets. | Fragmentation, [[2d8+6]] on direct hit and [[2d6+4]] for up to 330ft away with a 20% ([[d100]]) chance to shred 50% of armour with her Fragmentation Rockets. | Concussion, [[2d4+4]] on impact with 85% ([[d100]]) chance to stun, 45% ([[d100]]) chance to deafen, 45% ([[d100]]) chance to blind from debris and 15% ([[d100]]) chance to knock prone. } } Every modification I make to make this work still has it where the it accepts the Yes/No but then prints the entire rest of the choice in the chat rather than open a second query for each ammo type. Is their anything I can do to fix this or is there anyone with significantly more macro experience to walk me through on how to make this thing actually work? I am asking because this macro is the start of a series like this to ease the problems of my players I'm GM'ing for in a game.
1522351942

Edited 1522352265
Dana Lexa
Sheet Author
When you nest a roll query inside another query, you need to  escape some of the characters . In this case, when you reach the first } it will close the first query, even though you want it to only close the second query, about ammo. Replace that } with }
1522352318
vÍnce
Pro
Sheet Author
Have to love the forums eating special characters as snacks.  ;-P
Vince said: Have to love the forums eating special characters as snacks.  ;-P 8th time's the charm
1522352684

Edited 1522352793
Dana Lexa
Sheet Author
Also, King, "," is another special character so you'll need to escape the commas that are just part of the sentence structure and not separating the option label from the option value. Also be careful when you edit (I'd recommend editing the macro in a separate text box and pasting it into the macro field each time), as, if I recall correctly, it will revert the HTML entities into back to the regular characters when you edit, forcing you to replace them again.
1522353030

Edited 1522353953
Okay here is the updated formula and the same problem happens. ?{Stablised?| Yes, Character Stabilises her rifle and lines up to fire ([[d20+37]]) hitting for, ?{Ammo Type?| Armour Piercing, [[5d10+10]] with 25% armour bypass with her Armour Piercing Rockets. | Heavy Electronic Piercing, [[6d10]] with stun for [[1d6]] turns and has a 25% armour bypass with her Heavy Electronic Piercing Rockets . | Armour Piercing Fragmentation, [[1d8+3]] on direct hit and [[1d6+2]] for up to 330ft away with a 15% ([[d100]]) chance to shred 40% of armour and 20% of damage will bypass armour with her Armour Piercing Fragmentation Rockets. | Fragmentation, [[2d8+6]] on direct hit and [[2d6+4]] for up to 330ft away with a 20% ([[d100]]) chance to shred 50% of armour with her Fragmentation Rockets. | Concussion, [[2d4+4]] on impact with 85% ([[d100]]) chance to stun, 45% ([[d100]]) chance to deafen, 45% ([[d100]]) chance to blind from debris and 15% ([[d100]]) chance to knock prone. } | No, Character fires her rifle unstablised for quickness or for emergency effect lines up to fire ([[d20+37]]) hitting for, ?{Ammo Type?| Armour Piercing, [[5d10+10]] with 25% armour bypass with her Armour Piercing Rockets. | Heavy Electronic Piercing, [[6d10]] with stun for [[1d6]] turns and has a 25% armour bypass with her Heavy Electronic Piercing Rockets . | Armour Piercing Fragmentation, [[1d8+3]] on direct hit and [[1d6+2]] for up to 330ft away with a 15% ([[d100]]) chance to shred 40% of armour and 20% of damage will bypass armour with her Armour Piercing Fragmentation Rockets. | Fragmentation, [[2d8+6]] on direct hit and [[2d6+4]] for up to 330ft away with a 20% ([[d100]]) chance to shred 50% of armour with her Fragmentation Rockets. | Concussion, [[2d4+4]] on impact with 85% ([[d100]]) chance to stun, 45% ([[d100]]) chance to deafen, 45% ([[d100]]) chance to blind from debris and 15% ([[d100]]) chance to knock prone. } } This first nesting appears, but after that it posts the flavour text then stops and doesn't bring up the second query. And this is edited in Notepad++ with HTML entries.