JP G. said:
The Token Roller appears to require the item to be selected on the VTT or at least, it is pulling information from the token, namely, the various sides of the multisided token.
Based on the info you've provided, I feel that I would need to modify the Token Roller to select the token then use the fetch/zeroframe to pull information from it to get it to work for the rest of that mod. Changing the selection on the VTT isn't done through the SelectionManager which is what I was hoping would be a short cut to not having to modify the Token Roller.
Actually, *no* script knows what is actually selected on the VTT.
Scripts responding to chat events only know what is provided them in the message object I described. When you send a bangsy message, part of what Roll20 does on the backend is to collect certain data from the VTT (like the tokens you have selected). It populates the selected property of the message object with that data, which is what the scripts read. Using that data, they can identify the token from which you want information, or the character from which you want information (who is associated with that token).
SelectManager just overwrites that property (or adds to what is already there it if you use {&inject ... } rather than {&select ... } ).
As for why the Custom Roll Listener isn't working... I don't use it, myself, but I can see one thing that is going wrong. When you use this formation:
!crl \\edit,name=Listener2,text=##,template=atk atkdmg,roll=fumble \\!token-mod --set currentside|[[1d6]] {& select CritDice}
What happens is that this command is intended for CRL to establish 1) the thing to listen for, and 2) what command to issue when the listened-for thing is heard. The original message object passes into the script stack, and SelectManager sees the {& select ... } construction. It figures that you want to immediately select the CritDice token, so it modifies the message object and REMOVES this syntax from the command line. When CRL sees the command line, it reads the text it needs to dispatch as:
!token-mod --set currentside|[[1d6]]
Without the select construction.
There are a few other scripts that can issue outbound commands to other scripts, and when the need has come up I've worked with the script authors to provide an "escape" character to make sure that the meta-construction isn't eaten in the original message. For example, using ^ as a deferral character, the select construction would be:
{^& select ... }
The dispatching script (in this case, CRL), would remove the escape character before dispatching the message, thus exposing the meta-constructions for the dispatched message:
{& select ... }
However, we haven't gotten CRL modified to do that, too.
However-however, you don't need to modify CRL for this one use-case... because all you're doing is designating the token you want to use (for the Token-Mod command). You can do that with Token-Mod syntax:
!token-mod --set currentside|[[1d6]] --ids -M1234567890abcdef
Where you'd obviously include the actual id of the CritDice token. (Again, this is the solution for a single token of known id... so it will only work on that one token.)