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

Trying to add a character Attribute modifier conditionally

1424901873
Dan W.
Sheet Author
Hi all, I'm trying to add a strength modifier to some damage rolls depending on if that damage was caused by unarmed, melee, or hurled ranged weapons (but not non-hurled ranged weapons). In my sheet I have sections for individual weapons. Each weapons has a 'Type' drop down to indicate which of 3 categories it is: unarmed, melee, or ranged. If I broke out ranged as 'hurled' and 'projectile' sub-category options is there a way to conditionally add an attribute value based on a select element? Or, if I provided a checkbox that said 'add str mod' is there way to add an attribute value based on if the box is checked or not? The closest I've been able to come to create what I want is to provide a query roll for the user to fill in the desired strength modifier to the damage: <button type="roll" value="/roll @{weapon_damage_1} + ?{strength bonus|[[@{str_mod}]]} Damage from @{character_name}'s @{weapon_name_1}">Damage</button> This would provide an already-calcualted str mod to the player, with the idea being that the player would either just hit 'enter', or type 0 and then 'enter'. However, the input field is filled with a complicated gobbledy-gook formula for calculating what the current str mod should be… and players aren't going to know WHAT that is… Any ideas on how to improve on this?
I am in favor of the check box, like this: name="attr_strength-toggle" value="@{strength}" Your button would have: value="/e deals [[@{weapon_damage_1} + @{strength-toggle}]] points of damage". Another idea is to use a drop menu to select what kind of weapon it is (unarmed, melee, hurled, projectile, etc.), and set the value to match the damage to deal. kinda like: select name="attr_weapon-type"> <option value="@{str-damage}>Melee</option> <option value="@{nonstr-damage}>Ranged</option> <option value="@{str-damage}>Hurled</option> For example, behind a hidden area, put an some inputs: input type="text" name="attr_str-damage" value="@{str_mod}" input type="text" name="attr_nonstr-damage} value="0" ...and have the roll be value="/e deals [[@{weapon_damage_1} + @{weapon-type}]] points of damage". (or you can just put value="@{str-mod}" and value="0" appropriate drop downs, and cut out the whole hidden part).
1424905544
Dan W.
Sheet Author
I forgot to mention that the existing drop-down choices are figuring out what the attack roll bonuses are for that roll… So, I really don't want the user to have to set two drop-downs, one for attack and the other for damage, but you can't make one drop-down's option values do two different things, or at least not easily. For the checkbox… I actually tried that, but I must not have done it right -- your example caused me to try it again and OMG! It worked! Awesome, thanks!
Oh, cool. Glad that helped!