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

I've got a comma problem (not as simple at it seems) !!

Fristly I'm not english so excuse me for every mistakes... But here is my problem : - I'm trying to make a macro that will add two different Attributes (easy so far); - I want to cap the sum of these two Attributes not to exceed 16; - I therefore see myself in the obligation (or not but I'm not aware of it?) to use the k.eep l.owest 1 macro wich is composed as follows : {@{name|Attributes},12}kl1; - (Don't worry about the 12 it's part of my rules); - HOWEVER !!!! - I intend to include this macro with about ten other identical ones (one per Attribute) in a Query macro : ? {name of the list |Attribute 1| Attribute 2|...}; - Wich implies tant the comma included in : {@{name|Attributes},12}kl1 totally kills my Query macro - I've tried to replace it with an HTML shortcut (, and &#44) but unfortunately this doesn't work.... despite the fact that my macro is perfectly working without the HTML shortcut (but not in a Query menu !!); - ... - Ideas ? Advices ? :D
The comma after the attribute needs to be escaped and so does the closed bracket before the kl1.  For each query entry.  
1635977776

Edited 1635977792
I've just tried and it doesn't work neither... It gives the score of the Attribute and the score of 16 I want in the same time. Here my Attribute is 15 so it gives me the result of 1516
Please post your entire macro here and it will be much easier to help. The basic roll for the attributes added together with a max of 16 will be something like this: [[{[[@{selected|attribute1} + @{selected|attribute2}]],16}kl1]] But if you want to replace 'attribute1' and 'attribute2' with queries, that's going to be difficult, as the ability call @{ } happens before the query ?{ }. That will become something like this (and this only has 3 attributes, and I haven't error checked it so it probably still doesn't work as written): [[{[[?{1st Attribute?|attribute1name,@{selected|attribute1}|attribute2name,@{selected|attribute2}|attribute3name,@{selected|attribute3}} + ?{2nd Attribute?|attribute1name,@{selected|attribute1}|attribute2name,@{selected|attribute2}|attribute3name,@{selected|attribute3}}]],16}kl1]]
Hello, my macro will be something like ?{Attributes| Attribute1, [[1d20cs<1cf>20]]/[[@{charactername|Attribute1}+{@{charactername|Strengh},12}kl1]] | Attribute2, [[1d20cs<1cf>20]]/[[@{charactername|Attribute2}+{@{charactername|Strengh},12}kl1]]} And for what I think, it's only the the comma before the 12 (that for some reason i can't change for HTML) wich destroys my macro
1635996219
GiGs
Pro
Sheet Author
API Scripter
Your macro has an extra { here: {@{charactername|Strengh} That first { shouldnt be there and will break your macro. You can often put the query inside the roll and avoid query syntax problems. A simple rule with queries is to put everything that is duplicated outside the query. For example: [[1d20cs<1cf>20]]/[[{?{Attributes| Attribute1,@{charactername|Attribute1}| Attribute2,@{charactername|Attribute1}}+@{charactername|Strengh},12}kl1]] Or if you want to tie specific secondary attributes to the attribute chosen: [[1d20cs<1cf>20]]/[[{?{Attributes| Attribute1,@{charactername|Attribute1}+@{charactername|Strengh}| Attribute2,@{charactername|Attribute1}+@{charactername|Strengh}},12}kl1]] In a query I like to include a linebreak immediately after each | - because you can. It makes macros more readable. By the way, is @{charactername|Strengh} correctly? Should it be Streng t h ?
1636010696

Edited 1636010771
@GiGs :  - I've tried to remove the extra { but it breaks my kl1 : [[1d20cs<1cf>20]]/[[@{none|Acrobatie}+@{none|Physique},12}kl1]] instead of : [[1d20cs<1cf>20]]/[[@{none|Acrobatie}+{@{none|Physique},12}kl1]] the first one works but not the second one wich gives me the score of 19 instead of 16 - I've tried your macro with your query inside the roll but it doesn't change the problem of the comma (and &#44 still doesn't work..), wich gives me something like : [[1d20cs<1cf>20]]/[[{?{Attributes| Attribute1, @{none|Acrobatie}+{@{none|Physique}&#44 12}kl1| Attribute2, @{none|Baratin}}+{@{none|Physique}&#44 12}kl1}]] or with the comma : [[1d20cs<1cf>20]]/[[{?{Attributes| Attribute1, @{none|Acrobatie}+{@{none|Physique},12}kl1| Attribute2, @{none|Baratin}}+{@{none|Physique},12}kl1}]] but neither of the two work, my query menu shows me the entire macro instead of "Attribute 1", "Attribute 2", ... - I've succed to keep working the query with the following macro (no kl1 on the first query) : [[1d20cs<1cf>20]]/[[?{Attributes| Attribute1,@{none|Physique}| Attribute2,@{none|Acrobatie}+{@{none|Physique},12}kl1| Attribute3,@{none|Baratin}+{@{none|Physique},12}kl1}]] But for some reason my kl1 aren't working anymore... with and with out the { after the + - Thank you for the linebreak tip, I didn't know it ! - And sorry for the Streng T h, I'm not English so... it just happened ^^"
I tried to siimplify wth my own macro and there seems to be some sort of problematic interaction with the kh1 system where it requires a bracket and its throwing off the order of operations.  My guess is there is a need for unorthodox escapes but I can't find the right level and interplay to get the macro to work.  I think its just not possible without api.  
Your HTML entity replacement is incorrect. Both the comma and right curly } before the kl1 need to be changed. So where you have (inside a query) ,12}kl1 needs to be replaced by ,12}kl1
RainbowEncoder said: Your HTML entity replacement is incorrect. Both the comma and right curly } before the kl1 need to be changed. So where you have (inside a query) ,12}kl1 needs to be replaced by ,12}kl1 We get a general error when we follow traditional Order of Operations and escape out properly.  This is I believe because the kh1 function fires out of order in some way making it impossible to escape out stuff.   There was an error with your formula. Please try again.
DM Eddie said: We get a general error when we follow traditional Order of Operations and escape out properly.  This is I believe because the kh1 function fires out of order in some way making it impossible to escape out stuff.   There was an error with your formula. Please try again. For reference this is the macro I tested with [[1d20cs<1cf>20]]/[[?{Attributes| Attribute1,4+{@{selected|bar1},12}kl1| Attribute2,4+{@{selected|bar2},12}kl1| Attribute3,4+{@{selected|bar3},12}kl1}]] That error is likely the result of some other problem with the macro rather than the kl1. If the Drop/Keep was firing out of order I doubt they would work at all which would be a major bug.
RainbowEncoder said: Your HTML entity replacement is incorrect. Both the comma and right curly } before the kl1 need to be changed. So where you have (inside a query) ,12}kl1 needs to be replaced by ,12}kl1 Wow thank you Rainbow, it finally works !!!! Thank you all for your help, hope I will be able to make the change I rule in 15 min ^^"
1636065668
GiGs
Pro
Sheet Author
API Scripter
When I commented about the { causing issues before, I was misunderstanding the process of your code. RainbowEncoder's answer helped me see what you were doing and why they were necessary in this case. But this is case where there are two situations, one of which needs the html entities, and another doesnt. In your code you do this: Player selects an attribute, then you add that attribute to [lowest of a second attribute and 12]. If that second attribute is always fixed and independent of the first, you don't need the html emties. You can do [[1d20cs<1cf>20]]/[[?{Attributes| Attribute1, @{none|Acrobatie}| Attribute2, @{none|Baratin}}+{@{none|Physique},12}kl1}]] In this version you move the [lowest of second attribute and 12] outside of the query. But if that second attribute isnt always Physique, and it depends on the first attribute and so has to be inside the query, RainbowEncoder's solution is the one to go with.
Yes the second Attribute depends of the first but thank you