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

Game macro asks for selected token in order to run.

Anybody know why this errors out unless I select a token first??  Is there a way to make this macro work without selecting a token?? /w gm &{template:npcaction} {{rname=Game Menu}} {{description=[Group Check](~Group-Check)  **Rests and Resets** [Short Rest](!shortrest @{selected|character_name}) | [Long Rest](!longrest @{selected|character_name}) [Reset Mook HP](!token-mod --set bar1_reset|0) [Direct Damage](~Apply-Damage) [Temporary HP](~Temp-HP) **Disappear** [Hide](~Hide) | [Toggle Hidden](~UnHide) | [Hide Off](~Hide-Off) |  [Invisible](~Disappear) | [Appear](~Reappear) | [Incinerate](~Incinerate) [White Smoke](~Planeshift) | [Dark Teleport](~Teleport) **Nameplate** [On](!token-mod --set showplayers_name|yes showname|yes) | [Off](!token-mod --set showplayers_name|no showname|yes) | [Hide](!token-mod --set showplayers_name|no showname|no) **Light & Vision** [Snuff](!token-mod --set light_otherplayers|off light_radius|0 light_dimradius|0 light_angle|360) | [Sight](!token-mod --on showname light_hassight light_angle|360) | [Blind](!token-mod --off showname light_hassight light_angle|360) | [Spot](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_hassight|on light_angle|360) | [GM](!token-mod --set light_otherplayers|off light_hassight|off light_radius|5 light_dimradius|5 light_angle|360) [Moonlight](!token-mod --set light_otherplayers|on light_radius|15 light_dimradius|=-15 light_angle|360) | [Starlight](!token-mod --set light_otherplayers|on light_radius|7 light_dimradius|=-15 light_angle|360) | [Touch](!token-mod --set light_otherplayers|on light_radius|4 light_dimradius|=-5 light_angle|360) [Candle](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_angle|360) | [Lamp](!token-mod --set light_otherplayers|on light_radius|30 light_dimradius|15 light_angle|360) | [Torch](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) [Hooded Lantern](!token-mod --set light_otherplayers|on light_radius|60 light_dimradius|30 light_angle|360) | [Bullseye Lantern](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|90) [Darkvision](!token-mod --set light_otherplayers|off light_hassight|on light_radius|65 light_dimradius|=-5 light_angle|360) | [DV90](!token-mod --set light_otherplayers|off light_hassight|on light_radius|95 light_dimradius|=-5 light_angle|360) | [DV120](!token-mod --set light_otherplayers|off light_hassight|on light_radius|125 light_dimradius|=-5 light_angle|360) |  [*Light*](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) | [*Daylight*](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|360) | [*Faerie Fire*](!token-mod --set light_otherplayers|on light_radius|1 light_angle|3600 light_dimradius|0 statusmarkers|purple light_angle|360) **Status** [OFF](!token-mod --set statusmarkers|=dead|-dead) | [Blue](!token-mod --set statusmarkers|!blue) | [Purple](!token-mod --set statusmarkers|!purple) | [Pink](!token-mod --set statusmarkers|!pink) | [Yellow](!token-mod --set statusmarkers|!yellow) **Conditions** [Show All](!ct conditions) | [Report](!ct show) | [Clear](!ct reset conditions !token-mod --set statusmarkers|=dead|-dead) **Aura** Player [⚫️](~Aura) | [⬛️](~Aura-Square) | 🌈 [R](!token-mod --set aura1_color|f00) | [G](!token-mod --set aura1_color|0f0) | [Y](!token-mod --set aura1_color|ff0) | [K](!token-mod --set aura1_color|000) GM Only [⚫️](~Aura-GM) | [⬛️](~Aura-Square-GM) | 🌈 [R](!token-mod --set aura2_color|f00) | [G](!token-mod --set aura2_color|0f0) | [Y](!token-mod --set aura2_color|ff0) | [K](!token-mod --set aura2_color|000) **Miscellaneous** Random Move [1](~Random-Movement-1)  |  [2](~Random-Movement-2) ⚠️*edges!* [Show Picture](~ShowPic) **Initiative** [Roll Initiative](!group-init) | [Clear Tracker](!group-init --clear) [Sort Tracker](!group-init --sort) | [Reset Round Marker](!tm reset 1) **Combat Manager** [Menu](!cm --main) | [Initiative](!cm --turn,start --main) [Stop Combat](!cm --turn,stop --main) **Other** [Notes to GM](!gmnote) | [Distance](~Measure) }}
1584464027
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
As the author of the macro, I can say that the offending line is this one: [Short Rest](!shortrest @{selected|character_name}) | [Long Rest](!longrest @{selected|character_name}) It needs to have a selected character in order to resolve. The solution is simple. 1) Get rid of  [Short Rest](!shortrest @{selected|character_name}) . Since writing this, I discovered that the OGL companion script does not have a short rest command, and no short rest functionality is built into the sheet. Replace it with this line [Long Rest](~longrest) and add the following ability to the macro sheet this runs on: longrest !longrest @{selected|character_name} I've been using that macro for so long, I'm just used to having a token selected.
Thanks Keith.  I really love the way your descriptions are step by step and easy to follow.  Makes this so much easier for those of us who are not familiar with the steps.
1584465333
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thank You  for pointing out the problem. I didn't realize I only had one macro left causing the issue, so it was a quick fix. I used to have a lot more "selected" calls in that macro.