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

Star Trek Adventures (2d20) Macro Help

I have an NPC combat macro that I have found here .  I have modified it for use with non ship combatants but am having a bit of an issue. On the original macro there is a query for bonus dice and I am looking to do the same on my non ship macro which looks like this. /w gm &{template:default} {{name=@{selected|token_name}}}{{Melee Attack=[[1d20<[[ @{daring} + @{security} ]]cs<1cf20]] [[1d20<[[ @{daring} + @{security} ]]cs<1cf20]]}} {{Unarmed Damage= [[ [[ @{security} + 1]]t[Challenge-Dice] ]] Non-lethal, Knockdown}} {{D’k tahg Dagger Damage= [[ [[ @{security} + 1]]t[Challenge-Dice] ]] Hidden 1, Deadly, Vicious 1}} {{(Escalation) Bat’leth Damage= [[ [[ @{security} + 3]]t[Challenge-Dice] ]]Vicious 1}} {{—}} {{Ranged Attack=[[1d20<[[ @{control} + @{security} ]]cs<1cf20]] [[1d20<[[ @{control} + @{security} ]]cs<1cf20]]}} {{Disruptor Pistol Damage= [[ [[ @{security} + 3]]t[Challenge-Dice] ]] Vicious 1}} {{Disruptor Rifle Damage= [[ [[ @{security} + 4]]t[Challenge-Dice] ]] Vicious 1}} This issue I am running into is that the original macro use a specific attribute and discipline pulled from the sheet which will change with non ship combatants. What I am trying to achieve is to query how many d20's to roll and roll them inline like the rest of the macro with critical success being 1 and critical failure being 20.
1642436414
timmaugh
Pro
API Scripter
Not sure I understand the problem... do you need to select an attribute that will change, or do you need to specify how many d20 to roll? If the attribute could change (but came from a fixed list), you could have a query that supplied that. On the other hand, if the list of potential attributes was open-ended (or subject to gm fiat) and you needed to just prompt for the number of d20, that's an easy query, too. Can you provide more of the mechanics of the system/roll and give a case where you'd have a non-ship combatant *not* served by the macro?
Honestly at this point I think the easiest would just be a query of how many d20's to roll. I've given up on making it fancy lol.
1642518725
timmaugh
Pro
API Scripter
To answer your basic question, a query looks like this: ?{Your question here|First Label,firstValue|Second Label,secondValue} (Using labels is optional; without them, the values will be the things displayed that you are picking from.) And can be re-used without having to provide the options if you need the choice to be provided again: ?{Your question here} You just have to make sure you type the name exactly correct -- including things like a question mark on the end of your prompt if it's present in the original. The good thing about queries (at least as it concerns your issue) is that they process before inline rolls. That means you can use queries for the number of dice within an inline roll: Open ended/free entry: [[ ?{How many d20?|0}d20 ]] Choosing from options: [[ ?{Number of d20|1|2|3|4|5|6|7|8|9|10}d20 ]] Or you can use them to house full inline rolls: ?{Choose roll|Yak Husbandry,[[2d20cs>18+@{yak_care}]]|Yak Whispering, [[1d20cf<3cs>20+@{yak_care} + @{luckoftheyak}]]} Now, I'm not sure which of the various rolls you would want to replace, but I'm going to assume it is one or both of the Melee Attack portions of your roll template. You have 2 identical rolls in there: {{Melee Attack=[[1d20<[[ @{daring} + @{security} ]]cs<1cf20]] [[1d20<[[ @{daring} + @{security} ]]cs<1cf20]]}} Let's say this is where you wanted to prompt for the number of d20. In that case, you can use one of the forms, above, and then re-use your query for the second roll so that the 2 roll equations stay the same: {{Melee Attack=[[?{How many d20?|0}d20<[[ @{daring} + @{security} ]]cs<1cf20]] [[?{How many d20?}d20<[[ @{daring} + @{security} ]]cs<1cf20]]}} Extended Example Back to the question I had about the mechanics of the system and whether getting different attributes was part of your problem... if the attributes will change, you can manage those with a roll query, too. Attributes resolve *before* roll queries, so their braces don't interfere with the roll template structure. That said, they are *all* expanded prior to the query running (instead of waiting to see what you choose), so if an attribute isn't present on the sheet, it will throw an error when  you try to use it in a query: ?{Which attribute?|Strength,@{strength}|Underwater Macrame|@{underwater_macrame}} If the character doesn't have "Underwater Macrame", this will throw an error to chat... so using a list of attributes is good for situations where every character who will use the roll query will have the mentioned attributes -- eg, all characters will have the same Stats, so prompting for which stat to base a new roll on would work without incident. On the other hand, if there are various combinations of Skills that can be used in melee combat, and the character might only have the 1 or 2 that fit his/her style and not the others, you wouldn't want to prompt for all of them.