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 drop down menu does not like my comma..... I think

1457428236

Edited 1457428364
The comma in this formula: [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_int_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_int_mod}} ]] ]] + [[ {@{selected|npcd_int_save}+0} ]] ]] ]] It breaks my monster saving throw script: ?{Save type?| Strength, **Strength Save** [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_str_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_str_mod}} ]] ]] + [[ {@{selected|npcd_str_save}+0} ]] ]] ]] and [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_str_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_str_mod}} ]] ]] + [[ {@{selected|npcd_str_save}+0} ]] ]] ]]. | Dexterity, **Dexterity Save** [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_dex_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_dex_mod}} ]] ]] + [[ {@{selected|npcd_dex_save}+0} ]] ]] ]] and [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_dex_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_dex_mod}} ]] ]] + [[ {@{selected|npcd_dex_save}+0} ]] ]] ]]. | Constitution, **Constitution Save** [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_con_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_con_mod}} ]] ]] + [[ {@{selected|npcd_con_save}+0} ]] ]] ]] and [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_con_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_con_mod}} ]] ]] + [[ {@{selected|npcd_con_save}+0} ]] ]] ]]. | Intelligence, **Intelligence Save** [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_int_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_int_mod}} ]] ]] + [[ {@{selected|npcd_int_save}+0} ]] ]] ]] and [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_int_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_int_mod}} ]] ]] + [[ {@{selected|npcd_int_save}+0} ]] ]] ]]. | Wisdom, **Wisdom Save** [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_wis_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_wis_mod}} ]] ]] + [[ {@{selected|npcd_wis_save}+0} ]] ]] ]] and [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_wis_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_wis_mod}} ]] ]] + [[ {@{selected|npcd_wis_save}+0} ]] ]] ]].| Charisma, **Charisma Save** [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_cha_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_cha_mod}} ]] ]] + [[ {@{selected|npcd_cha_save}+0} ]] ]] ]] and [[ 1d20 +[[ [[ [[ [[ [[ {@{selected|npcd_cha_save}+0,0}>1 ]] - 1 ]] *-1 ]] * [[ {@{selected|npcd_cha_mod}} ]] ]] + [[ {@{selected|npcd_cha_save}+0} ]] ]] ]]. } It is long and repetitive but it makes a single button that gives a drop down listing the saves rather than 6 separate saving throw buttons.  It then roles 2 of that save with the modifiers as required. Can anyone assist please? OLG character sheet is used and this accounts for some NPC's that have a save that overrides the normal stat mod plus d20
1457430870
Ziechael
Forum Champion
Sheet Author
API Scripter
Troubleshooting Due to the order of operations , macro calls nested within Roll Queries are fully expanded before the query is executed. This means that if a macro nested within a Roll Query contains any problematic characters, which conflict with Roll Query syntax, that nested macro may cause the Roll Query to break. If this is the case, it may be necessary to either remove or replace problematic characters within that nested macro with HTML entities (see: Advanced Usage for Roll Queries ). Note that macros which contain HTML entities may no longer function autonomously and must be saved as Abilities . You can avoid this by saving the macro as normal and then NEVER opening it again as this will trigger the replacement of html entities... of course you could always paste the correct macro back in before saving again... and then NEVER open that one ;)
Ah, thank you.
1457434091

Edited 1457434844
Ziechael
Forum Champion
Sheet Author
API Scripter
On a side note, if your comma is setting up a either or scenario you may need to add kh or kl (keep highest or keep lowest) depending on your systems rules? The  dice reference has a wealth of applicable information for the budding macro-er(?) =D [edit] admittedly for a >1 comparison it isn't likely an issue anyway....
That may also work.  Thanks.
1457456423

Edited 1457456463
Indeed; that comma (and its corresponding closing brace) will have to be replaced with HTML entities. Check out: Advanced Usage for Roll Queries