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

Altering character attributes based on drop-down result?

Is there a way to set character attributes to values based on the result of a drop-down menu? For example, let's say I made an Equip ability that let a unit swap between their available weapons (assume the weapons are journal entries). The character has attributes called "Power" and "Hit" that modify the unit's damage and accuracy based on the values. Power: @{Iron Sword|Power} Hit: @{Iron Sword|Hit} #equip ?{Equip which?|Iron Sword|Steel Lance|Iron Dagger} The player selects Steel Lance. Would there be a way to make this alter the Power and Hit to say @{Steel Lance|Power} and @{Steel Lance|Hit}?
1463343155
Silvyre
Forum Champion
You could certainly have different results displayed based on the choice of your Roll Query. e.g. ?{Equip which?| Iron Sword, Power: @{Iron Sword|Power} Hit: @{Iron Sword|Hit} | Steel Lance, Power: @{Steel Lance|Power} Hit: @{Steel Lance|Hit} | Iron Dagger, Power: @{Iron Dagger|Power} Hit: @{Iron Dagger|Hit} } Changing the Current/Max values of Attributes cannot be done via macro without the assistance of an API Script . (Access to the API is available in games in which the Creator has an active Pro subscription.)
Sigh... Of course it's pro only... And not having it makes the literal engine of this entire campaign twice as complicated and twice as cumbersome, but sucks to be me, I'm too poor to afford to make this campaign playable.
1463350724
Silvyre
Forum Champion
I'm not sure if this will help at all, but  Alexander came up with an interesting and API-free method of referencing Characters , which looks like it may be similar to what you're shooting for.
1463350943

Edited 1463351643
That only accounts for part of it. Some weapons provide stat bonuses, and some stats actually affect other stats directly; the only way to handle this would to be to have some way of calling the stat bonus from the weapon through a query, which isn't possible because you can't have the same name for multiple queries at the same time, since it will set the query to the first answer for all of them. The thing is that units can have up to 5 weapons to attack with at any given time, and can (and WILL) switch between them on a very, very regular basis, meaning we'd need to stop and retype the field each and every single time.
1463353011

Edited 1463353226
Silvyre
Forum Champion
How about using Advanced Roll Queries to output a modified version of macros, depending on the selection of a weapon? e.g. &{template:default} ?{Which weapon is being used?| Iron Sword, {{name=Iron Sword}} {{rank=D}} {{damage=[[ {@{Str} + 7 - @{target|Def} + ?{Triangle?|No, 0|Win, 1|Lose, -1}, 0}kh1 + ?{Modifiers|0} ]]}} {{hit=[[ {@{Acc} + 80 - @{target|Eva} + ?{Triangle?}*15, 0, 100}kh2dh1 ]]}} {{crit=[[ {@{Crt} - @{target|Lck}, 0}kh1 ]]}} {{range=1}} | Steel Lance, {{name=Steel Lance}} {{rank=A}} {{damage=[[ {@{Str} + 10 - @{target|Def} + ?{Triangle?|No, 0|Win, 1|Lose, -1}, 0}kh1 + ?{Modifiers|0} ]]}} {{hit=[[ {@{Acc} + 110 - @{target|Eva} + ?{Triangle?}*15, 0, 100}kh2dh1 ]]}} {{crit=[[ {@{Crt} - @{target|Lck}, 0}kh1 ]]}} {{range=1}} | Iron Dagger, {{name=Iron Dagger}} {{rank=B}} {{damage=[[ {@{Str} + 8 - @{target|Def} + ?{Triangle?|No, 0|Win, 1|Lose, -1}, 0}kh1 + ?{Modifiers|0} ]]}} {{hit=[[ {@{Acc} + 90 - @{target|Eva} + ?{Triangle?}*15, 0, 100}kh2dh1 ]]}} {{crit=[[ {@{Crt} - @{target|Lck}, 0}kh1 ]]}} {{range=1}} } {{speed=[[@{Spd}]] vs [[@{target|Spd}]]}}