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

Switching from Selected to Target

I facilitate D&D5e for kids and I cannot rely on them not to move things around.  I am needing to switch all selected macro to target.  For my interactive map, I have this macro to call for more information.  I tried to switch to "target' It produces  No attribute was found for targeted token by the name of max  Thank you! &{template:default} {{name=@{selected|token_name}}} {{@{selected|bar1}  [Click Here To Learn More](@{selected|bar1|max})}}
1588035861
GiGs
Pro
Sheet Author
API Scripter
When using target to access bar maxes, you need to add a parameter for the target. This can be anything. &{template:default} {{name=@{selected|token_name}}} {{@{target|anything|bar1}  [Click Here To Learn More](@{target|anything|bar1|max})}} The purpose of this extra parameter is to allow you target more than one token in a macro. You could get @{target|first|bar1} and @{target|second|bar1} for example. If the tokens use the same identifier you will only be prompoted for target once. If you use different identifiers, you will be prompted extra times, and get values from more than one character. Its an optional identifier, but when trying to get max values, it is required.
Thank you so much! This is really informative. I changed  {{name=@{selected|token_name}}}  to target, because I was getting  You attempted to use a roll command looking for the value of a selected token, but no tokens are selected. .  This below is working, but is prompting me to target my token twice.  What can I change to reduce, so that I only have to target once? &{template:default} {{name=@{target|token_name}}} {{@{target|again|bar1}  [Click Here To Learn More](@{target|again|bar1|max})}}
1588050031
GiGs
Pro
Sheet Author
API Scripter
change the first token reference to match the others &{template:default} {{name=@{target|again|token_name}}} {{@{target|again|bar1}  [Click Here To Learn More](@{target|again|bar1|max})}} Sorry I missed that the first time round.
That completely solved the problem. Thank you so much!  While I may have your attention, is there a way to do the same with CashMaster Shopping function? !cm -viewShop Right now I have to select a shop token and input that command to view the shop in chat.  Is it possible to change it to target also?  Thank you!
1588096904
GiGs
Pro
Sheet Author
API Scripter
Unfortunately not, and it looks like  a tremendously complex script to modify. Sorry :(
Okay! Thank you for all your help!