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

Variable attribute swapping

1411679042

Edited 1411679110
I'm working on setting up macros for a new character who can swap in her charisma score in place of strength for attack and damage rolls, provided she moves at least 10ft that round before attacking... So I wanted to set up a macro that will use a ?{modifier} to query if I moved or not that round, If I did then it will use my @{cha-mod} for attack and damage rolls but if I didn't it will use the @{weapon#stat} & @{weapon#damagestat} attributes in attack and damage rolls.. The only working method I can think of involves creating two separate queries one asking if I moved and the other asking if I stayed still... however I'd prefer to not do that... I'd like to just input a 1 or 0 in one query and have the result determine which attribute is used. I tried using the following within my macro but It didn't seem to work... +((-?{Moved 10ft? (1=True)|0}+1)*@{weapon1stat})+(?{Moved 10ft? (1=True)|0}*@{cha-mod}) The idea was that if I put in a 0 the first section would result as -0 + 1 = 1, 1 x @{weapon1stat} = @{weapon1stat} and then the second one would simply be 0 x @{cha-mod} = 0 Inputting a 1 should have caused the resulting equation to be -1 + 1 = 0, 0 x @{weapon1stat} = 0 with the second section reading 1 x @{cha-mod} = @{cha-mod} unfortunately when I try to run the macro is fails to output anything... I fear that roll20s dice roller doesn't know how to handle adding negative values, so it's breaking when it gets to here...
1411679584

Edited 1411679616
Nevermind... I'm an idiot >.< +((-?{Moved 10ft? (1=True)|0}+1)*@{weapon1stat})+(?{Moved 10ft? (1=True)|0}*@{cha-mod}) doesn't work, however the principle does and can still be used if I make one small change >.< +(( 1 -?{Moved 10ft? (1=True)|0})*@{weapon1stat})+(?{Moved 10ft? (1=True)|0}*@{cha-mod}) starting with the positive value first... it works now