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

Updating an Attribute based on a die roll from a macro?

1441659183

Edited 1441659207
As the title suggests, I'm trying to come up with a clever way to change the value of an attribute by rolling a d20 in a macro. Here's the use so it makes more sense. In D&D 5e, Divination Wizards get an amazing ability called "Portent". Portent lets the wizard roll 2 d20's at the start of the day (after a long rest) and store those rolls for later. My idea was to create an Ability (macro) that would roll 2 d20's, and update 2 custom attributes (which I've named Portent_1 and Portent_2). Then I'd write another macro that would list those, and allow for one to be "used" (and make the value 0). So far I haven't found a way to store a rolled value as an attribute yet though. Any thoughts or suggestions (or useful links)?
1441660594

Edited 1441660666
vÍnce
Pro
Sheet Author
I don't believe that you can write data to an attribute that way. I htink Token-mod( [Script] TokenMod -- An interface to adjusting properties of a token from a macro or the chat area. ) could write the data to a token's status bar, which could be linked to a sheet attribute...  Aaron has been working on a Char-mod script that could probably do this, but it has yet to surface.
1441660655
The Aaron
Roll20 Production Team
API Scripter
This is not possible with a macro directly. You can do this with the API, a Pro subscriber perk. I'm almost done with a script for this, but there are some out there already that can do this. 
1441660754
The Aaron
Pro
API Scripter
What he said. =D
The token linked to the Divination Wizard's sheet doesn't not have to be the Divination Wizard's token. A generic token used for this operation only, can be linked to the sheet and set as Vince mentions.