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 saying what i'm rolling and showing the result

Hi guys!    First time on this wonderfull app, so first of all, thanks to the team for the awesome work ! Mates and I are still discovering the possibilities of the macro, and tomorrow is the big night : First chapter of our new adventure on Vampire, The Masquerade. To celebrate, I'm trying to make a little macro able to suit every rolls. What I want to do : a macro who ask me an attribute and an ability and lauch the sum of this as d10. Where i'm having some trouble is when I want this in the chat box :  Player rolls  Attribute 2 and Abilitiy 5 rolling (attribute2_value + ability5_value) d10 Result What I've made : A macro "attributes" who looks like : ?{ Attributes | Attribute 1, @{Player|Attribute1} | Attribute 2, @{Player|Attribute2} | Attribute 3, @{Player|Attribute3} | etc... } A macro "abilities" who looks like :  ?{ Abilities | Ability 1, @{Player|Ability1} | Ability 2, @{Player|Ability2} | Ability 3, @{Player|Ability3} | etc... } And finally a macro to roll my dices /me rolls  #Attributes et #Abilities /roll (#Attributes + #Abilities )d10>?{modifier|6}f1 Problem : The first 2 macros give a number, the roll is perfect. I can choose my attribute and next my abilty in a list, set a modifier for the difficulty, etc... The problem is the first line. Where I want : Player rolls Attribute 2 and Ability 5  (ie : the name of my variable) I obtain Player rolls Attribute2_value and Ability5_value (ie : the value of my variable.) So, I looked to advance roll query but I didn't find the answer. Could someone help me on this one ? Thank you all, and have fun! PS : I want to print the label (eg: attribute 2) of my variable and not the name of the variable (attribute2) in the character sheet cause all of us are not english speakers (neither am I, as you can see ^^) , so I translate the name of abilities and attributes for them.
1481427025

Edited 1481427058
I recommend using Inline Labels : ! ?{Attributes| Attribute 1, [Attribute1] @{Player|Attribute1} | Attribute 2, [Attribute2] @{Player|Attribute2} | Attribute 3, [Attribute3] @{Player|Attribute3} | etc... } ?{Abilities| Ability 1, [Ability1] @{Player|Ability1} | Ability 2, [Ability2] @{Player|Ability2} | Ability 3, [Ability3] @{Player|Ability3} | etc... } /me rolls ?{Attributes} et ?{Abilities} /roll [[ ?{Attributes} + ?{Abilities} ]]d10>?{modifier|6}f1
Thank you! I'll try this tonight. Just a question : what's the need of the exclamation mark at the beginning? 
1481465681

Edited 1481465833
Newaa . said: what's the need of the exclamation mark at the beginning?  To hide some output. From API:Chat : If a player enters a chat message beginning with an exclamation mark (!), that message will have the type of "api" and not be shown to anyone. Alternatively, /me rolls ?{Attributes| Attribute 1, [Attribute1] @{Player|Attribute1} | Attribute 2, [Attribute2] @{Player|Attribute2} | Attribute 3, [Attribute3] @{Player|Attribute3} | etc... } et ?{Abilities| Ability 1, [Ability1] @{Player|Ability1} | Ability 2, [Ability2] @{Player|Ability2} | Ability 3, [Ability3] @{Player|Ability3} | etc... } /roll [[ ?{Attributes} + ?{Abilities} ]]d10>?{modifier|6}f1
1481465984

Edited 1481466021
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Starting a line with an exclamation point makes the line an API command and prevents it from being displayed to chat. You can send API commands regardless of your subscription level (there's just nothing there to react to them unless you're in a pro game using scripts. Ninja'd by Silvyre ;)
OK, I see :-) ty for the answers, I'll see further in all those macro possibilities, it looks fun ^^ 
Plop, sorry, i'm back ^^ So, I test your solution and I still have some issues.  First, I wrote this simple macro as test  : ! ?{Attribut | Force, [Force] @{Erwan|Strength} | Perception, [Perception] @{Erwan|Perception} } /me rolls ?{Attribut} /roll [[ ?{Attribut} ]]d10>?{Difficulté|6}f1 But the first is that i'm first asked "Attribut" with the list "Force / Perception" and a second time where I have to indicate the number of dice I want to roll (a value). And finally a value for "difficulté" but it's I what I want, so no problem. But I would like to be asked only one time for "attribut" with the list and that the macro calculate itself the number of dice.  Then, my result is something like : Erwan rolls 5 Erwan: rolling 5 d10>6f1 ( <6>+<9>+<1>+<5>+<3> ) = 1 Successes Where I choose first "force" for instance and then "5" for the value the second time i'm asked for "attribut". So, two things : The macro "doesn't remember" the value of "attribut" I first chose and doesn't apply it in the formula (I have 2 in my "Strength" attribute in my character sheet). So, where I see "Erwan rolls 5", What I expected is : "Erwan rolls Force 2" If I add a second list "abilities", I got the same problem and at the end I have as a result the addition of the  variables I gave, not a roll of this amount of d10. I tested the second solution you proposed, it looks like  : /me rolls ?{Attribut | Force, Force @{Erwan|Strength} | Perception, [Perception] @{Erwan|Perception} } /me rolls ?{Attribut} /roll [[ ?{Attribut} ]]d10>?{Difficulté|6}f1 This time, I obtain : Erwan rolls Force 2 Erwan: rolling 5 d10>6f1 ( <6>+<9>+<1>+<5>+<3> ) = 1 Successes So, it's nice for the "/me rolls..." but there still is a problem where i'm asked for a value for "attribut" where I entered 5. And I obtain 5 d10 where I wanted 2. The macro "forget" what I told it in the first request for the second call of "attribut". Like if it was not a global variable maybe (old computing lessons coming back ^^) All that to say : If you have some time to help, it would be great :) Otherwise, it's not that important, My actual version does the job :)  Thanks for reading until here, I can make some TL;DR if you want :D Have a good evening, bye!
1481669093
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The naming of roll queries is very precise, your first query is named :?{Attribut }, while your later ones are ?{Attribut}; these are two different variables as far as the dice engine is concerned. Take out the space between Attribut and the first bar.
Hi!   Perfect, there was an error here, you're right ! It resolved the problem of having a second demand for the variable, ty :) But the I still add some errors for the final calculation or simply the macro was not doing a thing. Finally it worked when I wrote in variable  "Attribute 1, @{player|Attribute1} [Attribute 1] | " and not "Attribute 1, [Attribute 1] @{player|Attribute1} | " Why, I don't really understand, maybe a proble of order of operation, don't now exactly but, all to say : It perfectly works ! So thank you a lot for your patience, have a good day and see you later!
1481762633
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Roll tags have to come after the roll/number, not before, as far as I know.
1481763068

Edited 1481763453
Scott C. said: Roll tags have to come after the roll/number, not before, as far as I know. Maybe. To add, [[ [a] d0 ]] and [[ [a] 0d0 ]] work in the Text Chat while [[ [a] 0 ]] fails in the Text Chat. Regardless, these cases are being looked into by the Devs .
1481763673
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, thanks for the clarification Silvyres.
1481789412
Jakob
Sheet Author
API Scripter
That's actually a different issue (I think), my bug report was for expressions which work in the chat, but do not work with sendChat.