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 Default token

1704727043

Edited 1704732073
Hi, I've hit a strange snag.  Not long u/g to Pro and am trying to speed up the next encounter by spawning in the various monsters as they gate in.  I have a sandpit account where this script (SpawnDefaultToken) works a charm, but when I try it in the actual game, I get the special effect but no tokens?  I have the exact same script running in that game for Spiritual Weapon and that works perfectly (different name obvs!).  I have checked the journal tab and the creature is definitely there.  Any pointers?  I get a chat error that reads "Unable to find imgsrc for default token of (Hezrou) You must use an image file that has been uploaded to your Roll20 Library."  I have tried copying the token art, saving to my PC and then dragging it back into the game and also using "upload" so it ends up in my Art library, though that has not been necessary in the sandpit game, to no avail.  I have also (as GM) named myself in the journal and edit boxes for the token to see if that helps.  So confused as to why it works in one game and not another and why for some tokens in that second game and not others. !Spawn{{ --name|Hezrou --Size|2,2 --qty|3 --fx|burst-smoke --placement|surround }}
Make sure that the token image for the Hezrou character is an image that you have uploaded to Roll20, and not something from the Marketplace or included from a module.  Mod scripts cannot access images from the Marketplace or modules.   So if you have the character set up, save the token image to your computer, then drag it back in to the game, and make sure to save that uploaded token as the default token for the Hezrou character (after ensuring all of the token settings are the way you want it.  If that still doesn't work then post back again.
1704738321

Edited 1704739807
Hi Jarren and thanks for replying. I have dragged the saved art from PC to VTT, set the token up as desired- represents, name, and bars 1-3, then updated the default token and saved.  Dragging the token out looks good as Bar 3 is now Passive Perception rather than blank.  Still no joy.  I have cut n paste that script in to 3 other games, from across my time on Roll20 and it works perfectly in every one and all I have to do is use the compendium, look up Hezrou, drag it to the VTT and that is it.  once it is shown in the journal it works fine?  I also thought I had to d/l, save to PC and re-upload, but it doesn't seem to be the case for the other games EDIT: Deleted name Hezrou and re-entered it (though I have never edited it before) and now it works.  Unfortunately I then tried Chasme and hit the same snag, editing name does not help EDIT2: Adding another charcter after the name solves it (Chasme doesn't play nicely, Chasme. will).  I don't get why that is the case in only this game, but at least i have a workaround for now.  Would like to bottom it though as I don't like leaving it there
Make sure you have the grid on - if I use the spawnscript without the grid enabled all I get is the vfx same as you
thanks Norman, appreciated (and I didn't know that, so TIL) - yes the grid is on, what is bugging me is that it spawns in some and not others and a side-by-side of the setup shows no differences between tokens that can spawn and those that can't.
Simon G. said: EDIT2: Adding another charcter after the name solves it (Chasme doesn't play nicely, Chasme. will).  I don't get why that is the case in only this game, but at least i have a workaround for now.  Would like to bottom it though as I don't like leaving it there Hmm. I haven't used SpawnDefaultToken myself, so I'm mostly just guessing at possible troubleshooting steps.   Adding a period after the name makes me wonder if you have multiple characters with the same name?  If a character got copied (and then possibly archived, so you wouldn't see it in the main journal list) then it could be that the script is trying to pull from the other character sheet, and if that sheet still has a default token from the Marketplace then it won't work. If you open the token settings and open the dropdown for the 'Represents Character', do you see more than one 'Chasme' character?  If not, then double-check any archived characters, as they won't show up in the list, but they will still be 'available' to be referenced by scripts.
Hi Jarren, I haven't ever archived anything, there is a massive list of creatures in the journal, the ones I can't spawn all have multiple entires in the "Represents" field ( all the ones I have tested anyway).  Any idea why this would happen?  The game has been running for c3 years, so I can't swear to what may have been done, but I am confident I have never archived any.  Thanks for the continued effort
As in you see a drop down with a bunch of 'Chasme' to choose from for the "Represents" field?  If that's the case, then you need to delete all of the duplicate 'Chasme' characters that you are not using.  Is there a reason you have  duplicates? 
1704757438
David M.
Pro
API Scripter
Hmm, so re-entering the name fixed it for that one character. Any chance that there might be leading/trailing spaces or other non-visible characters in the other character sheet names that are causing problems? Maybe cut and pasted from a text editor or just fat-fingered something? I have the same question as Jarren re: why you have duplicate character sheets with the same name. If you are making "mooks", just make the hp bar unlinked from the character sheet so subtracting from one token doesn't affect all of them.
1704791647

Edited 1704793105
Hi Jarren and David, thanks both, that has helped me fathom this... this game has been running since I came to Roll20 as a VTT noob.  I am not making mooks, I found Keith Curtis' instructions on those wayyyy back, which was very much appreciated.  The journal for BGDIA is so huge that in the beginning I tended to compendium search and drag rather than search the journal and drag, this has caused some duplicates.  My mistake.   In my defence your honour, keeping the game moving and searching the journal for a creature that is a wandering encounter and so probably there against searching the compendium and definitely finding it is a tough call.  Most times you will win and away you go rejoicing, but others it will slow things down as you then search in another tab.  Yes I could pre-roll WMs, but I like the randomness and surprise as DM as much as the players do.  Omniscience is soooo dull. Snippets showing "Represents" "Appendix D: Creatures" and the top of "Journal", the latter being the slack handful of monsters I must have Compendium searched in the past. Deleting all the duplicates and repeating the creation from dragging the art out, setting up default token  now works like a charm. Whilst I feel the difficulty has arisen from historic actions on my part, this reinforces some very useful learning for the future, thank you.