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

Token-Mod stopped working

1694150740

Edited 1694150986
I've been using token-mod in my games for quite some time, and yesterday it stopped woing form me.  I haven't changed anything in the ability or which mods I load.  The sandbox isn't crashing, just token-mod isn't doing its tasks.  The call I use is !token-mod  --set currentside|4 width|1u height|1u name|"Snake Spirit" {& select @{selected|token_id} } My scripts are SelectManager    ChatSetAttr    Vector Math    MatrixMath    Path Math    RecursiveTable    TokenMod Messenger           MathOps        libTokenMarkers Thank you for any help.
1694158059
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Andrew! The most likely cause for this is that the image you are trying to switch to is a Marketplace image that is not in your uploaded Art Library items. The API cannot affect Marketplace items.
1694180680

Edited 1694180701
I don't think so.  These were all images I uploaded.  They use to work fine.  Stopped working a few days ago.
I did a quick test, and it seems to have something to do with the select manager.  When I made a simple test and removed  {& select @{selected|token_id} }, token-mod worked fine.  I needed the select manager because my ability had several targets.  I targeted a caster of the spell to affect the spell's target, with the ability called from the spell's target.  When I removed that bit from my full script, I lost the target of the token-mod call.
1694185160
timmaugh
Pro
API Scripter
Thanks for catching this, Andrew. I see the problem... when SelectManager recently got the ability to use Criteria in selections, I left the regex statement for the recognition of Marker names too vague. In other words, when SM sees the token id, it misinterprets it to be a marker and sets about testing the other tokens it has selected (none) to make sure they have this marker (none obviously would). I'm putting a fix in place, now. I'll post back when it's available. Sorry for the inconvenience!
1694190793
timmaugh
Pro
API Scripter
OK, I think I have a fix in place for this. It's in my repo if you want to get it immediately... otherwise it's in the queue for next week's merge. Give it a try and let me know if you run into any issues. For those interested: previously, if an item in a {&select} tag started with a + or - and did not follow the pattern for a known criteria (like aura1, bar2, etc), it was considered to be a marker name. Unfortunately, this would catch token ids, as well (-N1234567890abcdef). I now have an explicit test for each entry that includes a regex built from the markers installed to this particular campaign. In order to be considered a marker criteria (ie, "the token must have this marker"), the item in the {&select} tag must match an item from the list of campaign markers (this is case-sensitive). This comes with the obvious caveat: don't name your characters the same as your installed markers. Don't come complaining that you can't select your character "dead" by name... there's nothing I can do about that. =D
I just tested it.  Looks like it automatically updated, and things are working great again.  Thank you!