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

Looking for a Spawn token macro for an Echo Knight dnd5e

Hello there, I am trying to create, or find a workable macro that my player can use when she wants to spawn her Echo token into roll20. The ones I have found sadly dont work. Any help would be appreciated!
1643051986
David M.
Pro
API Scripter
Have you seen this ? Requires the SpawnDefaultToken api script (on one-click, but a newer development version can be found here ).
David M. said: Have you seen this ? Requires the SpawnDefaultToken api script (on one-click, but a newer development version can be found here ). thanks for that, is there a way to make it where it sizes the generated token as a normal 1x1. right now its doing it as .5x.5, also the hp isnt coming through either
1643057476
David M.
Pro
API Scripter
Try this: !Spawn {{ --name|Echo Knight --offset|1,0 --size|1,1 --bar2|[[14 + @{selected|pb}]] --fx|bomb-smoke }} Are you using this on a non-gridded map, by chance? Sizing will only work properly on a gridded map, as it uses the map grid size for scaling. Re: hp, do you use bar2 for hp? If you use bar1, for example, you would need to change the line to --bar1|[[14 + @{selected|pb}]]
David M. said: Try this: !Spawn {{ --name|Echo Knight --offset|1,0 --size|1,1 --bar2|[[14 + @{selected|pb}]] --fx|bomb-smoke }} Are you using this on a non-gridded map, by chance? Sizing will only work properly on a gridded map, as it uses the map grid size for scaling. Re: hp, do you use bar2 for hp? If you use bar1, for example, you would need to change the line to --bar1|[[14 + @{selected|pb}]] I figured out the issue, Thanks so much! the only thing I cant get to work is the token-swap. Ive used the token swap from The Aaron, but its not swapping the 2 token positions. ( !token-swap @{selected|token_id} @{target|Swap with|token_id} )
1643058712
David M.
Pro
API Scripter
Hmm, that is exactly what we use for the swap and it works for us. Aside from ensuring token-swap is installed and the sandbox is running, I'm not sure why it is not working for you. Are you getting error messages?
wait, token swap has to be installed?
1643063816
David M.
Pro
API Scripter
Yes, the Spawn script only Spawns tokens. Token-swap does the swapping :) There is a link to that script in the post directly below the post I linked above. 
David M. said: Yes, the Spawn script only Spawns tokens. Token-swap does the swapping :) There is a link to that script in the post directly below the post I linked above.  I looked over that but it doesnt really explain about the script. I have no clue how it works, or where to apply it
1643066882

Edited 1643067148
David M.
Pro
API Scripter
EDIT: The steps below are for the token-swap script. Were you referring to that one or the SpawnDefaultToken script? For Spawn, you can install from the one-click menu, or manually install a newer version here using the same steps I describe below. Explanations of the Spawn commands are given here .  Feel free to post on that thread if you have questions. Ok, np. It just requires a manual install. 1) go to your api page and click on "New Script". 2) Paste the script code into the black window (included below for convenience) 3) Click the blue "Save Script" button. Now you will have the token-swap script installed! To use it, just create a macro (or preferably an ability as a token action on the Echo and/or players sheet) with the following content: !token-swap @{selected|token_id} @{target|Swap with|token_id} To use it, just select any token then run the macro and target another token that you want to swap places with! Here's TheAaron's token-swap code: on('ready',function(){ "use strict"; on('chat:message',function(msg){ var args, who; if (msg.type !== "api") { return; } who = getObj('player',msg.playerid).get('_displayname'); args = msg.content.split(/\s+/); switch(args.shift()) { case '!token-swap': { let t1 = getObj('graphic',args[0]); let t2 = getObj('graphic',args[1]); if(!t1 || !t2) { sendChat('TokenSwap', `/w "${who}" Please provide 2 token ids to swap: <code>!token-swap ID1 ID2</code>`); return; } let p1={ top: t1.get('top'), left: t1.get('left') }; let p2={ top: t2.get('top'), left: t2.get('left') }; t1.set(p2); t2.set(p1); if(!playerIsGM(msg.playerid)){ sendChat('TokenSwap', `/w gm <code>${who}</code> just swapped <b>${t1.get('name')}</b> and <b>${t2.get('name')}</b>. <a href="!token-swap ${t1.id} ${t2.id}">Swap Back</a>`); } } break; } }); });
awesome, thanks so much david! One final question, when my echo Knight clicks her spawn token the tokens menu always resets to None/Generic instead of the named token and her ability to control it. How can I fix this?
1644926571
David M.
Pro
API Scripter
Sounds like you need to save the latest (correct) settings of the Echo token to the default token. If you drag it out manually, I'm guessing that you would have the same issue. Here's info on linking default tokens tokens to journals.