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

[Macro] Variable Variables: @{Variable@{Variable}}?

1417938411

Edited 1417940222
Dave
Pro
Anyone know if it's possible to do something like this? Say you've defined Attribute1, Attribute2, Attribute3, Attribute4, and Attribute5. Is there a way to, say, set another attribute called AttributeN, and then pull Attribute[AttributeN], where AttributeN is 1-5? What I'm specifically trying to do is create a modification for a White Wolf style character sheet that would allow one to have automatically calculated values, such as injury-based dice penalties. I'm not sure if the above would solve it, but it might make it easier to do. Part of the problem is that some abilities in the system I'm playing with alter the possible dice penalties based on injury level, so it has to be able to look up or calculate the specific penalty from a list. Alternatively, does anyone know a way to make the "select" tag in HTML set multiple values? So, if I selected, say, "Injured" from a drop-down menu, it would then set the "Health" variable to "Injured" and the "DicePenalty" variable to "-1"?
1417966250
Lithl
Pro
Sheet Author
API Scripter
Variable variables are not possible. A single form element on a character sheet cannot set multiple attributes. However, it is possible to tightly couple your character sheet with an API script, and set an attribute that is interpreted as multiple values by the API. That solution would reduce the number of other people in the community capable of using your sheet, however (since the GM of the campaign would have to be a mentor).
1417974261
vÍnce
Pro
Sheet Author
You might be better off making a macro for each condition, or prompting for input(s) when activated. [[?{Modifier ?|0}+?{Modifier 2 ?|0}]] Alternatively, does anyone know a way to make the "select" tag in HTML set multiple values? So, if I selected, say, "Injured" from a drop-down menu, it would then set the "Health" variable to "Injured" and the "DicePenalty" variable to "-1"? I would throw this question at the Character Sheets forum. My guess is, yes, this should be possible. Each choice would update the corresponding attributes. Ask some sheet experts and I'm sure they can tell you how to do it technically. Good luck.
1417995903
The Aaron
Roll20 Production Team
API Scripter
You might be able to make your select set those multiple values by causing it's value to activate different terms of an equation based on its value.