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

Queries and Abilities - Target

1610303599

Edited 1610303991
Recently I've been trying to create a macro that would allow me to automatically roll my players or npcs through targeting as I find it easier to use than selecting each individual token at a time, However doing this I have attempted to use abilities which in turn cause the query to fail due to closing early. Is there any way this is possible or is it simply not achievable?  This is the code I have created: ?{Which ability?| STR, @{target|strength_save_roll} | DEX, @{target|dexterity_save_roll} | CON, @{target|constitution_save_roll} | INT, @{target|intelligence_save_roll} | WIS, @{target|wisdom_save_roll} | CHA, @{target|charisma_save_roll} }
1610310079
Jordan C.
Pro
API Scripter
By using a custom templet you can escape the characters necessary to accomplish this by adapting the universal saving throw macro . I adjusted the charname parameter and it uses the selected tokens name (at the end of the macro) : @{target|wtype}&{template:simple} @{target|rtype}?{Save |Strength,+[[(@{target|strength_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_str_save}*@{target|npc})]][STR SAVE] ]]}} {{rname=^{strength-save-u}}} {{mod=[[ [[(@{target|strength_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_str_save}*@{target|npc})]][STR SAVE] ]]}} {{r1=[[@{target|d20}+[[(@{target|strength_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_str_save}*@{target|npc})]][STR SAVE] ]] |Dexterity,+[[(@{target|dexterity_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_dex_save}*@{target|npc})]][DEX SAVE] ]]}} {{rname=^{dexterity-save-u}}} {{mod=[[ [[(@{target|dexterity_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_dex_save}*@{target|npc})]][DEX SAVE] ]]}} {{r1=[[@{target|d20}+[[(@{target|dexterity_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_dex_save}*@{target|npc})]][DEX SAVE] ]] |Constitution,+[[(@{target|constitution_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_con_save}*@{target|npc})]][CON SAVE] ]]}} {{rname=^{constitution-save-u}}} {{mod=[[ [[(@{target|constitution_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_con_save}*@{target|npc})]][CON SAVE] ]]}} {{r1=[[@{target|d20}+[[(@{target|constitution_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_con_save}*@{target|npc})]][CON SAVE] ]] |Intelligence,+[[(@{target|intelligence_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_int_save}*@{target|npc})]][INT SAVE] ]]}} {{rname=^{intelligence-save-u}}} {{mod=[[ [[(@{target|intelligence_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_int_save}*@{target|npc})]][INT SAVE] ]]}} {{r1=[[@{target|d20}+[[(@{target|intelligence_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_int_save}*@{target|npc})]][INT SAVE] ]] |Wisdom,+[[(@{target|wisdom_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_wis_save}*@{target|npc})]][WIS SAVE] ]]}} {{rname=^{wisdom-save-u}}} {{mod=[[ [[(@{target|wisdom_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_wis_save}*@{target|npc})]][WIS SAVE] ]]}} {{r1=[[@{target|d20}+[[(@{target|wisdom_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_wis_save}*@{target|npc})]][WIS SAVE] ]] |Charisma,+[[(@{target|charisma_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_cha_save}*@{target|npc})]][CHA SAVE] ]]}} {{rname=^{charisma-save-u}}} {{mod=[[ [[(@{target|charisma_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_cha_save}*@{target|npc})]][CHA SAVE] ]]}} {{r1=[[@{target|d20}+[[(@{target|charisma_save_bonus}@{target|pbd_safe}*(1-ceil((@{target|npc})*0.00001)))+(@{target|npc_cha_save}*@{target|npc})]][CHA SAVE] ]] }}} {{global=@{target|global_save_mod}}} {{charname=@{target|token_name}}} Standard caveat of never open the macro once its set or you will have to re-replace the escaped characters with their html entities.
Thank you! This worked so well, however I do think I did something wrong at first as my chat bugged out awfully whenever I tried to use it or type something. It's working fine now though!
1610312475
Jordan C.
Pro
API Scripter
Hmm maybe because it's a longer string and uses target a lot? I'm not certain what would cause it. But good to hear!