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

Is there a Macro command that allows an Ability to subtract from an Attribute?

Hello, I was looking through the wiki and I could not find any examples on how to change a stat inside of a macro. I want a macro that will roll damage for a spell and then (with the same button press) subtract from an Attribute which I use to track the number of spells per day. This is what I have so far... /em The goblin waves his hand and fires magical bolts at you! /roll 1d4 + 1 @(Level-1-Spells) = @(Level-1-Spells) -1 Obviously that last line does not work, I was hoping someone could help me with that! Thanks!!
1390357089
Gauss
Forum Champion
You cannot do this with a macro although you can do it with an API script. I suggest asking the API forum for help.
Darn. Okay, thanks!
1390573841

Edited 1390573973
Kevin McD
KS Backer
I second the call for this to be added to the macro language - the API is overkill for this. My personal use case is similar. The game I use (Gumshoe) allows you to add points from an attribute (skill) pool to a roll. I tried to write a macro that would ask the player for the amount of points to spend, the add it to the roll and subtract it from the attribute. The first half works fine, of course. The second half is not possible, but would save a lot of futzing about with the Roll20 interface during play. Edit: Note that this also would require that the player input be stored as a real variable in the macro, so I guess this is two enhancement requests!
You can always make recommendations and Suggestions in the 'Suggestions & Ideas' section of the forums. The macro environment is pretty much purely read-only without ability to modify data. I couldn't say without knowing the development platform, but I would not expect that to be easily or willingly changed to allow you to write data to the DB casually. If in the specific instance, if the data being updated is just a single attribute, you could link the Token to a Player Sheet and then in the Token options link one of the three Bars to that attribute. You would then be able to modify the attribute by clicking the token's bar and either entering a staight value or a -value or +value to do it mathmatically. (example: clicking the Red bar and typing +5, will add 5 to the current value. Typing JUST 5, will make it = to 5). I commonly use that method for characters will "Pools". (monk Ki pools, power points, class Spell-Like-Abilities, etc)
I'm working on a pretty simple script for editing attributes. I'm building it to make really simple status-toggles, but it would work for what you need to. I think it makes sense to not have this be a core thing without a script, because then DM's have to deal with the extra complication of savvy PC's being able to mess with the numbers with clever macros. The only way to aleviate that would be creating a whole panel to allow a DM to turn off and on various kinds of macro's, and I can't imagine they want to get into that rats nest.