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

Players cannot run macros

1587065542

Edited 1587065603
Hi all! I've read the Wiki and 10 other posts, in vain. :-( I wrote a bunch of macros to simplify the lives of my players so they could easily click a button and get most complex stuff done. I'm running in issues I can resolve.&nbsp; Can you please help me understand? 1. Players running a macro are getting unrecognized command errors Here is an example. Player should click a button and be presented with choices in the chat box about what kind of gun they use, the kind of attack, the range, etc. Then it spews a table explaining results and rolling dices, fetching attributes. Works like a charm on my side. I'm also able to add it to their view no problem. /desc&nbsp; /emas ATTACK ASSISTANT for @{selected|token_name} /desc Ranged attack with... /desc [Handgun](!#Handgun) | [SMG](!#SMG) | [Rifle](!#Rifle) |[Shotgun](!#Shotgun) | [Sniper Rifle](!#Sniper-Rifle) | [Grenade](!#Grenade) | [Bows and crossbows](!#Archery) | [Custom ranged weapon](!#CustomRange) /desc Or close combat with... /desc [Hand-to-hand](!#Brawl) | [Melee](!#Melee) | [Fencing](!#Fencing) /desc If close combat, target should immediately announce their defense (Block, Dodge or Parry) and if (s)he will use special modifiers. Which results in this when the GM rolls it with a player token selected : ATTACK ASSISTANT for Alex Test Ranged attack with... Handgun &nbsp;|&nbsp; SMG &nbsp;|&nbsp; Rifle &nbsp;| Shotgun &nbsp;|&nbsp; Sniper Rifle &nbsp;|&nbsp; Grenade &nbsp;|&nbsp; Bows and crossbows &nbsp;|&nbsp; Custom ranged weapon Or close combat with... Hand-to-hand &nbsp;|&nbsp; Melee &nbsp;|&nbsp; Fencing If close combat, target should immediately announce their defense (Block, Dodge or Parry) and if (s)he will use special modifiers. But when a player triggers it ( with it's own token selected ), we get: Unrecognized command: /desc Unrecognized command: /emas ATTACK ASSISTANT for Alex Test Unrecognized command: /desc Ranged attack with... Unrecognized command: /desc &lt;a href="!#Handgun"&gt;Handgun&lt;/a&gt; | &lt;a href="!#SMG"&gt;SMG&lt;/a&gt; | &lt;a href="!#Rifle"&gt;Rifle&lt;/a&gt; |&lt;a href="!#Shotgun"&gt;Shotgun&lt;/a&gt; | &lt;a href="!#Sniper-Rifle"&gt;Sniper Rifle&lt;/a&gt; | &lt;a href="!#Grenade"&gt;Grenade&lt;/a&gt; | &lt;a href="!#Archery"&gt;Bows and crossbows&lt;/a&gt; | &lt;a href="!#CustomRange"&gt;Custom ranged weapon&lt;/a&gt; Unrecognized command: /desc Or close combat with... Unrecognized command: /desc &lt;a href="!#Brawl"&gt;Hand-to-hand&lt;/a&gt; | &lt;a href="!#Melee"&gt;Melee&lt;/a&gt; | &lt;a href="!#Fencing"&gt;Fencing&lt;/a&gt; Unrecognized command: /desc If close combat, target should immediately announce their defense (Block, Dodge or Parry) and if (s)he will use special modifiers. 2. Players get property errors when running some macros They get this error&nbsp; TypeError: Cannot read property 'substring' of undefined Example of macro: @{character_name} says hi Or: &amp;{template:skill}{{name=@{character_name}}}{{skillname=Initiative}}{{result=[[1d10!cf&lt;1+@{ref}+@{ref_mod}-@{ref_penality}+@{init_mod}+@{combat_sense}+?{Type|Normal,0|Quick,3}+?{mod.|0}]]}}{{mod=?{mod.|0}}} 3. Player runs a macro, it triggers but nothing happens&nbsp; Here is an example which works perfectly for the GM with a player token selected, but won't work for a player, even when they selected their own token. /emas @{selected|token_name} [[1t[Expressions]]] /desc &amp;{template:default}{{name=@{selected|token_name} fires a single bullet from his pistol}}{{Skill Check=Handgun}}{{To Hit at [[?{Attack Range?|50}]] m. = [[round(9.43+0.573*(?{Attack Range?|50}) - 0.00679*(?{Attack Range?|50})**2 + 0.0000312*(?{Attack Range?|50})**3))]]}}{{Result=[[[[1d10!cf&lt;1]] + 0 [Single shot] + @{selected|ref} [Reflex stat] + @{selected|ref_mod} [Reflex modifier] - @{selected|ref_penality} [Reflex penalty] + @{selected|handgun} [Handgun skill] ?{Stance|Normal,+0 [No initiative modifier]|Fast draw (-3), -3 [Fast draw penalty]|Ambush (+5),+5 [Ambush bonus]|Dodging/parrying (-3),-3 [Dodging/parrying modifier]} ?{Weapon Accuracy.|+0} [WA] ?{Other modifier?|+0} [Other modifier(s)]]]}} GM view: Alex Test&nbsp;<span class="userscript-userscript-inlinerollresult showtip tipsy-n-right" title="Rolling 1t[Expressions] = ( s&quot;esclaffe &quot;ha ha ha ha!&quot; )" style="background-color: rgb( 254 , 246 , 142 ) ; border: 2px solid rgb( 254 , 246 , 142 ) ; padding: 0px 3px ; cursor: help ; font-size: 1.1em">s'esclaffe "ha ha ha ha!" Alex Test fires a single bullet from his pistol Skill Check Handgun To Hit at&nbsp; 50 &nbsp;m. 25 Result 6 When the player runs it, he receives the prompts, answers them, but then, nothing happens. No error message. 4. Finally, one last weird thing: apparently players cannot target other tokens? Macro line:&nbsp; /w&nbsp; @{target|token_name} ?{"Que dis-tu?"|} Returns " You attempted to use a roll command looking for the value of a selected token, but no tokens are selected. " for a player, even after clicking on a valid token! *************** I'm&nbsp; playing Cyberpunk2020 with the v2 character sheet. I'm about to lose my mind. Can someone please tell me what I'm doing wrong? How can I write a macro using a player stats and skills (Abilities) that can be triggered by the players themselves? Thanks, Alex
EDIT - Seems like my post is too long and gets cut, here is the end ****** 4. Finally, one last weird thing: apparently players cannot target other tokens? Macro line:&nbsp; /w&nbsp; @{target|token_name} ?{"Que dis-tu?"|} Returns " You attempted to use a roll command looking for the value of a selected token, but no tokens are selected. " for a player, even after clicking on a valid token! *************** I'm&nbsp; playing Cyberpunk2020 with the v2 character sheet. I'm about to lose my mind. Can someone please tell me what I'm doing wrong? How can I write a macro using a player stats and skills (Abilities) that can be triggered by the players themselves? Thanks, Alex
1587065755
The Aaron
Roll20 Production Team
API Scripter
Players cannot use /desc or /emas.&nbsp; Only GMs.&nbsp; They can use /em to emote as their current character (selected in the dropdown).&nbsp; There are API scripts that provide some alternate formatting, requiring a Pro subscription. You can use the Basic Formatting options to produce some nice results for your players:&nbsp; <a href="https://wiki.roll20.net/Text_Chat#Basic_Formatting" rel="nofollow">https://wiki.roll20.net/Text_Chat#Basic_Formatting</a>
1587065912
The Aaron
Roll20 Production Team
API Scripter
For whispers, surround the character name in " ".&nbsp; You shouldn't try to whisper to a token name, as it might not match a character, but the character name should always work (short of some cases with certain text): /w "@{target|character_name}" ?{"Que dis-tu?"|}
The Aaron, I've read many of your posts already so THANK YOU for all the help to the community&nbsp; I tried removing all formating, to no avail :( I'll try again Can you explain why quotes are helping? What is their impact?&nbsp; Cheers Alex
1587079969
GiGs
Pro
Sheet Author
API Scripter
Regarding the quotes here /w "@{target|character_name}" In laymans terms - when you run a macro, roll20 checks all attribute calls like this one, and loads them into the text of the macro, then runs the macro. So if you have a player with a character named Frodo Baggins, without those quotes, that text will become /w Frodo Baggins and then the macro will try to send the macro to a character named Frodo, and send the ward Baggins to them. Since it regards spaces as a separator. With the quotes, though, it becomes /w "Frodo Baggins" which roll20 treats as one string, so looks for a character named Frodo Baggins. On an unrelated matter, I notice you have this: ?{"Que dis-tu?"|} The quotes there are unnecessary, unless they are for some stylistic reason. The end pipe (|) also isn't necessary, if you not providing some default text. So you could just as easily do ?{Que dis-tu?}
Thank you Gigs Target, whisper and the like So, I tried /w "@{target|character_name}" ?{Que dis-tu?} Now it send a message, but unless the name of the Character matches exactly the name of a player, it just pastes it in the general chat. Am I missing something? Skill check For the other macros, removing all formatting seems to have worked, I'm testing thank you!!
And unfortunately, targetting seems to not work again. When I run this macro as the GM it works fine. As a player, I get all the questions, I get to select a token but then, nothing happens. Even the targetting pop up stays there floating. Could it be that during the execution of the macro, when I click on a target, I lose the "selection" of the token therefore it's not finding where to pull the Attributes from? @{selected|token_name} attempts to stabilize @{target|token_name} **Skill Check=TECH** **Death State** Check [[1d10!cf&lt;1]] &gt; = ?{Death State Number?|0} **Stabilization** check = [[[[1d10!cf&lt;1]] + @{selected|tech} [Tech stat] + @{selected|tech_mod} [Tech modifier] - @{selected|tech_penality} [Tech penalty] + ?{Medical skill|First Aid @{selected|firstaid},@{selected|firstaid} [First Aid skill]|Medical Tech @{selected|medical_tech},@{selected|medical_tech} [Med Tech skill]} ?{Medical context?|No,+0|Full Hospital &amp; Surgery +5, +5|Trauma Team Ambulance +3, +3|Cryo Tank +3, +3} ?{Helper stance|Normal,+0 [No initiative modifier]|Fast draw (-3), -3 [Fast draw penalty]|Dodging/parrying (-3),-3 [Dodging/parrying modifier]} ?{Helper other modifier?|+0} [Other modifier(s)]]] **Patient's injuries** (difficulty) = @{target|injury} **Daily Healing Rates** *First Aid =0.5 | Med Tech+Nanotech = 2 | Med Tech + Nano +Speed Heal = 3* *If body part needed : [[1t[Body-Bank]]]* *Arm = 1000 | Leg = 1200 | Hearth or Lung = 1400 | Liver or kidney = 400 | Eye or ear = 1000 | Other organs from 300 to 1000 | Vat Grown = 2X* Finally, isn't it possible to write a macro that doesn't require a token to be selected to fetch the value of an Attribute? Example, if character sheets have the INT attribute for intelligence and I wish a player to be able to push a macro button and roll 1d10 + INT + a modifier prompt, must I use the @{selected|INT} format or could it just pull it from the active player running the macro? Am I making any sense or did I misunderstand how macros work?
1587137690
Kraynic
Pro
Sheet Author
If it is written as a character ability (Attributes &amp; Abilities tab), then you don't need selected or anything.&nbsp; It defaults to pulling the attribute from that sheet, so you could just use @{INT}.&nbsp; If you aren't rolling from the sheet and but are writing for a specific character, you would need to have the exact name of the character instead of selected or target: @{Billy Bob|INT}. As far as diagnosing your macro goes, hopefully someone that uses target macros will have run into something like this. I have actually never used target macros at all, so don't know the quirks of that part of the macro system.
Good stuff, thanks Kraynic. I'm hoping someone can help me with my target issues.
Alright! I believe I found the last issue for my rolls. 1. The Aaron confirmed players cannot use the same formatting as the GM , so forget about /desc and the like 2. GiGs explained that for names including a space , unless we put it in " " , it may fail as Roll20 will treat each word as separate, possibly messing up the command 3. Kraynic confirmed that outside Char Sheet Abilities, you must target/select a token to fetch it's Attributes 4. I just discovered that my stup*d rolltable to shout an expression wasn't shared with players which killed the marco!&nbsp; [[1t[Expressions]]] Boy would it be nice to have clear errors in the logs... With these solved, it's working like a charm... so far. Yay!!! :) The last outstanding question is /w "@{target|character_name}" ?{What are you whispering?} Will send a message, but unless the name of the Character matches exactly the name of a player, it just pastes it in the general chat. Am I missing something? Why is the player name important? Can someone give it a try please? Thanks to the whole community, you folks rock Alex
1587222564

Edited 1587222618
Kraynic
Pro
Sheet Author
If your player/character list is stable, you could set up a query with a set list of names you can whisper to, which would cut out the risk of misspelling the names during a game.&nbsp; The target of a whisper is just as important as setting the correct source for pulling an attribute.&nbsp; If it is spelled wrong, it will drop that part of your statement and run with what still works (posting the remainder to chat).&nbsp; I would think your target solution should work.
Ok but is it normal that the character name isn't not working? It has to be the payer name? Like Chris has a character named Orlando. Chris would work but not Orlando... What's wrong?&nbsp;
Check the settings on token you click when prompted for a target. Is it set to represent Chris's Orlando character sheet?
Yes, the tokens are all well setup. One of them has the same username in Roll20 as he has on his Character Sheet and the macro works when whispering to him. Here is my macro again: /w "@{target|character_name}" ?{What are you whispering?} I actually have 3 behaviors 1. If the Character Name is a single word,&nbsp;it works. 2. If the Character Name has more than one word, like Ortega Ortez, for example, then it doesn't whisper, it just pastes in in the general chat. 3. If I use the token_name instead including only first name, then it auto-fills the rest of the name (Orlando becomes Orlando Ortez for example) but again, when players do it, it pastes in the general chat box. Seems like the GM never has any problems. Thanks for your help folks Alex
1587245984

Edited 1587246656
That's a weird one. /w "@{target|character_name}" ?{What are you whispering?} works for me with multiple word names. If you select the token and type @{selected|character_name} in the chat box, what do you get? Edit: Thought of some other things to look at. When the whisper dumps to chat, do you see any error messages with an orange background? When the whisper dumps to chat, is it on a blue background?
Hi there! 1. When the whisper dumps to chat, do you see any error messages with an orange background? Nope, no error message 2. When the whisper dumps to chat, is it on a blue background? No it actually passes on the yellow background as expected but anyone can see it. Also, I did your suggested tests. 3. First line, the GM tested&nbsp; @{selected|character_name} after selecting Character "Alex Test" Second line, same test by the player "Alex Test" with himself Third line player whispers and this is public telling everyone he's whispering Fourth line is the actual whisper which should be invisible from my perspective which is the GM. Any thoughts? 10:32AM GM (GM): Alex Test 10:32AM Test Alex B.: Alex Test murmure... 10:32AM (From Test Alex B.): &nbsp;This is Alex testing a whisper
Haha! I confirm that the GM can now write to multiple name characters with the quotes. But it's still not working for Players who use the macro. If the target Character Name has more than one word, it will dump to public as if no whisper was occuring.
The yellow background means that it is whispering. If everyone can see it, I would guess that everyone is in the Edit and Controlled By permission on the character sheet whispered to. Can you check those permissions?
/facepalm Well that's what you get when you don't cleanup your tests......... Rabulias is right: the reason whispers were "bleeding out" was because other players were sharing Edit rights to the Character Sheet of the token I used for my tests. Case closed!!! Thanks everyone!!!!!