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

Displaying modified variable at end of Macro

Hello, I really hope this isn't something already explained in the Help section of the site. Here goes nothing. I'm working on a slightly complex macro. It's done, and it works flawlessly, with one hitch. I have a message to the GM at the end that displays a variable that the macro modified, but instead of showing the final value for Temp1 (the variable name) The line appears like: /w gm has @{selected|Var_setup}TEMP1} left. I've also tried using: /w gm has @{selected|Var_setup}TEMP1} left. (Var_setup is set to '@{selected|', trying to trick the system into parsing the Var_setup but not touching TEMP1 until the end, but it saw through my ploy.) Is there a way to have a variable (character sheet attribute) display the accurate number at the end of a macro, after being modified in the same macro?
1565135022
GiGs
Pro
Sheet Author
API Scripter
I have bad news, and good news. There's absolutely, definitively no way to do that with a standard macro. macros do not remember results of previous rolls, and cannot do conditions (if this, show that). So you cant do it the way you are trying. Also macros cannot modify attributes. They can only read the values of attributes, they can't write to them. However, if you're the GM of your game, since you're a pro user, you can use API scripts. You might be able to do this with chatSetAttr (a script that changes attributes) - you could run your macro, update the character sheet with the roll result, then read the attribute. This might not work - the attribute value is probably read before you change it. It's worth testing though. If it doesnt work, and the roll isnt too complex, we could create a custom API script that does it. We'd need full details of the roll, though.
Yes, I already use that particular script. The issue I'm having isn't modifying attributes, it's when an attribute is called after being modified , it still spits out the value that was seen before the macro ran. I wish a roll query could be used to input a variable without prompting user input, but I know that is stretching the intended functionality beyond the scope of what it was designed for. I've tried creating a separate variable and set the value to TEMP1, but Roll20 assigns that value before the macro runs, as well. All I really would like to see is a way to read variables (attributes) when they are called. It seems like an incredibly simple function, but could be quite powerful. I know that all I would have to do to avoid this is create a separate macro that just reads out the variables, but that just seems like a waste of space and adding to unnecessary clutter. GiGs said: Also macros cannot modify attributes. They can only read the values of attributes, they can't write to them. If it doesnt work, and the roll isnt too complex, we could create a custom API script that does it. We'd need full details of the roll, though.
I think Power-Cards will do this, but, strap in, it is a bumpy ride getting it to do anything.
I will look in to these P-O-W-E-R C-A-R-D-S you speak of. I'm terrified to learn more, but I'm already so far down the rabbit hole, might as well go all in, I suppose. It's just a shame there is no simple command to call/display a variable.