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

Linked queries

Is there any possible way to link queries... for example Damage=[[2d10+4+?{Ammo Type|Explosive, d6![Explosive]|Pulse, 2[Pulse]}]] would be linked to another modifier AP:[[3+?{Ammo Type|Explosive, 4|Pulse,5}]] in a different part of the macro... I'm looking for a way to reduce the number of clicks needed for my macros, and some of the modifiers to attack or damage include additional modifiers in different part of the macro... the above example is from one of the savage worlds campaigns i'm in... If i'm using explosive ammo I deal an additional d6 damage and my AP is increased by 4... the same modifier but 2 separate calculations, and a different value for both... What I'd like to do is just select Explosive from the drop down 1 time and then have it input the proper modification into both calculations with only 1 query prompt... if that is at all possible...
1438109010

Edited 1438109127
The Aaron
Roll20 Production Team
API Scripter
That isn't currently possible, but you're not the first to illustrate how useful it would be.  It might be a good thing to add as a Suggestion in the Suggestions and Ideas forum. Additionally, someone exceptionally clever in the ways of formula (I'm talking about you, Brian!) might be able to come up with a way to make this work.  Try this, for example: Damage=[[2d10+4+ ( 1 * ?{Ammo Type|Explosive, d6![Explosive]+4|Pulse, 2[Pulse]+5} * 0 ) ]] AP:[[3 + ( 0 * ?{Ammo Type|Explosive, d6![Explosive]+4|Pulse, 2[Pulse]+5} * 1 ) ]] Don't know if it will work, but it ought to....
1438109849

Edited 1438110175
That will indeed work for what I'm trying to do with this macro...
1438109950
The Aaron
Roll20 Production Team
API Scripter
Cool!  =D
1438110184

Edited 1438110547
or atleast I guess it would if the actual macro was purely just calculations with the query... the actual macro is a bit different than my example... I've actually got the bonus damage rolling separate from the main damage with an icon affixed to it... since it makes it easier on the DM for when I use an ammo type that's bonus damage is ignored against certain enemies... &{template:clubsdamage} {{weapon=@{repeating_rangeweapons_2_RWeaponType}}} {{damage_type=@{repeating_rangeweapons_2_NoDmgDice}@{repeating_rangeweapons_2_RDmgType}+@{repeating_rangeweapons_2_RDmgMod}}} {{damage=[[@{repeating_rangeweapons_2_NoDmgDice}@{repeating_rangeweapons_2_RDmgType}+@{repeating_rangeweapons_2_RDmgMod}[Weapon Damage]+@{dmgmod}[Damage Modifier]]]➚[[d6!]]?{Ammo type| |Explosive, 💣[[2d@{repeating_rangeweapons_2_RDmgRaise}!]]|Pulse,🔌[[2]]}}} {{misc_notes= Range:@{repeating_rangeweapons_2_WeaponRange} RoF:@{repeating_rangeweapons_2_WeaponRoF} AP:[[?{AP|Normal,3|Explosive,4+3|Pulse,5+3}]] Laser Sight, Grip}} That's what i've got as my macro currently...
If it helps cut down your macro text;  once you've used the query  you can refer to it's final value later on with just ?{Ammo Type} You don't need to repeat anything after the pipe.
took your advice and created a suggestion for this: <a href="https://app.roll20.net/forum/post/2238497/linked-query/?pageforid=2238497#post-2238497" rel="nofollow">https://app.roll20.net/forum/post/2238497/linked-query/?pageforid=2238497#post-2238497</a>
1438114526
The Aaron
Roll20 Production Team
API Scripter
Thanks! &nbsp;I'll start funneling similar queries that direction.
I realized... I have another macro that needs something like this done for it too... and I am at a complete loss as to how to accomplish this one... &{template:spadestrait2} {{skill_name=Shooting}} {{skill_rank=@{Shooting}}} {{skill_rank_mod=@{ShootingMod}}} {{skill_roll=?{Action|Single,[[1d@{Shooting}![Shooting] + @{ShootingMod}[Shooting Rank Modifier] + @{ShootingskillMod} [Skill Modifier] + @{ttmod}[Situational Modifiers] +[[(d@{ShootingEncumbrance}*@{encumbrance}[Encumbrance Penalty])]] - [[@{wounds}]][Wounds] - @{fatigue}[Fatigue]]]|Double,[[1d@{Shooting}![Shooting] + @{ShootingMod}[Shooting Rank Modifier] + @{ShootingskillMod} [Skill Modifier] + @{ttmod}[Situational Modifiers] +[[(d@{ShootingEncumbrance}*@{encumbrance}[Encumbrance Penalty])]] - [[@{wounds}]][Wounds] - @{fatigue}[Fatigue]]]|[[1d@{Shooting}![Shooting] + @{ShootingMod}[Shooting Rank Modifier] + @{ShootingskillMod} [Skill Modifier] + @{ttmod}[Situational Modifiers] +[[(d@{ShootingEncumbrance}*@{encumbrance}[Encumbrance Penalty])]] - [[@{wounds}]][Wounds] - @{fatigue}[Fatigue]]]}}} {{wild_die_rank=@{wilddie}}} {{wild_die=?{Action2|Single,[[1d@{wilddie}![Wild Die] + @{ShootingMod}[Shooting Rank Modifier] + @{ShootingskillMod} [Skill Modifier] + @{ttmod}[Situational Modifiers] +[[(d@{ShootingEncumbrance}*@{encumbrance})]][Encumbrance Penalty] - [[@{wounds}]][Wounds] - @{fatigue}[Fatigue]]]|Double,[[1d@{wilddie}![Wild Die] + @{ShootingMod}[Shooting Rank Modifier] + @{ShootingskillMod} [Skill Modifier] + @{ttmod}[Situational Modifiers] +[[(d@{ShootingEncumbrance}*@{encumbrance})]][Encumbrance Penalty] - [[@{wounds}]][Wounds] - @{fatigue}[Fatigue]]]|[[1d@{wilddie}![Wild Die] + @{ShootingMod}[Shooting Rank Modifier] + @{ShootingskillMod} [Skill Modifier] + @{ttmod}[Situational Modifiers] +[[(d@{ShootingEncumbrance}*@{encumbrance}[Encumbrance Penalty])]] - [[@{wounds}]][Wounds] - @{fatigue}[Fatigue]]]}}} {{bonuses= [[@{ShootingMod}+@{ShootingskillMod}+@{ttmod}]]}} {{penalties= [[[[0-(@{ShootingEncumbrance}*@{encumbrance})]][Encumbrance Penalty] - @{woundsMod}[Wounds] - @{fatigue}[Fatigue]]]}} the macro modifier to to switch between 1 and 2 sets of rolls... the skill roll and the wild-die skill roll... the calculations are identical with the except for the dice rolled... the skill roll can be anything from a d4 to a d12 and the wild die is always a d6... so basically the output for Single is [[d12!+X]] [[d6!+X]] and for Double [[d12!+X]]|[[d12!+X]] [[d6!+X]]|[[d6!+X]] it would be great if I could just select Single or Double once and get the changes for both rolls...