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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Odd behaviour of sendChat when processing inline rolls

I'm experiencing some weird problems with processing of inline rolls through a script that calls sendChat function. All of them are calculated, however some results aren't returned as roll objects ($[[#roll]] form), but as a simple text number (i.e. 14). The script is PowerCards . It calls sendChat with various inlinerolls as input, like these: "Ataque #1":"[[ [$Atk1] 1d20 + 4 [Escarabajo de Fuego] ]] vs [[[[10+[[floor(1/2)]]]]+[[[[[[floor((18-10)/2)]]]]]]+0+1+0+0+0+0]] (Ezren)", "Ataque #2":"[[ [$Atk2] 1d20 + 4 [Escarabajo de Fuego] ]] vs [[[[10+[[floor(1/2)]]]]+0+2+1+0+0+1+0]] (Seelah)", "?? $Atk1.base > 1 ?? Crítico":"[[18 ]] fire (Ezren)", "?? $Atk2.base > 1 ?? Crítico":"[[18 ]] fire (Seelah)", What the callback function recieves for the previous code is this: "Ataque #1":"$[[1]] vs $[[21]] (Ezren)", "Ataque #2":"$[[2]] vs 14 (Seelah)", "?? $Atk1.base > 1 ?? Crítico":"$[[3]] fire (Ezren)", "?? $Atk2.base > 1 ?? Crítico":"$[[4]] fire (Seelah)", The seconds inline rolls for the two first lines are treated different. For the first one, the number is passed as a roll ID -and it's shown correctly on the chat-. For the second one, the number is the result of the roll, and its passed as simple text.
Sines , I forgot to mention after reading your post in the PowerCards thread that PowerCards becomes buggy when you have multiple tags with the same name. In your usecase, you'll want to use: --?? $Atk1.base > 1 ?? Crítico *1|[[18]] fire (@{target|1st|token_name}) --?? $Atk2.base > 1 ?? Crítico *2|[[18]] fire (@{target|2nd|token_name}) --?? $Atk3.base > 1 ?? Crítico *3|[[18]] fire (@{target|3rd|token_name}) ... --?? $Atk9.base > 1 ?? Crítico *9|[[18]] fire (@{target|9th|token_name})
Great! That solves my problem with conditionals in the power card. Thank you Silvyre :) now I can use my macro well enough. The problem I reported in this thread still exists. Some rolls are sent to chat as simple text, so nobody can see the roll info expanded on mouse over. Sometimes the affected it's the first inline roll of the line, sometimes the second. It's difficult to reproduce a expected behaviour. I just can say it's always on the last line of the form TAG : ROLL vs ROLL I'm pretty sure this is related with the sendChat function of the API and I don't know how to alter the input in order to avoid this problem.
Sines said: Some rolls are sent to chat as simple text, so nobody can see the roll info expanded on mouse over. Try padding the interiors of your inline roll brackets with spaces. e.g. turn [[1d6]] into [[ 1d6 ]]
Problem solved. It was related with [[ ]] brackets as Silvyre suggested. Thank you very much. I was sending to sendChat a floor function with even triple [[ ]] brackets like this: [[[[10+[[floor(1/2)]]]]+ [[[[[[floor((18-10)/2)]]]]]] +0+1+0+0+0+0]] I couldn't modify it by padding the interiors as suggested because that created other problems in the script. What I did is avoid adding brackets if the content is already surrounded by them. Now it sends this: [[[[10+[[floor(1/2)]]]]+ [[floor((18-10)/2)]] +0+1+0+0+0+0]]
Great to hear! If you encounter any other issues, please don't hesitate to open up another bug report. I'll mark this one as resolved.