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 .
×

use a text attribute in a macro

Hello, I created a character called "bow" with an numeric attribute called init. If I issue the command @{bow|init} I get back the attribute value. Then I created another character named "tac", with a text attribute called weapon, containing the text"bow" If I issue the command @{selected|weapon} I get back the text attribute value (bow). But when I try to launch the command @{@{selected|weapon}|init} comes back the errore  No character was found for '@{selected'  Ivan Master (GM): bow Is it possible to do such an operation? Where am I wrong the syntax? Can anyone help me? thank you very much!
1587828886

Edited 1587828971
GiGs
Pro
Sheet Author
API Scripter
This isnt valid @{@{selected|weapon}|init} When you launch a macro, it looks at every attribute call (@{Init}) at once and retrieves all their values. So with @{@{selected|weapon}|init}, it looks for an attribute called "@{selected|weapon}|init" which obviously does not exist, and so it fails. You cannot build an attribute call up from parts - it must always be complete, because attributes will be accessed before any processing in the macro is done. See also:&nbsp; <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Operations" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Operations</a>