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

Can I roll to an atribute?

New to the system and have been playing with macro scripting for my character. I had a thought that would make things easier if i were able to roll to a variable and use that later in the macro but I cannot seem to make this work. Is this even possible? I thought the &{tracker} function could be modified for this purpose but it does not seem to do anything. Is there any command to update an attribute score?
I am pretty sure that falls under the use of API scripts, which requeres mentor level support for the DM of the campaign.
Ahh, I had thought that might be the case. I was just hoping that there was an easy way to write to an attribute score without having to delve into API scripting. Even if there was a chat/macro command to write to a status bar that would work, but I have not seen that possible either.
1401118457
GiGs
Pro
Sheet Author
API Scripter
Unfortunately the macro system only reports output in the chat box, it cant be used to modify anything else. So yes, anything more advanced needs the API scripting.
1401121282

Edited 1401121365
Paul S.
Sheet Author
API Scripter
You can Here's how. Create an Attribute - say d6 and in the first box enter 1d6. Now create an Ability. Call it whatever you want. Format as follows: /em Does something really cool [[@{d6}]] Of course you'd change the wording to suit your needs. You could use this to potentially add to other rolls. /em Does something really cool /r 1d20+[[@{d6}]] And you can use this to add a modifier to the d6. As follows: Format the d6 Attribute as just 'd6' in the first box. In the Ability "Cool" format as follows: /em Does something really cool /r 1d20+[[?{Number of d6|1}@{d6}+?{Additional Modifiers|0}]] Hope this helps!
To the original question; GG is correct. The Macro system cannot store values or modify attributes or token bars. The only value a macro can modify is a token's TRACKER value, and that's a one-way street (can write or modify, but can't read the value in). You would require Mentor level support and the API to work with variables. What Paul S. is describing is how to reference an Attribute as a static value; you wouldn't be able to change that value except by going to the character sheet attributes and manually entering it.(which is useful in its own right). One slight added tidbit, however; when you use QUERIES like ?{Modifier | 0} anywhere else in the macro that you use that same query will automatically use the same value that you first entered.
1401139248
Paul S.
Sheet Author
API Scripter
Oh. Missed the bit about using the same value later later. Thought it was for constantly re rolling a variable. I guess just remembering the value and using ?{Misc Mod?} would be easiest.
yes
1401206629

Edited 1401206660
GiGs
Pro
Sheet Author
API Scripter
Or create an Ability for a variable that will be applied multiple times, and enter that variable before starting the macro. If you are the GM you can create a token purely to hold such variables, and use the three token bubbles for holding variables that get used a lot. you'd be able to enter a modifier in the bubble very quickly. You might give each player a special token for the same purpose.
The idea was for crit hit rolling purposes against a targets AC. I wanted to be able to make a d20 roll and check its success against both the crit range of the used weapon and the targets ac. If said roll was successful against both allow the output of a second d20 to confirm a crit vs targets ac. Since successes are numerical values I could use them as multipliers to crit rolls to allow the output of a confirmed crit auto-magicaly. This would require being able to push data into multiple temporary variables. Storing a dice roll in an attribute has promise though. I will have to think it through a bit but it still might be able to be done.