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 it possible to set two attributes from a single selection?

1421483749

Edited 1421484510
Does anyone know a way to make the "select" tag in HTML set multiple values? 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 soak rolls and the like. In the system I'm playing with, Scion, your character gets a soak bonus based on their "Epic Stamina," but it's not a 1-to-1 bonus: for 1, it's 1; for 2, it's 2; for 3, it's 4. I am not aware of any way to calculate this that wouldn't entail if/then statements, so I thought it would work if I had it set to where when the player set their "attr_epic_stamina" rating, it would also be able to set their "attr_soak_mod" or the like. However, I have no idea how to make the code set multiple items based on a single selection. And for that matter, how can this thing not have a simple case or if/else statement? So you could set an attribute to, like, case(@{attribtue},1,1,2,2,3,4)?That would make the whole thing so darn easy. Is there a list of functions beyond the round/ceil/floor functions?
No promises, but I'll look into it once I've had some sleep. And coffee. Lots of coffee
...cuz if then statements opens a huge can of worms, I am told. A selector has one value, as far as my very limited knowledge goes. You can have the soak mod use a simple formula (epic stamina multiplied by 1.35, and apply that rounding down trick they got here somewhere). That might work.
1421522575
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
Dave, you can have the display be different from the value. So, you could have a drop down 1-5 but have the underlying value of what 1-5 represent be different.
John, thanks for working out that conversion--unfortunately, it won't work for higher levels. The full range is: Attribute 1: Bonus 1, Attribute 2: Bonus 2, Attribute 3: Bonus 4, Attribute 4: Bonus 7, Attribute 5: Bonus 11 Attribute 6: Bonus 16, Attribute 7: Bonus 22, Attribute 8: Bonus 29, Attribute 9: Bonus 37, Attribute 10: Bonus 47 While I really doubt the higher levels would ever be necessary, I'd like to have a sheet that can handle any "level" of character. However, in the short term, the formula you've posed may help as a workaround--I appreciate it! Steve, that might be an interesting workaround, too. I'll see what I can do with it! However, it really does strike me as strange that there's no way to "actually" do this. It seems like such a fundamental function. I'm not talking about conditional logic for macros so much (if this, then do that, etc.) just the ability to set a variable based on such a condition. But, again, I come from a very different scripting background, so my assumptions may all be a bit cock-eyed.
Okay, Steve's workaround has worked very nicely--though I could still do so, so much more with a simple case() function. Alas.