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

Conditional expression to output strings?

1477946142

Edited 1477946167
chris b.
Pro
Sheet Author
API Scripter
Using the disabled fields to set values of attributes (ala  The Wiki )  i can create conditional expressions that out put numbers, but is there a way I can use it to output strings that can be set to another attribute? I can't seem to create one, since multiplying a number by a string is just confusing for the chat parser :) @{name1} = bobbie @{name2} = georgie @{switchit} = 1 I've tried various things but the chat parser doesn't want to compare a string and number. I get both names or neither.  @{which} = [[({0,floor(1-abs(@{switchit}-1))}dl1)]]*(@{name1}) + @{name2} @{which} = [[({0,floor(1-abs(@{switchit}-1))}dl1)*(@{name1}) + @{name2}]] @{which} ={@{name1},@{switchit}}dl1
This is possible via a 'hack': Add an Attribute (e.g. named 'attr-prefix') with a Current value of @{ Call @{attr-prefix}@{character_name}|name@{switchit}}