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

Multiple query's in one macro

Hi. I have a question. I am trying to have a series of entries pulled from a character sheet based on a main query. Say you have three weapons and you select weapon 2. Normally I do something like ?{Weapon|Weapon One|Weapon Two|Weapon Three} and that is it. But say I want another query to use the same selection, but different information. Name: ?{WeaponName|@{selected|WeaponName_1}|@{selected|WeaponName_2|@{selected|WeaponName_3} Attack Bonus: ?{WeaponName|@{selected|WeaponBonus_1}|@{selected|WeaponBonus_2|@{selected|WeaponBonus_3} Attack Damage: ?{WeaponName|@{selected|WeaponDMG_1}|@{selected|WeaponDMG_2|@{selected|WeaponDMG_3} Is there a way to have all three queries be based on the first selection? So it looks like this: Name: Long Sword Attack Bonus: +1 Attack Damage: 1d8 And not have to pick three times?
1605550659
GiGs
Pro
Sheet Author
API Scripter
You can include longer stretches of text within each query. If you use this syntax: ?{Question?|Label1,Value1|Label2,Value2} The | divides each row of a query, and the , divides that row into a label (which is sown in the dropdown), and the value (which is printed to chat) So you can do something like A character ?{WeaponName| @{selected|WeaponName_1},uses @{selected|WeaponName_1} /roll 1d20+@{selected|WeaponBonus_1} /roll @{selected|WeaponDMG_1}| @{selected|WeaponName_2},uses @{selected|WeaponName_2} /roll 1d20+@{selected|WeaponBonus_2} /roll @{selected|WeaponDMG_2}} Or to make it a bit more readable: A character ?{WeaponName| @{selected|WeaponName_1},uses @{selected|WeaponName_1} Attack: [[1d20+@{selected|WeaponBonus_1}]] Damage: [[@{selected|WeaponDMG_1}]]| @{selected|WeaponName_2},uses @{selected|WeaponName_2} Attack: [[1d20+@{selected|WeaponBonus_2}]] Damage: [[@{selected|WeaponDMG_2}]]} Or you could look into using a rolltemplate to make it even prettier, but then you'll also have to look into html entity substitutions, and thats not for the faint-hearted:&nbsp;<a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a>
1605551948

Edited 1605552160
I am trying to use it in powercards. What i want is to only choose the drop menu once and the rest just fills in from there. I don't want to have to select two, three, or four times just to use the same weapon.
1605552149
GiGs
Pro
Sheet Author
API Scripter
I dont use power cards so i cant help you there, but it should be posisble. There's a dedicated power cards thread - if you find that, and post a question there, people who know how to use the script will definitely see it.
Hi Peacekeeper, I believe you can do this in PC by using replacements and inlinereplacements (essentially by setting up a player handout as a format:&nbsp;&nbsp; <a href="https://wiki.roll20.net/Script:PowerCards" rel="nofollow">https://wiki.roll20.net/Script:PowerCards</a> &nbsp;.&nbsp; There is a nice video there under replacements which you might be able to use in the scenario you described above. I might be misunderstanding what you are looking for exactly.&nbsp; An example replacement handout: Light Crossbow:AttackName|Light Crossbow;AType|DEX;DType|piercing;BaseDamage|1d8;CritDamage|2d8;HitBonus|;ADesc| Longbow:AttackName|Longbow;AType|DEX;DType|piercing;BaseDamage|1d8;CritDamage|2d8;HitBonus|;ADesc| Longsword:AttackName|Longsword;AType|STR;DType|slashing;BaseDamage|1d8;CritDamage|2d8;HitBonus|;ADesc| Mace:AttackName|Mace;AType|STR;DType|bludgeoning;BaseDamage|1d6;CritDamage|2d6;HitBonus|;ADesc|