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

Using an attribute as an argument for another attribute call?

I'm trying to call an attribute based on another attribute. My (failed) test was: This test is a @{@switch|which}|test} The character I've named "switch" has an attribute named "which", set to a value of "result". Another character is named "result" and has an attribute named "test" with a value of "success" In my head, this is how I thought the test would go: This test is a @{@switch|which}|test} - The portion "@{switch}which}" would be looked up and replaced with "result" This test is a @{result|test} - And then "@{result|test}" would be replace with "success" This test is a success  - What I was expecting to see Instead I got an error message and a line I didn't expect: No character was found for '@{result' This test is a @{result|test} Obviously this means the input is parsed in a way I wasn't expecting. I'd like to know what I need to do to get the end result I was expecting.
1495844277

Edited 1495844610
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
this is based on the order of operations, All abilities are parsed (replaced with their actual macro text) to 99 levels deep, then all attributes are parsed. Finally, roll queries occur, and then inline rolls are evaluated. You might have some success with html encoding the outer attribute call (@{). This works in some situations. Otherwise, what are you trying to accomplish? I'd bet that a roll query would be a better, more dynamic method of achieving what you want. EDIT: The html encoding method only works when trying to combine ability and attribute calls in the manner you're describing.
1495844692
Silvyre
Forum Champion
Michael D. said: I'd like to know what I need to do to get the end result I was expecting. Check this post out.
Thanks so much! I had initially thought of using a roll query, but I'm trying to create an equipment system, a spell system, and a whole bunch of other things that would end up needing a lot of queries, making using abilities and macros take a lot of work if I didn't include some form of automation, and it had occurred to me to try using character attributes as conditionals. I'm excited to see what I can make using prefix attributes! (That should totally be in the wiki if it isn't already)
1495914385
Silvyre
Forum Champion
Good luck and happy rolling!