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 .
×
Advertisement Create a free account Compendium in Game, Join Today

SpawnDefaultToken and TokenCondition help please

1614024608

Edited 1614024634
Hi, Having purchased some animated spell affects on the marketplace ( <a href="https://marketplace.roll20.net/browse/set/9398/animated-spellbook-concentration" rel="nofollow">https://marketplace.roll20.net/browse/set/9398/animated-spellbook-concentration</a> ) i set about making the Spirit Guardians animation a "Decoration" character to stick to and follow my PC around using the TokenCondition API (Decoration: SG [width:7g|height:7g] - works great).&nbsp; I have now *unsuccessfully* tried to take this to the next level using the SpawnDefaultToken API in a macro that will cast the spell and then auto spawn the "Decoration" token on top of my PC. I * have * already saved the original animated effect for spirit guardians locally to my desktop and uploaded to my art library by a different name to use as the new default token in my "Decoration" character to be able to be called by SpawnDefaultToken. However... SpawnDefaultToken doesn't seem to like the "pipe" in between the width and height descriptors in the Decoration name as I'm being returned this error message in the chat where it seems to cut off the remainder of the name: character "Decoration: SG [width:7g" not found Any solutions/suggestions/alterations/improvements/workarounds????? All help greatly appreciated, Thankyou!
1614036610
David M.
Pro
API Scripter
Can you share the code you are using? I honestly had no idea what would happen if the default token was an animated gif or webm. I just tried it in my test game with...mixed results. It seemed to work once, but trying it again it seemed to freeze (but sandbox didn't crash). Not sure if it will eventually finish the repeated attempt or not. So it seems YMMV in that regard. Regarding your specific question, though, pipes will be problematic as they are a delimiter for parsing the commands. Can you just rename the "character" to something that doesn't contain a pipe?
1614805946
Hi David, Many thanks for taking the time to get in touch and apologies for my delayed reply. My code was just about as basic as you can get: !Spawn{{ --name|Decoration: SG [width:7g|height:7g] }} Unfortunately TokenCondition needs the pipe and height/width descriptors to keep my decoration as a 7x7 animated token centered on my PC. I did try a workaround with no size descriptor in the decoration character name, instead adding "--size|7" into my code above, but to no avail (even when the token i was using as decoration was resized to 7x7 BEFORE linking to the character sheet).&nbsp; I may just have to chalk this up as "one of those things" i think, unless I can pester The Aaron to add a standard "size" descriptor for default square tokens in the TokenCondition API such as you have in SpawnDefaultToken :D I do appreciate you considering a solution, Best wishes, Paul
1614806870
The Aaron
Forum Champion
API Scripter
The API won't be able to create an image from the marketplace directly, and even if you download and upload the animation, the API can't create them in a state where they start playing. I'm working on changing TokenCondition to not rely on special naming to apply its effects, which will fix this issue in the general case.