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'm back to Roll20 but I need your help for one of my macro (My head is burning...)

Hello guys, as you saw it on the title, i'm back in roll20 after a +2 years break to start a brand new campaign in my homebrews but I just can't remember how macros work specifically... I got this one for my players to roll some of their skills (skills are in french) :  /em : [[1d20cs<1cf>20]]/[[?{Compétence d'Exploration|  Acrobatie,@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1 Acrobatie|  Athlétisme,@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1 Athlétisme|  Intimidation,@{Patrick|Intimidation}+{@{Patrick|Physique},12}kl1 Intimidation|  Perspicacité,@{Patrick|Perspicacité}+{@{Patrick|Mental},12}kl1 Perspicacité}]] Basically, what it does is taking your stat (max 12) and adding (or not) your skill bonus to it. But what i would like is showing the name of the skill in the chat because currently, it's only showing it in the details of the roll when you hover your mouse above the result.... any ideas ?
1713246194
GiGs
Pro
Sheet Author
API Scripter
So that you can  sort it yourself: |  Acrobatie,@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1 Acrobatie|  Athlétisme,@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1 Athlétisme | In the above, the comma is where the output to chat starts, rght up to the |. Be careful not to mess up special sequences like these , (starting with & and ending with semi-colon)
GiGs said: So that you can  sort it yourself: |  Acrobatie,@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1 Acrobatie|  Athlétisme,@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1 Athlétisme | In the above, the comma is where the output to chat starts, rght up to the |. Be careful not to mess up special sequences like these , (starting with & and ending with semi-colon) I did not see what have changed in this. I've tried it out but still, the name of the skill did not shows off in the chat
Maybe a screen shot will be clearer
1713281214
Gauss
Forum Champion
Hi Mat,  What you want would be a completely new query, tacked onto the macro above.  example (bold is the new part, using English names rather than trying to figure out the French letters):  /em : [[1d20cs<1cf>20]]/[[?{Compétence d'Exploration|  Acrobatie,@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1 Acrobatie|  Athlétisme,@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1 Athlétisme|  Intimidation,@{Patrick|Intimidation}+{@{Patrick|Physique},12}kl1 Intimidation|  Perspicacité,@{Patrick|Perspicacité}+{@{Patrick|Mental},12}kl1 Perspicacité}]] ?{Skill name|Acrobatics,Acrobatics|Athletics,Athletics|Intimidation,Intimidation} Etc.  The reason is you want a completely different output to your query and a query cannot have to completely different outputs. 
1713282228

Edited 1713282239
GiGs
Pro
Sheet Author
API Scripter
I dont think he needs a new query, because the skill name is already selected when he runs the first query.
1713283535

Edited 1713283578
Gauss
Forum Champion
GiGs said: I dont think he needs a new query, because the skill name is already selected when he runs the first query. I thought about that, but how would they strip out all the other stuff from the output of the first one?  They want only the name, not all the other stuff.  A query cannot have two outputs. 
1713286015
timmaugh
Forum Champion
API Scripter
Gauss said: GiGs said: I dont think he needs a new query, because the skill name is already selected when he runs the first query. I thought about that, but how would they strip out all the other stuff from the output of the first one?  They want only the name, not all the other stuff.  A query cannot have two outputs.  Right... you can use a query for multiple results if scripts are available -- it's fairly trivial to do with metascripts. But without scripts I think you have to have a dedicated query for each different return you want for a particular choice.
Oh well ok.  That's what I thought at first, but I wanted to check if there was a relatively simple solution to the question. I'm going to keep the original macro so as not to overload the system for aesthetic reasons then.  Thank you all for your help ! =)
1713286574
GiGs
Pro
Sheet Author
API Scripter
Gauss said: GiGs said: I dont think he needs a new query, because the skill name is already selected when he runs the first query. I thought about that, but how would they strip out all the other stuff from the output of the first one?  They want only the name, not all the other stuff.  A query cannot have two outputs.  I thought they wanted both: the name and the other stuff.,
1713286615
GiGs
Pro
Sheet Author
API Scripter
Mat said: Oh well ok.  That's what I thought at first, but I wanted to check if there was a relatively simple solution to the question. I'm going to keep the original macro so as not to overload the system for aesthetic reasons then.  Thank you all for your help ! =) You can do what you want. We just need to know how you want to display it (language barrier might be a problem too).
1713287075

Edited 1713287113
Gauss
Forum Champion
GiGs, the format they wanted is in the third part of the image: That would require a new query (or a script as timmaugh stated). Mat said: Maybe a screen shot will be clearer
1713288094

Edited 1713288142
GiGs
Pro
Sheet Author
API Scripter
I'm not following why that would need an extra script. Isn't that just adding the name of the roll to the end of the roll? The roll is still there. Mat can you describe exactly what you want the output to be? Don't merntion any roll20 terms. Just describe the information you want to appear in chat, as if you were describing it to a new player in your game. There might be an easier way to do what you want.
1713289724

Edited 1713289787
Gauss
Forum Champion
It doesn't need an extra script, it needs an extra query. The script statement was to avoid an extra query.  What the user wants is this (as per the image above):  "inline calculation" / "inline calculation from a query" "name based on the query" Right now the "name based on the query" is inside the "inline calculation from a query". They want it moved outside.  Here is a simplified version of what they have:  [[1d20]] / [[?{Query1|Option 1,1d20+1[Option1]|Option 2,1d20+2[Option2]}]] Displaying:  # / # With hover showing the [option1] or [option2] Here is a simplified version of what they want:  [[1d20]] / [[?{Query1|Option 1,1d20+1|Option 2,1d20+2}]] ?{Query2|Option 1,Option1|Option 2,Option2} Displaying:  # / # Option number
1713290507

Edited 1713291501
Gauss
Forum Champion
However, in discussing all this I did figure out a solution.  Mat,  You (well your GM actually) will need to create a number of Rollable Tables.  Table 1 name:  Acrobatie Table 1 entry 1 output:  Acrobatie Table 2 name:  Athlétisme Table 2 entry 1 output:  Athlétisme Table 3 name:  Intimidation Table 3 entry 1 output:  Intimidation and so on.  Next, replace:  Acrobatie with  [[1t[ Acrobatie ]]] Do that for each name It should look something like this:  /em : [[1d20cs<1cf>20]]/[[?{Compétence d'Exploration|  Acrobatie,@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1 [[1t[Acrobatie]]] |  Athlétisme,@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1  [[1t[ Athlétisme]]] |  Intimidation,@{Patrick|Intimidation}+{@{Patrick|Physique},12}kl1  [[1t[ Intimidation]]] |  Perspicacité,@{Patrick|Perspicacité}+{@{Patrick|Mental},12}kl1  [[1t[ Perspicacité]]] }]] $[[1]] Note: this was based on your initial post, any changes or fixes from further down the thread still need to be performed. Changes I made are in bold (Edited to provide a clearer example) Possible errors: Because I don't know how many inline rolls there are in your attributes $[[1]] may need to be changed to $[[2]], $[[3]] etc. Change the number until it pulls the name correctly.
1713293057

Edited 1713300233
timmaugh
Forum Champion
API Scripter
Here's another thought... which, as I look at what Gauss just suggested, is sort of the same concept but just in reverse. Since queries are resolved before inline rolls , you can provide the roll closure as a part of the query return, and follow it with the name... something like this: /em : [[1d20cs<1cf>20]]/[[?{Compétence d'Exploration| Acrobatie,@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1 ]] Acrobatie| Athlétisme,@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1]] Athlétisme| Intimidation,@{Patrick|Intimidation}+{@{Patrick|Physique},12}kl1]] Intimidation| Perspicacité,@{Patrick|Perspicacité}+{@{Patrick|Mental},12}kl1]] Perspicacité} That just moves the last closing double brace (that would end the roll) into each option, so that each option can continue to the name of the option -- which is what the query looks like it was set up to do. Like you said, you were *trying* to do this, you just didn't know how. This is the same sort of thing Gauss suggested, in that he put an entire roll inside the query so that he could refer to it, later. No matter which option you pick, in that case, you will have an effective "second" roll (or, $[[1]] ) which you can refer to. Well, it's the same thing to just end the roll in the query and let it continue, as I'm showing.
1713294128

Edited 1713294241
Hi Mat, Maybe the solution is to move the brackets to exclude the name of the skill like below: /em rolls for: [[1d20cs<1cf>20]]/?{Compétence d'Exploration| Acrobatie,[[@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1]] Acrobatie| Athlétisme,[[@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1]] Athlétisme| Intimidation,[[@{Patrick|Intimidation}+{@{Patrick|Physique},12}kl1]] Intimidation| Perspicacité,[[@{Patrick|Perspicacité}+{@{Patrick|Mental},12}kl1]] Perspicacité} It should rolls and display both the rolls AND the skill name as you wished in the first place. edit: well as timmaugh said >_<
1713297525

Edited 1713297792
Gauss
Forum Champion
Timmaugh's solution is better than mine, use his. (I missed it, brain went down a different rabbit hole) :)
1713305061

Edited 1713306255
timmaugh said: Here's another thought... which, as I look at what Gauss just suggested, is sort of the same concept but just in reverse. Since queries are resolved before inline rolls , you can provide the roll closure as a part of the query return, and follow it with the name... something like this: /em : [[1d20cs<1cf>20]]/[[?{Compétence d'Exploration| Acrobatie,@{Patrick|Acrobatie}+{@{Patrick|Finesse},12}kl1 ]] Acrobatie| Athlétisme,@{Patrick|Athlétisme}+{@{Patrick|Physique},12}kl1]] Athlétisme| Intimidation,@{Patrick|Intimidation}+{@{Patrick|Physique},12}kl1]] Intimidation| Perspicacité,@{Patrick|Perspicacité}+{@{Patrick|Mental},12}kl1]] Perspicacité} That just moves the last closing double brace (that would end the roll) into each option, so that each option can continue to the name of the option -- which is what the query looks like it was set up to do. Like you said, you were *trying* to do this, you just didn't know how. This is the same sort of thing Gauss suggested, in that he put an entire roll inside the query so that he could refer to it, later. No matter which option you pick, in that case, you will have an effective "second" roll (or, $[[1]] ) which you can refer to. Well, it's the same thing to just end the roll in the query and let it continue, as I'm showing. Wow it just worked perfectly, it was so simple in fact x)  Thank you very much for all your help and your brainwork guys (and sorry for my bad english sometimes...) !!