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

Spawn Token Mod - automatically detect default size.

October 04 (1 year ago)

I want to use the spawn default Token mod am and aware that you can spawn in tokens at various sizes manually, but i'm wondering if it's possible to spawn in a token at its default size without needing to enter anything.

So for instance if I have a large creature that takes up 2x2 squares, rather than needing to press the spawn token macro and enter 2x2, i'd just need to press the spawn token macro and it would automatically spawn in the token at 2x2 squares.

October 04 (1 year ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Hi Jesse!

Can you clarify a bit? Are you using the Spawn Default Token script or Token-mod? The latter does not have the capability to spawn tokens on the VTT, only alter existing ones. 

The Spawn Default Token script takes a given value for the size (I assume there is some difficulty in reading this from the saved default. It is possible that a metascript could fill in this value, but I'm not sure how the timing works on that. I'll see if I can summon wiser heads.

October 04 (1 year ago)
David M.
Pro
API Scripter

Hmm, I thought I tried retrieving that info from the default token JSON when first writing the script yrs ago, but it either wasn't there or I was incompetent (50/50, lol). But I could also be misremembering. There have been changes to the info stored in the JSON since then, so this property might be available now of it wasn't back then. I can look into it this evening after work. If the info is available, then this totally should be an included feature and should be pretty easy to add.

October 04 (1 year ago)
David M.
Pro
API Scripter

Jesse, try a manual install of this version. If --size is omitted, it spawns at the token dimensions of the default token, rather than 1x1. I'm not sure why I didn't do this from the outset, as it is the intuitive behavior that matches what happens when dragging the token from the journal. It was only the 2nd "real" script I wrote, so probably just an oversight as I was distracted by adding shiny features, lol.

If we don't run into any heinous issues in the next week or so, I'll merge it into the one-click version. Thanks to both of you for bringing this to my attention!

October 05 (1 year ago)

@David no worries. I'll give that version a try.

@Keith I'm currently using Tokenmod and Spawn Token. But when I summon a token it just spawns a given token as 1 unit rather than as its default size. Hope that makes sense.

October 05 (1 year ago)

Tried the updated script and it seems to work fine now! Thanks David!

October 05 (1 year ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


Jesse G. said:

@Keith I'm currently using Tokenmod and Spawn Token. But when I summon a token it just spawns a given token as 1 unit rather than as its default size. Hope that makes sense.

Perfect sense. The problem was that Roll20 changed the term for API scripts to "mods" which has led to some terminology confusion. You meant the Spawn Token (mod), but I was reading it as Spawn (token-mod).