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
This post has been closed. You can still view previous posts, but you can't post any new replies.

When using the @{target} syntax, the system should note what tokens are selected before clearing them, so it can send that information to the API.

1521614660
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
I honestly think this ought to be in "bug reports" instead of feature requests, but it seems to be behaving exactly as the programmer designed it, so I guess my feature request is that you re-spec it to not break the selected tokens API feature. Lets say you have a macro that basically goes !api ?{something} @{target|token_id} Regardless of what order the components are in the command line, it will always do the @{target} first, then the ?{}, and then send the message to the API. The first thing it will do is it will clear all selected tokens from the desktop, and give you a message to click on a token to choose a target. After you click on the token, the message to choose a target, and inability to select tokens will remain as a pop-up appears as the ?{} components are processed. When the last ?{} has been processed, the message to choose a target FINALLY goes away, and the macro command string is sent to the API, but the API INCORRECTLY is told that there were no tokens selected when this process started. That is because the system cleared all of the selected tokens before making note of them so that targets could be chosen. Undesirable behaviors are: (1) When there is a @{target}, it clears all selected tokens before making note of what tokens were selected. This is the big flaw that breaks macros. (2) The choose target box stays present while the ?{} are being processed. Choosing targets is done by this point and it should go away. At the very least the restriction on selected tokens should be lifted by this point so that we can select tokens and have the tokens sent to the API. (3) when the "choose targets" box finally disappears, the system does not re-select the tokens that were selected before the box appeared. Requested fix is to change the change this behavior. One way would be change the order in which things happen. First have it process the ?{} queries, then make note which tokens are selected, then clear the selected tokens and ask user to choose targets. Then after sending the API message, reselect all the previously selected tokens. There are other ways in which the undesirable behavior can be mitigated.
1523071242
Tad A.
Pro
Sheet Author
I've been negatively affected by this bug, and I'd love to see a solution implemented. I'd recommend keeping the evaluation order the same, except to move the step "restore the UI to the state it was in before targeting" from "after the message is completely evaluated and handled by the api" to "immediately after selecting the final target", so that the targeting UI is appropriately cleared and the selections are active when the command is processed. I think changing the evaluation priority of ?{} and @{} is likely to cause more problems than it fixes; or at least break complicated macros depending on the old behavior.
1550175594
Roll20 Dev Team
Pro
Marketplace Creator
Thanks for the suggestion! After 30 days, Suggestions and Ideas with fewer than 10 votes are closed and the votes are refunded to promote freshness. Your suggestion didn't build the right momentum this time, but feel free to submit it again! We find that the best suggestions describe the problem you are having, and the solution you want. You can learn more about the process of making suggestions on the Roll20 Wiki! More details can be found here .