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

Macro for a drop down selection roll

1578262811

Edited 1578263967
Hi, I was attempting to use a drop down selection box for a catch all on an attribute+skill roll macro. This macro should drop a text saying rolling attribute+skill and an inline roll using those things as a reference. But it doesn't seem to be even attempting to roll it, no less give me an error. Am I attempting to do something that just isn't valid? Is it the wrong syntax? Just confused as to why its not doing anything. Also, sorry about not collapsing it, its kinda a beast. Not sure how to. rolling ?{Attribute|dex|wits|str|sta|int|res|pre|man|com}+?{Skill|acrobatics|athletics|survival|stealth|pilot|drive|larceny|computers|crafts|lore|medicine|occult|perception|science|empathy|intimidation|perform|persuade|socialize|streetwise|subterfuge} [[(?{Attribute|dex,@{selected|dex}|wits,@{selected|wits}|str,@{selected|str}|sta,@{selected|sta}|int,@{selected|int}|res,@{selected|res}|pre,@{selected|pre}|man,@{selected|man}|com,@{selected|com}}+?{Skill|acrobatics,@{selected|acrobatics}|athletics,@{selected|athletics}|survival,@{selected|survival}|stealth,@{selected|stealth}|pilot,@{selected|pilot}|drive,@{selected|drive}|larceny,@{selected|larceny}|computers,@{selected|computers}|crafts,@{selected|crafts}|lore,@{selected|lore}|medicine,@{selected|medicine}|occult,@{selected|occult}|perception,@{selected|perception}|science,@{selected|science}|empathy,@{selected|empathy}|intimidation,@{selected|intimidation}|perform,@{selected|perform}|persuade,@{selected|persuade}|socialize,@{selected|socialize}|streetwise,@{selected|streetwise}|subterfuge,@{selected|subterfuge}})d10>7!>?{Again value?|10}]]
Try This! @{selected|wtype}&{template:simple} @{selected|rtype}?{Skill |Acrobatics,+[[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]]}} {{rname=^{acrobatics-u}}} {{mod=[[ [[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|acrobatics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_acrobatics}*@{selected|npc})]][ACRO] ]] |Animal Handling,+[[(@{selected|animal_handling_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_animal_handling}*@{selected|npc})]][ANIM] ]]}} {{rname=^{animal-handling-u}}}{{mod=[[ (@{selected|animal_handling_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_animal_handling}*@{selected|npc})]][ANIM] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|animal_handling_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_animal_handling}*@{selected|npc})]][ANIM] ]] |Arcana,+[[(@{selected|arcana_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_arcana}*@{selected|npc})]][ARC] ]]}} {{rname=^{arcana-u}}} {{mod=[[ [[(@{selected|arcana_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_arcana}*@{selected|npc})]][ARCA] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|arcana_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_arcana}*@{selected|npc})]][ARCA] ]] |Athletics,+[[(@{selected|athletics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_athletics}*@{selected|npc})]][ARC] ]]}} {{rname=^{athletics-u}}} {{mod=[[ [[(@{selected|athletics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_athletics}*@{selected|npc})]][ATHL] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|athletics_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_athletics}*@{selected|npc})]][ATHL] ]] |Decpetion,+[[(@{selected|deception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_deception}*@{selected|npc})]][ARC] ]]}} {{rname=^{deception-u}}} {{mod=[[ [[(@{selected|deception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_deception}*@{selected|npc})]][DECE] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|deception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_deception}*@{selected|npc})]][DECE] ]] |History,+[[(@{selected|history_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_history}*@{selected|npc})]][ARC] ]]}} {{rname=^{history-u}}} {{mod=[[ [[(@{selected|history_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_history}*@{selected|npc})]][HIST] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|history_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_history}*@{selected|npc})]][HIST] ]] |Insight,+[[(@{selected|insight_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_insight}*@{selected|npc})]][ARC] ]]}} {{rname=^{insight-u}}} {{mod=[[ [[(@{selected|insight_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_insight}*@{selected|npc})]][INSI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|insight_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_insight}*@{selected|npc})]][INSI] ]] |Intimidation,+[[(@{selected|intimidation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_intimidation}*@{selected|npc})]][ARC] ]]}} {{rname=^{intimidation-u}}} {{mod=[[ [[(@{selected|intimidation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_intimidation}*@{selected|npc})]][INTI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|intimidation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_intimidation}*@{selected|npc})]][INTI] ]] |Investigation,+[[(@{selected|investigation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_investigation}*@{selected|npc})]][ARC] ]]}} {{rname=^{investigation-u}}} {{mod=[[ [[(@{selected|investigation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_investigation}*@{selected|npc})]][INVE] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|investigation_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_investigation}*@{selected|npc})]][INVE] ]] |Medicine,+[[(@{selected|medicine_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_medicine}*@{selected|npc})]][ARC] ]]}} {{rname=^{medicine-u}}} {{mod=[[ [[(@{selected|medicine_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_medicine}*@{selected|npc})]][MEDI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|medicine_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_medicine}*@{selected|npc})]][MEDI] ]] |Nature,+[[(@{selected|nature_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_nature}*@{selected|npc})]][ARC] ]]}} {{rname=^{nature-u}}} {{mod=[[ [[(@{selected|nature_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_nature}*@{selected|npc})]][NATU] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|nature_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_nature}*@{selected|npc})]][NATU] ]] |Perception,+[[(@{selected|perception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_perception}*@{selected|npc})]][ARC] ]]}} {{rname=^{perception-u}}} {{mod=[[ [[(@{selected|perception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_perception}*@{selected|npc})]][PERC] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|perception_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_perception}*@{selected|npc})]][PERC] ]] |Performance,+[[(@{selected|performance_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_performance}*@{selected|npc})]][ARC] ]]}} {{rname=^{performance-u}}} {{mod=[[ [[(@{selected|performance_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_performance}*@{selected|npc})]][PERF] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|performance_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_performance}*@{selected|npc})]][PERF] ]] |Persuasion,+[[(@{selected|persuasion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_persuasion}*@{selected|npc})]][ARC] ]]}} {{rname=^{persuasion-u}}} {{mod=[[ [[(@{selected|persuasion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_persuasion}*@{selected|npc})]][PERS] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|persuasion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_persuasion}*@{selected|npc})]][PERS] ]] |Religion,+[[(@{selected|religion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_religion}*@{selected|npc})]][ARC] ]]}} {{rname=^{religion-u}}} {{mod=[[ [[(@{selected|religion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_religion}*@{selected|npc})]][RELI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|religion_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_religion}*@{selected|npc})]][RELI] ]] |Sleight of Hand,+[[(@{selected|sleight_of_hand_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_sleight_of_hand}*@{selected|npc})]][ARC] ]]}} {{rname=^{sleight_of_hand-u}}} {{mod=[[ [[(@{selected|sleight_of_hand_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_sleight_of_hand}*@{selected|npc})]][SLEI] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|sleight_of_hand_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_sleight_of_hand}*@{selected|npc})]][SLEI] ]] |Stealth,+[[(@{selected|stealth_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_stealth}*@{selected|npc})]][ARC] ]]}} {{rname=^{stealth-u}}} {{mod=[[ [[(@{selected|stealth_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_stealth}*@{selected|npc})]][STEA] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|stealth_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_stealth}*@{selected|npc})]][STEA] ]] |Survival,+[[(@{selected|survival_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_survival}*@{selected|npc})]][ARC] ]]}} {{rname=^{survival-u}}} {{mod=[[ [[(@{selected|survival_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_survival}*@{selected|npc})]][SURV] ]]}} {{r1=[[@{selected|d20}+[[(@{selected|survival_bonus}@{selected|pbd_safe}*(1-ceil((@{selected|npc})*0.00001)))+(@{selected|npc_survival}*@{selected|npc})]][SURV] ]] }}} @{selected|global_skill_mod} @{selected|charname_output}
we're using a custom sheet and its not dnd so a lot of your references are coming out bad. can you explain what you did differently other than throwing it into a template?
it did actually attempt to roll it tho, and spat out all the errors for reference not existing. looks fine in our dnd lobby but why do you do all the npc flags? wouldn't it just be simpler to simply reference the skill bonus in the inline then print the skill abbreviation at the end? what does all the jargon do in the middle?
1578300450

Edited 1578300548
This macro is universal for the 5e OGL sheet it works for both the PC and NPC's. I posted this so you can see A: What i use and B: What it looks like when you use the templates of the sheet. If you use a custom sheet then you need to reference the templates for that sheet to call the skills that it uses.
Sadly I don't believe this macro will work as I need to reference 2 different things then add them together, then roll that many dice. World of darkness style of roll. I'm specifically trying to get a drop down to show up to be friendly for newer players to the genre and have it also show what options were chosen on the end product without having to answer 5 different prompts every time they attempt to roll something.  Also, can you give me any advice as to why the macro I originally posted doesn't work? Is it simply I can't use the same drop down choice twice but have that same option print something different on a different drop down named the same? If that is the case any tips on how I might get around that but still have the things I'm looking for in this macro?
1578304140
GiGs
Pro
Sheet Author
API Scripter
In your macro, you are using the same name for different queries. The first Attribute Query is ?{Attribute|dex|wits|str|sta|int|res|pre|man|com} the second is ?{Attribute|dex,@{selected|dex}|wits,@{selected|wits}|str,@{selected|str}|sta,@{selected|sta}|int,@{selected|int}|res,@{selected|res}|pre,@{selected|pre}|man,@{selected|man}|com,@{selected|com}} You cant do that. When you have two queries with the same name, roll20 will always use the first one. So your roll section is not using valid attributes. Instead of, say, (@{selected|dex}+@{selected|drive})d10 , the dice macro is seeing (dex+drive)d10 , which isnt a valid roll, since dex and drive are just text. If you remove the first two queries the roll should work. You might be able to include Inline Labels, like ?{Attribute|dex,@{selected|dex}[DEX]|wits,@{selected|wits}[WITS]|str,@{selected|str}|sta,@{selected|sta}[STA]|int,@{selected|int}|res,@{selected|res} [RES]|pre,@{selected|pre}[PRE]|man,@{selected|man}|com,@{selected|com}[COM]} They dont have to be three letters. I can't remember if this works, because I don't use them, but if it does, you can hover over the dice roll and see which attribute was used to make the roll.
So if I were to just remove the first query and add the flag to the second query would it not get broken with a flag from the attribute entering into the roll? While I agree that if I was just selecting from one list this would be the ideal way to handle it, I'm selecting from 2 lists and adding them together to roll the appropriate number of dice in an (attribute+skill)d10 way. If I were to add the inline flags onto the referenced attributes would they not also be thrown into that addition and break the roll? Or does putting them into inlines make them not be put into the inline roll?
1578305855
GiGs
Pro
Sheet Author
API Scripter
Those inline flags (in theory) should be ignored by the roll. I can't remember ever having used them this way, so I'm not 100% sure, but it's worth a try.
So I did give it a quick try. The roll did indeed happen. But because I'm using an inline roll for the product to keep it tidy the flags are also being eaten by the inline. It requires a hover over which would get tedious for every roll.
1578306308

Edited 1578306533
So with more fiddling I got something that semi works but formatting on the roll looks awful to me being in the middle of the flags of what type of roll it is. Here's the best thing I've gotten to work but unsure how to go about getting the the formatting of the flags to be nicer and easier to comprehend: ?{Stat| Strength,**Strength** [[(@{selected|str}+?{Misc Bonus/Penalty?|0}|Dexterity,**Dex** [[(@{selected|dex}+?{Misc Bonus/Penalty?|0}|Stamina,**Stam** [[(@{selected|sta}+?{Misc Bonus/Penalty?|0}|Intelligence,**Int** [[(@{selected|int}+?{Misc Bonus/Penalty?|0}|Wits,**Wits** [[(@{selected|wits}+?{Misc Bonus/Penalty?|0}| Resolve,**Resolve** [[(@{selected|res}+?{Misc Bonus/Penalty?|0}|Presence,**Presence** [[(@{selected|pre}+?{Misc Bonus/Penalty?|0}|Manipulation,**Manip** [[(@{selected|man}+?{Misc Bonus/Penalty?|0}|Composure,**Composure** [[(@{selected|com}+?{Misc Bonus/Penalty?|0}}+ ?{Skill|  Acrobatics, @{selected|acrobatics})d10>7!>?{Again?|10}]] **Acrobatics**| Athletics, @{selected|athletics})d10>7!>?{Again?|10}]] **Athletics**| Drive, @{selected|drive})d10>7!>?{Again?|10}]] **Drive**| Larceny, @{selected|larceny})d10>7!>?{Again?|10}]] **Larceny**| Pilot, @{selected|pilot})d10>7!>?{Again?|10}]] **Pilot**| Stealth, @{selected|stealth})d10>7!>?{Again?|10}]] **Stealth**|Survival, @{selected|survival})d10>7!>?{Again?|10}]] **Survival**|Computers, @{selected|computers})d10>7!>?{Again?|10}]] **Computers**|Crafts, @{selected|crafts})d10>7!>?{Again?|10}]] **Craft**|Lore, @{selected|lore})d10>7!>?{Again?|10}]] **Lore**|Medicine, @{selected|medicine})d10>7!>?{Again?|10}]] **Medicine**|Occult, @{selected|occult})d10>7!>?{Again?|10}]] **Occult**|Perception, @{selected|perception})d10>7!>?{Again?|10}]] **Perception**| Science, @{selected|science})d10>7!>?{Again?|10}]] **Science**|Empathy, @{selected|empathy})d10>7!>?{Again?|10}]] **Empathy**|Intimidation, @{selected|intimidation})d10>7!>?{Again?|10}]]  **Intimidation**|Perform, @{selected|perform})d10>7!>?{Again?|10}]] **Perform**|Persuade, @{selected|persuade})d10>7!>?{Again?|10}]]  **Persuade**|Socialize, @{selected|socialize})d10>7!>?{Again?|10}]] **Socialize**|Streetwise, @{selected|streetwise})d10>7!>?{Again?|10}]] **Streetwise**|Subterfuge, @{selected|subterfuge}))d10>7!>?{Again?|10}]] **Subterfuge**} + ?{Misc Bonus/Penalty?}
1578307584
GiGs
Pro
Sheet Author
API Scripter
roll20's roll system is pretty limited, and some solutions are pretty ugly - but at least it works.