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 .
×

Value of an input reference another attribute value?

I am trying to have a ratio button which will store a value for my primary attribute modifier. This is what I have so far: <input type='radio' value='@{StrengthMod}' name='attr_PrimeAttribute' /> (There is one ration button for each attribute) The problem I am having is that this only stores ‘@{StrengthMod}’ as plain text in the ‘PrimeAttribute’ attribute. Is there any way to store the strength mod value instead of plain text?
1468005868

Edited 1468005908
Lithl
Pro
Sheet Author
API Scripter
No, but that's not generally an issue. If an autocalc field is trying to use @{PrimeAttribute}, it will calculate the value of @{StrengthMod} correctly. If you want to use @{PrimeAttribute} in a roll, it will also calculate correctly. The only time it's a problem is if you're trying to use PrimeAttribute to calculate something in a sheet worker script, in which case you simply have extra work to do in order to parse it.
The problem I am having is I need PrimeAttribute to be different depending on which primary attribute the player selects, this then gets added onto an attack roll. Either this or have a way for a macro to select one of six attribute values depending on another attribute value.
1468019305
Lithl
Pro
Sheet Author
API Scripter
There shouldn't be any problem. [[d20+@{PrimeAttribute}]] will add the value of @{StrengthMod} (or whatever) to the dice roll.
1468020077

Edited 1468020270
chris b.
Pro
Sheet Author
API Scripter
I don't think this works for radio buttons and checkboxes. I asked a similar question in the pro forum and Steve indicated it wasn't supported. Text fields and select fields work. So if you use a select instead the user can change it and when you pulling in the @{name-of-select-attr} into the chat, it will pull the correct value referenced by the value of the option selected. so if you have: <input type='text' name="attr_somefield" value ="hello world" /> <select name="attr_myselect"> <option value="@{somefield}" selected >hi</option> <option value="@{somethingelse} > bye</option> </select> then @{myselect} will return "hello world"
Ok I managed to get it working, thanks for the help.