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

[Script] Spawn Default Token Thread 2

1649762130
David M.
Pro
API Scripter
Does the "All Players" token have sight? A couple years ago, Roll20 changed the default stacking behavior and gave priority to sighted tokens controlled by players including the gm. This behavior will override any token ordering assigned by the api. If that token doesn't need sight, try removing it and seeing if that fixes things for you.  Currently, there isn't an option to send just the source token to gm layer (the --layer option only affects the spawned tokens). You could use the option    --deleteSource|1  to delete the All Players token if it is no longer needed after spawning the party. Or, move the All Players token one square over if it is next to a wall and use an --offset command to stack the player tokens one square away from it. Finally, another option is to leave the All Players token on the GM layer to start, and use  --layer|object   to spawn the players on the object/token layer, though that sounds the most tedious to me. Those are the only ways I can think of right now. 
After getting a few players to test it I discovered a couple issues with my idea but also discovered that roll20 prioritizes player specific permission vision tokens over all player tokens fwiw.  I didn't have any permissions set so the all player kept popping on top for me as the Gm.  My issue was I wanted the players to move their party token, which has vision, and if they needed their formation on table, they could hit a button and spawn them, the problem however with this, is that the lil hackery you did for keeping player tokens linked breaks if a player uses the command to spawn tokens they don't control.  Instead of keeping links and doing the bars right, all the other players tokens get the players names in the bars as if the attributes couldn't be read.  No need to troubleshoot, I just decided to make it a button only I do as the GM, which makes everything work.  
1649853165
David M.
Pro
API Scripter
Ah yes, I didn't realize the players were initiating the spawn. Your new approach is definitely the way to go to get around the R20 permissions.
Hi. HUGE fans of the script. Please advise. I'm trying to spawn a character, that exists in the game in my library: !Spawn{{ --name|Negasonic --offset| 0,1.01 --size|1,2 }} Yet, I keep getting this error -- without the character spawning SpawnAPI:  in JSON at position 260 (From SpawnAPI):  Unhandled exception: Unexpected token
1653950887
David M.
Pro
API Scripter
Gallaher, is it working for other character sheets? If so, can you try re- setting up the default token for the Negasonic sheet (from scratch)? The only JSON parsing the script does is that of the default token associated with the sheet.  
>> Gallaher, is it working for other character sheets? If so, can you try re- setting up the default token for the Negasonic sheet (from scratch)? The only JSON parsing the script does is that of the default token associated with the sheet.  >> That seems to work, thank you !
Hi, David Came here from Nick's youtube vids on this API (thanks Nick). Apologies, if this has been answered in the forum previously, but this seems built to work only when the Page Grid is Enabled. If I import a map that has a grid included and have to turn the Roll20 grid off to avoid an overlaid double grid, the API doesn't seem to know where to place my tokens or how big to make them. Is there a work around for this or am I out of luck? 
1657252300
David M.
Pro
API Scripter
Yes, you are correct that the script requires an enabled grid. But, you could always turn the grid opacity all the way down? The only other option is resizing your map to fit the vtt grid lines. 
Hi David, Not sure if anyone else has mentioned this, but my players were noticing that when I spawned their tokens into the map, none of their Vision settings were working correctly. I tried a few different things like resetting their default tokens, moving their tokens, toggling UDL on the map and resetting the spawn macro, but none fixed it. I could only get the vision working again by turning each token off and on again. After simply trying to drag their token onto the map, they were not getting the vision issues.
1657285787
David M.
Pro
API Scripter
Styx, I'm assuming you are using UDL? This sounds like the UDL/api struggle continues. This used to be an issue (for light settings at least, not sure about vision), then it was mostly fixed (still issues with directional lighting), and now it seems to be back in full force. You'll probably find that you don't even need to toggle the vision settings off/on - merely opening the token properties window and saving (without making any changes) will trigger the vision and/or light emission. There's not much I can do, as this is a Roll20/UDL issue. :( Because of these issues I still use LDL, FWIW. If this does not describe your setup, then let me know.
I confirm... this long-going bug is still strong and nothing is done about it...despite all the tickets, reports, infos etc... given to roll20 devs. Even The Aaron is regularly questionning them about it and still it doesn't seem to be a problem for roll20.....
Yes, using UDL. I mean the script is still amazing for monsters, so still very useful. Thanks David!
Hey David, I had a question. Is Spawn capable of adding text to the GM notes section of a token?
1659129160
David M.
Pro
API Scripter
Hmm, never tried. Have you tried yet, using --tokenProps|gmnotes:text? Note there might be an issue with gmnotes when setting values immediately on the createObj api command (which is what Spawn does). See here for details. Not sure if this is still an issue, or if it ever was for tokens (I think the link was for handouts). I'm prepping for tonight's game right now, but can try to look into it this weekend.
I wasn't really sure of the command usage, but I'll give it a shot and see if I can get it to work. Thanks, David. 
Okay, I tested it out, but all it does is spit out the following:
1659132225
David M.
Pro
API Scripter
Ah, I must have excluded gmnotes because of issues. Was a while ago so I couldn't remember. If I left it in the documentation (page 1 of this thread), I'll remove it this weekend.
1659232942
Dumbhuman
Pro
Marketplace Creator
Is there any chance you'd consider adding an --img parameter that works similar to TokenMod, allowing one to use the url of an image in one's personal library? If not, I can get by using --side, but it would be easier to just pull from the source rather than set up a multisided token as a middle man.
Good Morning David, first I wanted to say I love your script, THANK YOU for the effort you put into this. but i have two question below is script i am working on: !Spawn {{ &nbsp; --name| Area Attack Marker &nbsp; --offset| 1,0 }} !Spawn{{ --name|?{Conjure What Animal?|Baboon|Badger|Bat|Blood Hawk|Camel|Cat|Crab|Deer|Eagle|Flying Snake|Frog|Giant Crab|Giant Fire Beetle|Giant Rat|Giant Weasel|Goat|Hawk|Hyena|Jackal|Lizard|Mastiff|Mule|Octopus|Owl|Poisonous Snake|Pony|Quipper|Rat|Raven|Scorpion|Sea Horse|Spider|Stirge|Vulture|Weasel} --bar1|?{HP?|Baboon,3|Badger,3|Bat,1|Blood Hawk,7|Camel,15|Cat,2|Crab,2|Deer,4|Eagle,3|Flying Snake,5|Frog,3|Giant Crab,13|Giant Fire Beetle,4|Giant Rat,7|Giant Weasel,9|Goat,4|Hawk,1|Hyena,5|Jackal,3|Lizard,2|Mastiff,5|Mule,11|Octopus,3|Owl,1|Poisonous Snake,2|Pony,11|Quipper,1|Rat,1|Raven,1|Scorpion,1|Sea Horse,1|Spider,1|Stirge,2|Vulture,5|Weasel,1} --bar2|?{AC?|Baboon,12|Badger,10|Bat,12|Blood Hawk,12|Camel,9|Cat,12|Crab,11|Deer,13|Eagle,12|Flying Snake,14|Frog,11|Giant Crab,15|Giant Fire Beetle,13|Giant Rat,12|Giant Weasel,13|Goat,10|Hawk,13|Hyena,11|Jackal,12|Lizard,10|Mastiff,12|Mule,10|Octopus,12|Owl,11|Poisonous Snake,13|Pony,10|Quipper,13|Rat,10|Raven,12|Scorpion,11|Sea Horse,11|Spider,12|Stirge,14|Vulture,10|Weasel,13} --offset|0,0 --qty|?{How Many?|1,1|2,2|3,3|4,4|6,6|8,8|9,9|12,12|16,16|24,24|32,32} --placement|rand,?{Quantity/Area|1,1|2,2|3,2|4,2|6,3|8,3|9,3|12,4|16,4|24,5|32,6} --targets|1 --size|?{Size?|Baboon,1,1|Badger,.5,.5|Bat,.5,.5|Blood Hawk,1,1|Camel,2,2|Cat,.5,.5|Crab,.5,.5|Deer,1,1|Eagle,.5,.5|Flying Snake,.5,.5|Frog,.5,.5|Giant Crab,1,1|Giant Fire Beetle,.5,.5|Giant Rat,1,1|Giant Weasel,1,1|Goat,1,1|Hawk,.5,.5|Hyena,1,1|Jackal,.5,.5|Lizard,.5,.5|Mastiff,1,1|Mule,1,1|Octopus,.5,.5|Owl,.5,.5|Poisonous Snake,.5,.5|Pony,1,1|Quipper,.5,.5|Rat,.5,.5|Raven,.5,.5|Scorpion,.5,.5|Sea Horse,.5,.5|Spider,.5,.5|Stirge,.5,.5|Vulture,1,1|Weasel,.5,.5} --expand|50,50 --tokenprops|aura1_radius:.7,aura1_color:#00ff00 --light|10,5 --fx|explosion-magic --deleteTarget|true&nbsp; }} First question is there a way i can combine&nbsp; the differant script calls like AC and HP into one line so i dont have to write each one separately (if that makes sense)?&nbsp; and second is there a way to add this script: &amp;{template:default} {{name=Conjure Animals}} {{ ?{Conjure Animals| Conjure Animals CR 0, *CR 0 (Summon up to 8 Animals)* &nbsp; [Baboon](<a href="https://www.dndbeyond.com/monsters/16795-baboon" rel="nofollow">https://www.dndbeyond.com/monsters/16795-baboon</a>) &nbsp; [Badger](<a href="https://www.dndbeyond.com/monsters/16796-badger" rel="nofollow">https://www.dndbeyond.com/monsters/16796-badger</a>) &nbsp; [Bat](<a href="https://www.dndbeyond.com/monsters/16802-bat" rel="nofollow">https://www.dndbeyond.com/monsters/16802-bat</a>) &nbsp; [Cat](<a href="https://www.dndbeyond.com/monsters/16820-cat" rel="nofollow">https://www.dndbeyond.com/monsters/16820-cat</a>) &nbsp; [Crab](<a href="https://www.dndbeyond.com/monsters/16833-crab" rel="nofollow">https://www.dndbeyond.com/monsters/16833-crab</a>) &nbsp; [Deer](<a href="https://www.dndbeyond.com/monsters/16839-deer" rel="nofollow">https://www.dndbeyond.com/monsters/16839-deer</a>) &nbsp; [Eagle](<a href="https://www.dndbeyond.com/monsters/16852-eagle" rel="nofollow">https://www.dndbeyond.com/monsters/16852-eagle</a>) &nbsp; [Frog](<a href="https://www.dndbeyond.com/monsters/16866-frog" rel="nofollow">https://www.dndbeyond.com/monsters/16866-frog</a>) &nbsp; [Giant Fire Beetle](<a href="https://www.dndbeyond.com/monsters/16883-giant-fire-beetle" rel="nofollow">https://www.dndbeyond.com/monsters/16883-giant-fire-beetle</a>) &nbsp; [Goat](<a href="https://www.dndbeyond.com/monsters/16906-goat" rel="nofollow">https://www.dndbeyond.com/monsters/16906-goat</a>)&nbsp;&nbsp; &nbsp; [Hawk](<a href="https://www.dndbeyond.com/monsters/16920-hawk" rel="nofollow">https://www.dndbeyond.com/monsters/16920-hawk</a>)&nbsp; &nbsp; [Hyena](<a href="https://www.dndbeyond.com/monsters/16930-hyena" rel="nofollow">https://www.dndbeyond.com/monsters/16930-hyena</a>)&nbsp;&nbsp; &nbsp; [Jackal](<a href="https://www.dndbeyond.com/monsters/16936-jackal" rel="nofollow">https://www.dndbeyond.com/monsters/16936-jackal</a>) &nbsp; [Lizard](<a href="https://www.dndbeyond.com/monsters/16945-lizard" rel="nofollow">https://www.dndbeyond.com/monsters/16945-lizard</a>) &nbsp; [Octopus](<a href="https://www.dndbeyond.com/monsters/16968-octopus" rel="nofollow">https://www.dndbeyond.com/monsters/16968-octopus</a>) &nbsp; [Owl](<a href="https://www.dndbeyond.com/monsters/16974-owl" rel="nofollow">https://www.dndbeyond.com/monsters/16974-owl</a>) &nbsp; [Quipper](<a href="https://www.dndbeyond.com/monsters/16989-quipper" rel="nofollow">https://www.dndbeyond.com/monsters/16989-quipper</a>) &nbsp; [Rat](<a href="https://www.dndbeyond.com/monsters/16991-rat" rel="nofollow">https://www.dndbeyond.com/monsters/16991-rat</a>) &nbsp; [Raven](<a href="https://www.dndbeyond.com/monsters/16992-raven" rel="nofollow">https://www.dndbeyond.com/monsters/16992-raven</a>) &nbsp; [Scorpion](<a href="https://www.dndbeyond.com/monsters/17006-scorpion" rel="nofollow">https://www.dndbeyond.com/monsters/17006-scorpion</a>) &nbsp; [Spider](<a href="https://www.dndbeyond.com/monsters/17018-spider" rel="nofollow">https://www.dndbeyond.com/monsters/17018-spider</a>) &nbsp; [Sea Horse](<a href="https://www.dndbeyond.com/monsters/17009-sea-horse" rel="nofollow">https://www.dndbeyond.com/monsters/17009-sea-horse</a>) &nbsp; [Vulture](<a href="https://www.dndbeyond.com/monsters/17048-vulture" rel="nofollow">https://www.dndbeyond.com/monsters/17048-vulture</a>) &nbsp; [Weasel](<a href="https://www.dndbeyond.com/monsters/17052-weasel" rel="nofollow">https://www.dndbeyond.com/monsters/17052-weasel</a>) | Conjure Animals CR 1/8, *CR 1/8 (Summon up to 8 Animals)* &nbsp; [Blood Hawk](<a href="https://www.dndbeyond.com/monsters/16810-blood-hawk" rel="nofollow">https://www.dndbeyond.com/monsters/16810-blood-hawk</a>) &nbsp; [Camel](<a href="https://www.dndbeyond.com/monsters/16819-camel" rel="nofollow">https://www.dndbeyond.com/monsters/16819-camel</a>) &nbsp; [Flying Snake](<a href="https://www.dndbeyond.com/monsters/16864-flying-snake" rel="nofollow">https://www.dndbeyond.com/monsters/16864-flying-snake</a>) &nbsp; [Giant Crab](<a href="https://www.dndbeyond.com/monsters/16879-giant-crab" rel="nofollow">https://www.dndbeyond.com/monsters/16879-giant-crab</a>) &nbsp; [Giant Rat](<a href="https://www.dndbeyond.com/monsters/16891-giant-rat" rel="nofollow">https://www.dndbeyond.com/monsters/16891-giant-rat</a>) &nbsp; [Giant Weasel](<a href="https://www.dndbeyond.com/monsters/16899-giant-weasel" rel="nofollow">https://www.dndbeyond.com/monsters/16899-giant-weasel</a>) &nbsp; [Mastiff](<a href="https://www.dndbeyond.com/monsters/16953-mastiff" rel="nofollow">https://www.dndbeyond.com/monsters/16953-mastiff</a>) &nbsp; [Mule](<a href="https://www.dndbeyond.com/monsters/16960-mule" rel="nofollow">https://www.dndbeyond.com/monsters/16960-mule</a>) &nbsp; [Poisonous Snake](<a href="https://www.dndbeyond.com/monsters/16982-poisonous-snake" rel="nofollow">https://www.dndbeyond.com/monsters/16982-poisonous-snake</a>) &nbsp; [Pony](<a href="https://www.dndbeyond.com/monsters/16984-pony" rel="nofollow">https://www.dndbeyond.com/monsters/16984-pony</a>) &nbsp; [Stirge](<a href="https://www.dndbeyond.com/monsters/17023-stirge" rel="nofollow">https://www.dndbeyond.com/monsters/17023-stirge</a>) } }} /fx nova-acid @{selected|token_id} !token-mod --ids @{selected|token_id} --set statusmarkers|HailofThorns|Concentration !splay Magic 2 !act -1 60 --Conjure Animals to the first but make the second script fire off first to allow a choice from a player then fire the second script for the actual summon.&nbsp; Currently i have 2 separate macros&nbsp; The second script is a macro i use first then the first script is a separate macro i use to summon the animal. Thanks for your time
Anyway to add a sound effect when you spawn a creature?
1660841733
David M.
Pro
API Scripter
Not natively, but you should be able to stack both Spawn and Sound api commands in a single macro. Here's an example using Roll20AM. You could also use SimpleSound .
Thanks found it got it to work!!!
I found a few ways to add sound fx and status markers to the caster with choices while using !spawn maybe this will help others&nbsp; !token-mod @{selected|token_id} --set statusmarkers|!?{Status:|Control Flames,ControlFlames|Create Bonfire,CreateBonfire} !token-mod --ids @{selected|token_id} --set statusmarkers|!?{Concentration:|No,|Yes,Concentration}&nbsp;&nbsp; ?{Which Sound Effect?|Magic SFX,#MagicSFX |Flame SFX,#FlameSFX }&nbsp; The sound effect is using nested macros with !splay&nbsp; I tried using roll20am and it doesn't work also you cannot nest token-mod in the nested macro it must be put in the original macro&nbsp; so below is a sample spell conjuring for Druid Cantrips&nbsp; !Spawn {{ &nbsp; --name|?{Which Marker?|Character Target|Area Attack Marker} &nbsp; --offset|1,0 &nbsp; --qty|1 &nbsp; --order|tofront &nbsp; --force|yes }} !Spawn{{ --name|?{Which Cantrip?|Control Flames|Create Bonfire|Druidcraft|Frostbite|Guidance|Gust|Infestation|Magic Stone|Mending|Mold Earth|Poison Spray|Primal Savagery|Produce Flame|Resistance|Shape Water|Shillelagh} --targets|1 --qty|1 --fx|?{Cantrip FX?|Control Flames,explode-fire|Create Bonfire,explode-fire|Druidcraft,explode-smoke|Frostbite,explode-frost|Guidance,explode-acid|Gust,explode-smoke|Infestation,explode-acid|Magic Stone,explode-magic|Mending,explode-magic|Mold Earth,explode-smoke|Poison Spray,explode-acid|Primal Savagery,explode-acid|Produce Flame,explode-fire|Resistance,explode-charm|Shape Water,explode-water|Shillelagh,explode-holy} --size|?{Cantrip Area Size?|Control Flames,1,1|Create Bonfire,1,1|Druidcraft,1,1|Frostbite,1,1|Guidance,1.5,1.5|Gust,1,1|Infestation,1.5,1.5|Magic Stone,2,2|Mending,2,2|Mold Earth,1,1|Poison Spray,3,1|Primal Savagery,2,1|Produce Flame,.5,.5|Resistance,1.5,1.5|Shape Water,1,1|Shillelagh,2,2} --order|tofront --force|yes --expand|10,50 --deleteTarget|true }} !token-mod @{selected|token_id} --set statusmarkers|!?{Status:|Control Flames,ControlFlames|Create Bonfire,CreateBonfire} !token-mod --ids @{selected|token_id} --set statusmarkers|!?{Concentration:|No,|Yes,Concentration}&nbsp;&nbsp; ?{Which Sound Effect?|Magic SFX,#MagicSFX |Flame SFX,#FlameSFX }&nbsp; /fx explode-magic @{selected|token_id} Maybe it will help someone out Thanks for of the help I have gotten and for the great mods!!
Oh forgot a timer with choice also&nbsp; !act?{Timer?|No|Control Flames, -1 600 --Control Flames |Create Bonfire, -1 10 --Create Bonfire |Guidance, -1 10 --Guidance }
1664463278

Edited 1664463337
Would there be any way to have this randomly select the spawned character from a list? I tried doing this using a rolltable which worked but i was hoping it would roll on the table for each selected token but instead it uses the same roll. what i'm trying to do is create a bandit gang randomiser: I would select a crowd of generic bandit tokens that i had dropped and run the following script: !Spawn {{ --name|[[1t[RandomBandit]]] --side|rand --deleteSource|yes }} the&nbsp;RandomBandit RT would just be a list of bandit creature sheet names: Scout Bandit Acolyte Bandit Captain etc. what i want is for the group to then be a mix of those options but what it does is just spawn all one type from the list. any advice?
1664466154

Edited 1664467846
@Lark: The issue is that the table is rolled once to evaluate the inline roll syntax, and the script uses that value for each iteration. You need functionality beyond what Spawn can do on its own. You may need to look at Select Manager and ScriptCards. Something like this might work: !script {{ --#hideCard|1 --~BanditTotal|array;selectedtokens;Bandits --~BanditID|array;getfirst;Bandits --%Counter|0;[&amp;BanditTotal];1 --=Bandit|T#RandomBandit --@Spawn| {^&amp;select [&amp;BanditID]} _name|[$Bandit.tableEntryText] _side|rand _deletesource|yes --~BanditID|array;getnext;Bandits --%| }}
1664468150
timmaugh
Pro
API Scripter
So, I'm assuming that the deleteSource argument in that Spawn command means that you start with a token, but you're going to replace it with the one you are Spawning. Just to make sure I understand what you're doing. Using SelectManager, you would change your line to something more like: !forselected(^)&nbsp; Spawn {{ &nbsp; --name|[^[^1t[RandomBandit]^]^] &nbsp; --side|rand &nbsp; --deleteSource|yes }} That should work... but I'll just point out, since you're just using a random side of the token, anyway, you could also do this with TokenMod and SelectManager... using a similar forselected start, and using the same deferral characters in the table roll. But if the above works, great!
1664469994
David M.
Pro
API Scripter
Thanks, Tim! Yeah, that should work to perform a complete replacement of the tokens, each as a "new character". Note: the --side command in the Spawn macro above will only do something if the spawned &nbsp;default token has multiple sides. If you meant to have the source tokens change to a random side but represent a different character sheet, then Tim's alternative suggestion of using token-mod (again with deferral character as in Tim's example) would be more appropriate. @Colin: Does that actually work? I have a feeling you would get an error because Spawn tries to get a display name from the playerID associated with the "player" calling the script (which would be the API in this case, which has no display name). Long ago I was going to update Spawn to facilitate direct calls from another script, but Tim's meta scripts came out so I never bothered.
@Colin, Tim, David thanks all, select manager worked perfectly
@Colin: Does that actually work? I have a feeling you would get an error because Spawn tries to get a display name from the playerID associated with the "player" calling the script (which would be the API in this case, which has no display name). Long ago I was going to update Spawn to facilitate direct calls from another script, but Tim's meta scripts came out so I never bothered. Ah! Maybe not? ScriptCards has the ability to grab the PlayerID, but I don't know how to shoehorn that into the Spawn script so that it processes as the originating player rather than the API. I seem to remember that being available through one of Tim's metascripts, but it eludes me now.
1664484935
timmaugh
Pro
API Scripter
Yep... a couple can help with that... SelectManager has the ability to "give back" the playerid to a mod-generated message (the same way it gives back selected tokens). I don't think it comes defaulted to giving it back, but you can check what you're giving back by running !smconfig, and you can turn on the playerid portion by adding +playerid: !smconfig +playerid And Fetch (the 2.0 currently in beta) can get player details with something like: @(player.Player Name.player_id)
1664485751
David M.
Pro
API Scripter
I think option 1 would be the way to get it to play nicely with Spawn. I never implemented syntax to input a msg playerID like I did with the Radar script (I think that was one?), so I don't think option 2 would buy anything in this case. Meta-attaching to the msg would be the only way as currently written. Though I think Tim's original SM macro with roll deferrals is the cleanest solution.
Thought i would post this and see if this is a feasible solution or just another option for the "target" or "Selected" . I was screwing around and though about making a button you could push in a spell see below &amp;{template:npcaction} {{rname=**Cantrip:** [Guidance]( <a href="https://s3.amazonaws.com/files.d20.io/images/308723242/Jpuqk7spLRh9pxWA5H0k9A/original.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/308723242/Jpuqk7spLRh9pxWA5H0k9A/original.png</a> ) You whisper "Primiceriatus", reach out and touch your comrade's shoulder.}} [STMA](!token-mod --ids @{selected|token_id}&nbsp; --set statusmarkers#+Guidance) [SFX](!splay Toll the Bell) [Spawn](!Spawn{{ &nbsp; --name|Guidance &nbsp; --offset|0,0 &nbsp; --qty|1 &nbsp; --fx|explode-holy &nbsp; --size|2,2 &nbsp; --order|toback &nbsp; --force|yes &nbsp; --expand|10,50 &nbsp; --deleteTarget|false }}) !token-mod @{selected|token_id} --set statusmarkers#+Guidance|+Concentration&nbsp; /fx explode-holy @{selected|token_id} !act -1 10 --Guidance This allowed me to choose a character on the board and then hit the button casting it on the character without using a target icon. This doesnt pop a separate choose a target menu, you choose the target and hit the button. Just a thought...
I am messing around with the !radar and Ispawn as a button within a spell also hopefully it also works...
1665858241
timmaugh
Pro
API Scripter
Hey, UC... I think the issue is that most people don't play in a game where they can select tokens that don't belong to them... so the targeting mechanic tries to fill that gap. Again, SelectManager can help for at least one selected token, by putting it in a {&amp;select ... } statement. Then the "selected" token will remain selected even if you utilize a Targeting statement: !somescript --target|@{target|Name Your Pain|token_id} {&amp;select @{selected|token_id} }
I love !spawn greatest thing since sliced bread!! So that is why Im asking this here. is there a way to add something to the script or maybe something completely new that can be used with !spawn that actually deletes a token after a set timer. For example, I want a aummoned token to vanish after 1 minute if a clue on a puzzle isnt resolved. If not its no biggie just think this could create huge ideas in a game, like a spell token disappears after its cast in 10 seconds. Thanks again for !spawn!!!
When trying to use the "!Spawn" command, it spawns an invisible token, am I doing something wrong ? I'm calling a character that has an image and a token image :/ Example of my bug here
1671042880
David M.
Pro
API Scripter
If you drag a copy manually from the journal, does it appear correctly? Is the grid enabled on your map, and if not, does it work correctly when enabled?
It was the grid, is there any way to make it work without the grid ?
1671043309
David M.
Pro
API Scripter
Unfortunately, the script currently requires a grid to determine the offset positioning relative to the selected token as well as some of the optional placement options (e.g. row, column, grid, etc.)
I'm crying it was the only one doing what I wanted :( Can't it determine the offset based on the token position ? I wouldn't use the row, column or everything, just the X and Y thingies I need to spawn a rollable token on the side of my player's tokens, these tokens will be weapons that they equip, like this Your script was my only option :(
1671044731
David M.
Pro
API Scripter
Sorry :/&nbsp; It's not impossible (in fact I have to convert everything into pixels anyway), but the current status is that a grid is required. If I implemented pixel units on the input side, I would have to make sure all of the other options work as well, or else I'd start getting bug reports from other people trying to use them.&nbsp; My gut feeling is that this shouldn't be too difficult, but I'll need to take a look through my spaghetti code before commenting on how easy this would be to implement. I'm sure I structured everything in the least convenient way possible, since I'm not exactly a trained professional haha.
Thanks tho ! Your script is still amazing
Can't you work with a transparent grid ?
1671209225
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
David M. said: My gut feeling is that this shouldn't be too difficult, but I'll need to take a look through my spaghetti code before commenting on how easy this would be to implement. I'm sure I structured everything in the least convenient way possible, since I'm not exactly a trained professional haha. Don't give away my programming secrets!
1673772434

Edited 1673792337
Jim
Pro
Hi David, I just started using your script, and it is wonderful!&nbsp; Thank you for creating and maintaining it. I am having one minor issue.&nbsp; When I spawn the default token for a character, it always has the property "Is Drawing" turned off regardless of how it is set on the default token.&nbsp; I confirmed that the default token is set to have Is Drawing turned on, and if I manually drag-n-drop the character on the map to create the token, it correctly keeps that setting.&nbsp; But when I use the spawn command, the created token is back to having the bars, circles and status/gear widgets.&nbsp; I'm not using these tokens for tracking hit points or statuses or anything, so I'd rather the spawned tokens be treated as drawings. Is there a way to do that?&nbsp;&nbsp; Thanks again! EDIT:&nbsp; 2nd Question:&nbsp; Is there a way to have the spawned token selected at the end of the script?&nbsp;&nbsp;
1673791206
David M.
Pro
API Scripter
Hi Jim, you can add the&nbsp;--isDrawing command to your spawn macro and set the value to "true", "1", or "yes", e.g. --isDrawing|1
David M. said: Hi Jim, you can add the&nbsp;--isDrawing command to your spawn macro and set the value to "true", "1", or "yes", e.g. --isDrawing|1 Perfect, thank you!&nbsp; Is there a way to have the spawned token selected at the end of the script?
1673792787
David M.
Pro
API Scripter
Unfortunately, no. It's a Roll20 limitation. The Mod script sandbox doesn't allow token selection (or really much of anything UI-related). There is no "isSelected" property in the graphic object model.
Okay, thanks again!