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

Storing and referencing roll totals in a macro

I'm trying to whip up something custom based on the action macros in  Mick Hand's FAE tips article in the wiki , but can't quite cut it by myself. What I want to do, is have a macro that has a drop down of character attributes, and when one is selected, it'd roll 4 x 1dF to display each die in chat without mousing over roll results, store the total from that roll into a "variable", reference the selected character attribute from the selected token's linked character sheet and display that, and finally add the attribute and the roll total and display that as a separate result. So running the macro and selecting "StatX" from the drop-down would output something like: StatX Attack Character: Character Name Roll: 0 1 -1 1 Statistic: StatX (+3) Result: 4 I did go over the macro documentation in the wiki, but couldn't find anything about reusing roll results or adding results together. As  an unsatisfactory workaround I currently have a macro that asks for the desired stat, and only displays the end result (by doing [[@{selected|statX}+4dF]]) where one *can* see the statbonus and the dierolls on mouseover, but I would very much like to have both displayed as part of the chat message. Any insight would be greatly appreciated! If this is beyond the macro systems capabilities, I guess I'll have to look into scripting.
1505205673

Edited 1505215782
Ziechael
Forum Champion
Sheet Author
API Scripter
As it stands, reusing values is beyond the basic macro system. You may be able to do this with with  Powercards however...  Excusing the fact that I can't roll virtual dice for toffee, how about the below: !power {{ --name|Skill Check --Roll|[^FAE]--Attribute Bonus|[^ATR] --Result|[[ [$FAE|XPND|NH] 4df + [$ATR]@{selected|skill} ]] }} It produces results like those ==============> You'll need to change the straight up @{selected... call with a query like ?{Skill|Skill 1,@{selected|skill1}|Skill 2,@{selected|skill2}| etc etc...} but thats only as much of a chore as you choose to make it ;) Bear in mind that using @{selected will require a token as would @{target, alternatives would be hardcoding names into the values having base @{skillname} calls be the result and only use it as an ability on a characters journal.
1505205693

Edited 1505205744
Finderski
Pro
Sheet Author
Compendium Curator
Unfortunately, macros can't store values...that requires the API
Well, I am  a software developer by trade, so I shouldn't bee too squeamish about diving into the API docs and getting it done, I guess :D Ziechael said: You may be able to do this with with  Powercards however...  Awesome! This is a perfectly acceptable temporary solution to my problem and possibly a good thing to examine for how to scrape together a script to do what I want. Thanks to both of you!