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

Having trouble with what seems like a simple change to a macro.

I'm trying to use a modified version of the AD&D 2e proficiency macro, which allows players to select a proficiency from a drop-down menu and roll 1d20 +/- a modifier against a target number (= or lower to for success.)  What I'm trying to do is have a player select his proficiency as normal, but instead of rolling 1d20 he would roll the number of d6 I instruct him to roll and remove the +/- roll.  I thought it would be as simple as replacing 1d20cs1cf20 with ?{Number of Dice}d6!!cs1cf6 but it doesn't behave properly.  It is going through the players entire list of proficiencies and requiring the submit button be clicked and at the end gives no result whatsoever.  What am I missing?  What am I doing wrong?  Instead of a result it displays: This is the original source Macro I'm adjusting: &{template:default}{{name=@{selected|token_name} uses a Non-Weapon Proficiency}}{{?{Proficiency Being Used?| @{selected|repeating_profs_$0_profname},@{selected|repeating_profs_$0_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$0_profstatnum}@{selected|repeating_profs_$0_profmod}| @{selected|repeating_profs_$1_profname},@{selected|repeating_profs_$1_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$1_profstatnum}@{selected|repeating_profs_$1_profmod}| @{selected|repeating_profs_$2_profname},@{selected|repeating_profs_$2_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$2_profstatnum}@{selected|repeating_profs_$2_profmod}| @{selected|repeating_profs_$3_profname},@{selected|repeating_profs_$3_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$3_profstatnum}@{selected|repeating_profs_$3_profmod}| @{selected|repeating_profs_$4_profname},@{selected|repeating_profs_$4_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$4_profstatnum}@{selected|repeating_profs_$4_profmod}| @{selected|repeating_profs_$5_profname},@{selected|repeating_profs_$5_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$5_profstatnum}@{selected|repeating_profs_$5_profmod}| @{selected|repeating_profs_$6_profname},@{selected|repeating_profs_$6_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$6_profstatnum}@{selected|repeating_profs_$6_profmod}| @{selected|repeating_profs_$7_profname},@{selected|repeating_profs_$7_profname} [[1d20cs1cf20<[[@{selected|repeating_profs_$7_profstatnum}@{selected|repeating_profs_$7_profmod}}?{Misc Modifier? (Include + or -)|+0}]]]] Success(es)}} This is my adjusted macro: &{template:default}{{name=@{selected|token_name} uses a Non-Weapon Proficiency}}{{?{Proficiency Being Used?| @{selected|repeating_profs_$0_profname},@{selected|repeating_profs_$0_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$0_profstatnum}@{selected|repeating_profs_$0_profmod}| @{selected|repeating_profs_$1_profname},@{selected|repeating_profs_$1_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$1_profstatnum}@{selected|repeating_profs_$1_profmod}| @{selected|repeating_profs_$2_profname},@{selected|repeating_profs_$2_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$2_profstatnum}@{selected|repeating_profs_$2_profmod}| @{selected|repeating_profs_$3_profname},@{selected|repeating_profs_$3_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$3_profstatnum}@{selected|repeating_profs_$3_profmod}| @{selected|repeating_profs_$4_profname},@{selected|repeating_profs_$4_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$4_profstatnum}@{selected|repeating_profs_$4_profmod}| @{selected|repeating_profs_$5_profname},@{selected|repeating_profs_$5_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$5_profstatnum}@{selected|repeating_profs_$5_profmod}| @{selected|repeating_profs_$6_profname},@{selected|repeating_profs_$6_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$6_profstatnum}@{selected|repeating_profs_$6_profmod}| @{selected|repeating_profs_$7_profname},@{selected|repeating_profs_$7_profname} [[?{Number of Dice}d6!!cs1cf6<[[@{selected|repeating_profs_$7_profstatnum}@{selected|repeating_profs_$7_profmod}}?{Misc Modifier? (Include + or -)|+0}]]]] Success(es)}}
1675803453

Edited 1675803981
Gauss
Forum Champion
Where is the original source macro being stored? Hidden on a character sheet? In the character's Abilities (Attributes & Abilities tab)? Or in the Collection tab? Some other things: Your initial macro does not appear to have a nested query, your new macro has a nested query, that is a whole new level of difficulty with macros. (see link ) I don't see any HTML entities to allow your nested query to function.  This is what you see for your first query option:  {?{Proficiency Being Used?|@{selected|repeating_profs_$0_profname},@{selected|repeating_profs_$0_profname} [[?{Number of Dice } d6!!cs1cf6<[[@{selected|repeating_profs_$0_profstatnum}@{selected|repeating_profs_$0_profmod}| This is probably what the system sees:  {?{Proficiency Being Used?|@{selected|repeating_profs_$0_profname},@{selected|repeating_profs_$0_profname} [[?{Number of Dice } That last "}" is probably telling the first query (Proficiency Being Used) that the query is over. To fix that you will have to use HTML entities.  My suggestion when building macros...build them ONE step at a time. Test each phase until you find out what breaks. Your macro should not have lines $1 through $7 until you verify that $0 works. 
The original macro was picked up on the wiki (<a href="https://wiki.roll20.net/Advanced_Dungeons_and_Dragons#Non-Weapon_Proficiency_Checks" rel="nofollow">https://wiki.roll20.net/Advanced_Dungeons_and_Dragons#Non-Weapon_Proficiency_Checks</a>). Ah, I have zero understanding of programming language, it looks like I'll have to figure out how to write it differently than simply copy-pasting one thing that works into another thing that works, creating another thing that doesn't work.&nbsp; So I have to remove the {} from the dice query.
1675809177
Gauss
Forum Champion
My suggestion for this is to use Chat Menus , they are much easier to implement.&nbsp; If you need help constructing macros we are definitely here to help. :)
1675817908
GiGs
Pro
Sheet Author
API Scripter
I agree with the suggestion to use chat menus. But maybe Im just not reading properly but I'm not seeing the difference between macro 1 and 2. Can you describe the change?
1675821250
Gauss
Forum Champion
GiGs said: I agree with the suggestion to use chat menus. But maybe Im just not reading properly but I'm not seeing the difference between macro 1 and 2. Can you describe the change? Macro one has a query, with a second query following it.&nbsp; Macro two has a query, with a second sub-query imbedded in every option of the first query, and then a third query following all of that.&nbsp; It is the imbedded sub-query that is probably breaking it.&nbsp;
1675821534

Edited 1675821784
Gauss
Forum Champion
@Steve H.&nbsp; Try replacing this:&nbsp; @{selected|repeating_profs_$0_profname},@{selected|repeating_profs_$0_profname} [[?{Number of Dice } d6!!cs1cf6&lt;[[@{selected|repeating_profs_$0_profstatnum}@{selected|repeating_profs_$0_profmod}| with this:&nbsp; @{selected|repeating_profs_$0_profname},@{selected|repeating_profs_$0_profname} [[?{Number of Dice &amp;#125; d6!!cs1cf6&lt;[[@{selected|repeating_profs_$0_profstatnum}@{selected|repeating_profs_$0_profmod}| (the bolded section) You will need to reproduce that on every line. Also, I haven't tested it, and I haven't seen what specific error your macro is outputting but if it is what I think it is, that might fix it. Edit: Oh, you cannot use Collection tab macros for this if you use HTML entities. The act of editing a Collection tab macro causes all HTML entities in that macro to revert to what they represent, "}" in this case. Ability macros work fine for this and will not revert.
1675834035
GiGs
Pro
Sheet Author
API Scripter
Gauss said: GiGs said: I agree with the suggestion to use chat menus. But maybe Im just not reading properly but I'm not seeing the difference between macro 1 and 2. Can you describe the change? Macro one has a query, with a second query following it.&nbsp; Macro two has a query, with a second sub-query imbedded in every option of the first query, and then a third query following all of that.&nbsp; It is the imbedded sub-query that is probably breaking it. It took some doing, but I see it now :) And yes, that'll definitely be what's breaking it. To OP, see here for the issue with nested queries . Whenever you try to nest a query inside another query, it's almost always better to use a chat menu. But thats only if you can easily encapulate an entire row inside the chat menu, and I don't think that's possible in your case. Since youre a Pro user, is your game set also created by a Pro user? If so, it will be much easier to use a Mod Script.&nbsp; Something like a Scriptcards macro will do this much more easily than trying to write a standard macro which is ot designed for this kind of complexity. You can do it with HTML Entities as Gauss suggests, but if your game is a pro game, you don't need to.