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

[PATHFINDER] Can I make a macro to affect a character sheet value?

I want to make a macro that adds my attribute enhancements from a Barbarian's to the sheet, and another one to remove them. Is it possible? Can I affect other things like uses remaining of an ability and stuff?
Nope. The Macro system can not change any values, only read from them (the only exception to this being the turn tracker)
1422318818
vÍnce
Pro
Sheet Author
Mark G. said: Nope. The Macro system can not change any values, only read from them (the only exception to this being the turn tracker) Mark, is it possible (API) to change a token's bar value(1,2,3) and in turn have that change the sheet's linked attribute?
How would I go about changing a token bar value? For example, I created a custom attribute called Rage-Rounds. Can I somehow lower or increase with a macro, something like @{Rage-Rounds}-1? If possible, I could make a value that is equal to my rage bonuses that I can turn on and off (for example, an attribute called Rage-Bonus, which, with the press of a button, increases from 0 to 2, and add +@{Rage-Bonus} to my melee attack macro, then click another macro to lower Rage-Bonus to 0 to make the rage bonus stop.)
1422321147
Gen Kitty
Forum Champion
Macros in and of themselves can not change attribute values. Macros, however, can invoke API scripts which can change attributes on a character sheet.
1422337695
The Aaron
Pro
API Scripter
Brian can probably come up with a way to structure your macro so that it will only add the bonus if a rage attribute is set. Basically, you'd reduce that attribute to either 0 or 1 and multiply it by the bonus. (sorry if that's confusing.. it's late, I'm tired, and there's less peach schnapps in the house than when I started cleaning my office... =D )
I'd love to know any way to play with attributes to set up a toggle attribute. Any tutorials or stuff? The idea of toggle modifications would be awesome for roll 20 in general.
1422338972
The Aaron
Pro
API Scripter
well... assuming rage_mod is 5: [[ 1d20 + (@{selected|rage_toggle}*@{selected|rage_mod}) ]] If rage_toggle is 0, this will reduce to: [[ 1d20 + (0*5) ]] If rage_toggle is 1, this will reduce to: [[ 1d20 + (1*5) ]] Brian is particularly good at finding ways to turn numbers other than 1 into 0 or one as needed. You could use one of the bubbles on the token and set it to 1 or 0, with it stored in an attribute called rage_toggle or some such.
1422339293
Gen Kitty
Forum Champion
The closest we get is multiplying an expression by 0 (to turn it off) or 1 (to turn it on), and combining that with a rollquery (to supply the 0 or 1 at rolltime) or fancymath to subtract one attribute from another and turning that into a 0 or 1.
1422339407
The Aaron
Pro
API Scripter
Ah, good call GenKitty! Roll Query is a good one: [[ 1d20 + (?{Raging?|1}*@{selected|rage_mod}) ]]
1422373007

Edited 1422373286
Roll query is my current solution, but I also really like the bubble one... Of anyone can do an API script to simplify this, let me know!
1422376229
The Aaron
Pro
API Scripter
Well, at a minimum, the API can be used to turn off and on your raging: !token-mod --set bar1_value|[[ (1-@{selected|bar1})*1 ]]
That sounds amazing, how would I go about implementing that? I have no idea how to use the API.
1422383526
The Aaron
Pro
API Scripter
Well, that's using the TokenMod script. You would have to upgrade to Mentor status to use the API.
Oh, applesauce.
1422384353
vÍnce
Pro
Sheet Author
It's well worth the price of admission. Trust me on that. Aaron will even provide the first 20 scripts for free.
1422387162
The Aaron
Pro
API Scripter
@Vince! Ha! I do agree, of course. The API is a serious Game changer (and yes, the pun is intended, not that anyone cares! =D). I originally upped to mentor for the Transmogrifier as I was starting a second campaign and wanted to copy my copies NPCs across, but there are lots of great reasons to do it! API, No loading screen ads, 10 votes on the suggestions forum, support the developers, because you like green things next to your name.. the list practically write's itself! =D