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 .
×

Macro not prompting in chat

1611748553

Edited 1611760595
Hello. I'm new to this macro thing, but I already love it. I've stumbled upon an error that I can't debug by myself, unfortunately. Oh, and english is not my first langage, so sorry for the inconveniance. I have 4 characters created by player and I would like to create a macro that allows them to roll a dice, and then to add a bonus or a malus depending on their characteristics. I created the following macro (The differents texts you can see are just french words, no big deal) :  /r 1D20 [[ ?{Personnage ? |Hylianne,  [[ ?{Compétence ? | Force, @{Hylianne|ModFor} | Dextérité, @{Hylianne|ModDex} | Constitution, @{Hylianne|ModCon} | Intelligence, @{Hylianne|ModInt} |Sagesse, @{Hylianne|ModSag} |Foi, @{Hylianne|ModFoi} }  ]] |Will,  [[ ?{Compétence ? |Force, @{Will Thucker|ModFor} |Dextérité, @{Will Thucker|ModDex} |Constitution, @{Will Thucker|ModCon} |Intelligence, @{Will Thucker|ModInt} |Sagesse, @{Will Thucker|ModSag} |Foi, @{Will Thucker|ModFoi} }  ]] |Bagherra,  [[ ?{Compétence ? |Force, @{Bagherra|ModFor} |Dextérité,@{Bagherra|ModDex} |Constitution, @{Bagherra|ModCon} |Intelligence, @{Bagherra|ModInt} |Sagesse, @{Bagherra|ModSag} |Foi, @{Bagherra|ModFoi} }  ]] |Nifwa Nilwa,  [[ ?{Compétence ? |Force, @{Nifwa Nilwa|ModFor} |Dextérité, @{Nifwa Nilwa|ModDex} |Constitution, @{Nifwa Nilwa|ModCon} |Intelligence, @{Nifwa Nilwa|ModInt} |Sagesse, @{Nifwa Nilwa|ModSag} |Foi, @{Nifwa Nilwa|ModFoi} }  ]] } ]] I understand that these nested queries are quite complicated, but what I don't understand is why the macro does simply nothing. I can chose which character I want to pick (the first query), then choose which characteristic bonus I'd like to add, but then... Nothing. It shows "Rolling the dice..." in the right bottom corner of the screen then do nothing. Nothing is displayed in the chat, and I cannot debug it.  So, it can understand the nested queries, it can fetch the right number (I replaced the , with &amp#44; and it showed the right number in the drop-down menu), but then cannot understand the "/r" command ? I tried just to prompt the result but it still does nothing. I have no ways of knowing what's wrong since it doesn't prompt an error message, I'm kinda lost here. EDIT : Put the "code" style for the... code.
1611758228

Edited 1611758362
Jordan C.
Pro
API Scripter
The "/r" command translates something like "1d20+5" into a roll. It is similar, but not exactly like, typing "[[1d20+5]]". So, since you have brackets which are also in-line rolling, it might be causing issues. It also looks like there are more brackets than needed. Since I don't have a way to test this without changing all the attributes can you test this and let me know if it works? [[ 1d20 + ?{Personnage ? |Hylianne,              ?{Compétence ? | Force, @{Hylianne|ModFor} | Dextérité, @{Hylianne|ModDex} | Constitution, @{Hylianne|ModCon} | Intelligence, @{Hylianne|ModInt} |Sagesse, @{Hylianne|ModSag} |Foi, @{Hylianne|ModFoi}     }  |Will,              ?{Compétence ? |Force, @{Will Thucker|ModFor} |Dextérité, @{Will Thucker|ModDex} |Constitution, @{Will Thucker|ModCon} |Intelligence, @{Will Thucker|ModInt} |Sagesse, @{Will Thucker|ModSag} |Foi, @{Will Thucker|ModFoi}     }  |Bagherra,     ?{Compétence ? |Force, @{Bagherra|ModFor} |Dextérité,@{Bagherra|ModDex} |Constitution, @{Bagherra|ModCon} |Intelligence, @{Bagherra|ModInt} |Sagesse, @{Bagherra|ModSag} |Foi, @{Bagherra|ModFoi}     }  |Nifwa Nilwa,              ?{Compétence ? |Force, @{Nifwa Nilwa|ModFor} |Dextérité, @{Nifwa Nilwa|ModDex} |Constitution, @{Nifwa Nilwa|ModCon} |Intelligence, @{Nifwa Nilwa|ModInt} |Sagesse, @{Nifwa Nilwa|ModSag} |Foi, @{Nifwa Nilwa|ModFoi}     }  } ]]
Thanks for your answer Didn't know that double brackets meant in-line roll, sorry for the useless brackets. I have the same result as before though, nothing desplayed in chat. I have created a second macro with "target" instead of characters, so it cancels one "level" out, and works. Jet de compétence pour @{selected|token_name} /r 1D20 + ?{Compétence ? | Force, @{selected|ModFor} | Dextérité, @{selected|ModDex} | Constitution, @{selected|ModCon} | Intelligence, @{selected|ModInt} | Sagesse, @{selected|ModSag} | Foi, @{selected|ModFoi}  } So basically I've found a workaround that is quite acceptable, but I'd like to understand why - and how - nothing is printed in the chat, not even an error message...
Jordan C.  said: The "/r" command translates something like "1d20+5" into a roll. It is similar, but not exactly like, typing "[[1d20+5]]". So, since you have brackets which are also in-line rolling, it might be causing issues. It also looks like there are more brackets than needed. Since I don't have a way to test this without changing all the attributes can you test this and let me know if it works? [[ 1d20 + ?{Personnage ? |Hylianne,              ?{Compétence ? | Force, @{Hylianne|ModFor} | Dextérité, @{Hylianne|ModDex} | Constitution, @{Hylianne|ModCon} | Intelligence, @{Hylianne|ModInt} |Sagesse, @{Hylianne|ModSag} |Foi, @{Hylianne|ModFoi}     }  |Will,              ?{Compétence ? |Force, @{Will Thucker|ModFor} |Dextérité, @{Will Thucker|ModDex} |Constitution, @{Will Thucker|ModCon} |Intelligence, @{Will Thucker|ModInt} |Sagesse, @{Will Thucker|ModSag} |Foi, @{Will Thucker|ModFoi}     }  |Bagherra,     ?{Compétence ? |Force, @{Bagherra|ModFor} |Dextérité,@{Bagherra|ModDex} |Constitution, @{Bagherra|ModCon} |Intelligence, @{Bagherra|ModInt} |Sagesse, @{Bagherra|ModSag} |Foi, @{Bagherra|ModFoi}     }  |Nifwa Nilwa,              ?{Compétence ? |Force, @{Nifwa Nilwa|ModFor} |Dextérité, @{Nifwa Nilwa|ModDex} |Constitution, @{Nifwa Nilwa|ModCon} |Intelligence, @{Nifwa Nilwa|ModInt} |Sagesse, @{Nifwa Nilwa|ModSag} |Foi, @{Nifwa Nilwa|ModFoi}     }  } ]] I believe there's also going to be an issue with each of the 'Compétence' queries, as they all have the same Query Name.   There is also the issue with the order of operations , and embedded queries inside queries. I'm surprised that you said you can select the character from the first query and then which characteristic bonus to add at all... when I just cut and paste your macro as is I get this:
1611764456
Jordan C.
Pro
API Scripter
It may seem silly, but it has to do with where the line breaks occur. As for the lack of error messages, I am not entirely certain why it gets bypassed. Anyway, I think I found the problem in that the "|" character is needs to be at the end of the dropdown options instead of leading the names. Here is the adjusted macro [[ 1d20 + ?{Personnage ?| Hylianne,              ?{Compétence ? | Force, @{Hylianne|ModFor} | Dextérité, @{Hylianne|ModDex} | Constitution, @{Hylianne|ModCon} | Intelligence, @{Hylianne|ModInt} |Sagesse, @{Hylianne|ModSag} |Foi, @{Hylianne|ModFoi}     }| Will,              ?{Compétence ? |Force, @{Will Thucker|ModFor} |Dextérité, @{Will Thucker|ModDex} |Constitution, @{Will Thucker|ModCon} |Intelligence, @{Will Thucker|ModInt} |Sagesse, @{Will Thucker|ModSag} |Foi, @{Will Thucker|ModFoi}     }| Bagherra,      ?{Compétence ? |Force, @{Bagherra|ModFor} |Dextérité,@{Bagherra|ModDex} |Constitution, @{Bagherra|ModCon} |Intelligence, @{Bagherra|ModInt} |Sagesse, @{Bagherra|ModSag} |Foi, @{Bagherra|ModFoi}     }| Nifwa Nilwa,              ?{Compétence ? |Force, @{Nifwa Nilwa|ModFor} |Dextérité, @{Nifwa Nilwa|ModDex} |Constitution, @{Nifwa Nilwa|ModCon} |Intelligence, @{Nifwa Nilwa|ModInt} |Sagesse, @{Nifwa Nilwa|ModSag} |Foi, @{Nifwa Nilwa|ModFoi}     }  } ]] I think before it would output something like this [[ 1d20 + 5 ]] since it saw a line break occur at the end of the options description which was breaking up the inline roll.
1611764758

Edited 1611764827
Jordan C.
Pro
API Scripter
Jarren K. said: I believe there's also going to be an issue with each of the 'Compétence' queries, as they all have the same Query Name.   There is also the issue with the order of operations , and embedded queries inside queries. I'm surprised that you said you can select the character from the first query and then which characteristic bonus to add at all... when I just cut and paste your macro as is I get this: I believe that happens since your game wouldn't have characters or the subsequent attributes. Since they are parsed immediately, they return a number when those attributes exist in the game and therefore don't break the query with the "}" that trails an attribute name that isn't parsed into anything. (Edit to add: this is evident when the chat returns the error along the lines of "No attribute found for @{Hylianne|ModFor}" As for the queries with the same name it isn't an issue with nested queries since selecting an option only creates one string that has the single query. As far as the chat is concerned it should never even see the other instances of the queries that aren't selected.
1611764897
GiGs
Pro
Sheet Author
API Scripter
Jordan C. said: It may seem silly, but it has to do with where the line breaks occur. As for the lack of error messages, I am not entirely certain why it gets bypassed. Anyway, I think I found the problem in that the "|" character is needs to be at the end of the dropdown options instead of leading the names.  This is correct. Queries need to be all on one line, but you can have a linebreak immediately after the | that signifies the end of a query row.
Okay. Thanks to your help, I was able to make it work. The adjusted macro you provided didn't change all the | that are placed after the line break. I did replace them, but it still didn't work. So, what I did by looking at the "order of operation" was to change in-line roll into a command roll. And it actually worked ! The little problem is just that... Well, I cannot have line breaks into command rolls, so the macro is insanely ugly. But still ! It works ! Here's the code, if you're curious : /roll 1d20 + ?{Personnage ?| Hylianne, ?{Compétence d'Hylianne ? |  Force, @{Hylianne|ModFor} |  Dextérité, @{Hylianne|ModDex} | Constitution, @{Hylianne|ModCon} | Intelligence, @{Hylianne|ModInt} | Sagesse, @{Hylianne|ModSag} | Foi, @{Hylianne|ModFoi}  }| Will, ?{Compétence de Will ? | Force, @{Will Thucker|ModFor} | Dextérité, @{Will Thucker|ModDex} | Constitution, @{Will Thucker|ModCon} | Intelligence, @{Will Thucker|ModInt} | Sagesse, @{Will Thucker|ModSag} | Foi, @{Will Thucker|ModFoi}  }| Bagherra,  ?{Compétence de Bagherra ? | Force, @{Bagherra|ModFor} | Dextérité,@{Bagherra|ModDex} | Constitution, @{Bagherra|ModCon} | Intelligence, @{Bagherra|ModInt} | Sagesse, @{Bagherra|ModSag} | Foi, @{Bagherra|ModFoi}  }| Nifwa Nilwa, ?{Compétence de Nifwa ? | Force, @{Nifwa Nilwa|ModFor} | Dextérité, @{Nifwa Nilwa|ModDex} | Constitution, @{Nifwa Nilwa|ModCon} | Intelligence, @{Nifwa Nilwa|ModInt} | Sagesse, @{Nifwa Nilwa|ModSag} | Foi, @{Nifwa Nilwa|ModFoi}  } } Thank you ! 
1611767054

Edited 1611776780
Jordan C.
Pro
API Scripter
Ah my mistake! and the reason it still didn't work was I did not remove the line break after the labels. I recreated characters and attributes with those names to test and this  one should work now as I managed to test it successfully in my game. [[ 1d20 + ?{Personnage ?|     Hylianne, ?{Compétence ?|     Force, @{Hylianne|ModFor}|      Dextérité, @{Hylianne|ModDex}|     Constitution, @{Hylianne|ModCon}|     Intelligence, @{Hylianne|ModInt}|     Sagesse, @{Hylianne|ModSag}|     Foi, @{Hylianne|ModFoi}}|     Will, ?{Compétence ?| Force, @{Will Thucker|ModFor}|     Dextérité, @{Will Thucker|ModDex}|     Constitution, @{Will Thucker|ModCon}|     Intelligence, @{Will Thucker|ModInt}|     Sagesse, @{Will Thucker|ModSag}|     Foi, @{Will Thucker|ModFoi}}|     Bagherra, ?{Compétence ?|     Force, @{Bagherra|ModFor}|      Dextérité, @{Bagherra|ModDex}|     Constitution, @{Bagherra|ModCon}|     Intelligence, @{Bagherra|ModInt}|      Sagesse, @{Bagherra|ModSag}|     Foi, @{Bagherra|ModFoi}}|     Nifwa Nilwa, ?{Compétence ?|      Force, @{Nifwa Nilwa|ModFor}|      Dextérité, @{Nifwa Nilwa|ModDex}|      Constitution, @{Nifwa Nilwa|ModCon}|     Intelligence, @{Nifwa Nilwa|ModInt}|     Sagesse, @{Nifwa Nilwa|ModSag}|     Foi, @{Nifwa Nilwa|ModFoi}} }]]
It does work ! Thanks a lot, I thought about moving the line breaks after the label but without ending the stat block with " }| " in the same row. It's much more pretty than the one I did with command roll :D So line breaks can mess up your whole macro, ok, got it... Thanks !