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

comments in code

How do I add a comment to a macro/ability? I have found conflicting information / tales of changes, but there is no official way that I can find in the manuals.
Have you looked on the reddit?&nbsp; <a href="https://www.reddit.com/r/roll20" rel="nofollow">https://www.reddit.com/r/roll20</a> &nbsp;there might be more information there!
No, and why would I?&nbsp; I clicked on the link, and it was all memes. The answer should be on roll20.&nbsp;&nbsp;
1537983979

Edited 1537984083
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Gregory, are you talking about putting comments in the rolls so that you can see what a given calculation is for by hovering over the inline roll (or seeing it inline if using /r) If so, then that is what roll tags &nbsp; inline labels are: /r 1d20 + 5[Bab] +2[Ability Score] -5[Penalties or [[1d20 + 5[Bab] +2[Ability Score] -5[Penalties]]] gives the following output: Hope that helps, Scott EDIT: apparently the name has changed to inline labels.
You can also trick the chat window into thinking something is a comment by putting a ! in front. It must &nbsp;be at the beginning of the line and everything on that line will be hidden from chat. This is possible because a ! at the beginning of the line tells Roll20 that the line is an API command, which are not shown in the Chat Window.
Scott, I was not talking about hover text.&nbsp; Thanks though. Kyle, this is also not what I want. I want an actual coding comment.&nbsp; That never does anything. At all. A ! at the beginning of a line will still run and prompt me for things.&nbsp; That is NOT a coding comment. Like C++ has // This is a single one line comment
1537994501
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, that is not possible. Macros aren't really computer code.
Well that is dumb. Comments would be really helpful.
1537996899
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What functionality are you trying to get by having comments in? I'm trying and failing to see how this could be used.
1537998078
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Macros are essentially saved chat entries. They were never intended to be a programming language, so they are very limited in many ways. Are basically looking for way to annotate longer macros?
To build on Keith's point, since they're essentially saved chat entries there is &nbsp;a way to add comments, sort of, but it's not perfect. You'll need to save a copy of your macro someplace else (i.e. on your hard drive) and paste it in when you make changes. ...because you can use HTML comments &lt;!-- comment text here --&gt; , but they'll get stripped out when you paste them in. /em waves &lt;!-- action --&gt; Hello &lt;!-- greeting --&gt; World &lt;!-- recipient --&gt; I haven't experimented with URL-encoding the angle brackets or anything; this is the result of a quick I wonder if that'd work...? &nbsp;flight of fancy just now. Hope it helps.
keithcurtis said: Macros are essentially saved chat entries. They were never intended to be a programming language, so they are very limited in many ways. Are basically looking for way to annotate longer macros? Yes.&nbsp;&nbsp; All programming / macros/ complicated computer text type things should have comments that explains what is going on.&nbsp; Always.&nbsp; This is so other people can understand what the code is if anybody but the creator wants to read/use it.&nbsp;&nbsp; // this only spits out the correct answer assuming....&nbsp; &nbsp;&nbsp; // for similar macros, I found this one at <a href="http://www.list" rel="nofollow">www.list</a> ofhelpfulthingys.com // For the me five years from now.&nbsp; Remember how this nomenclature works?&nbsp; No?&nbsp; Of course you don't!&nbsp; It has been five years!&nbsp; Lucky for you I explained what the hell is going on. // here is some part of the functionality that will not come in play until I level up / get that sword / get my clothes back from the prison guards // If you are just starting out, and have found this thingy, you CANNOT just copy/paste it into your own game.&nbsp; Here is why... These are just SOME of the examples why comments are a thing.
1538058354
GiGs
Pro
Sheet Author
API Scripter
Having extensive documentation just doesnt make sense for macros. Macros in roll20 or more similar to how the word macro was originally used: methods of automating repetitive keystrokes, and it was very unusual to have comments in those. Macros in roll20 were also intended to be short and simple, and for personal use. There's no easy way to share them, for instance. If you do want to share documented macros, you'd normally save them to something like gist, where you can document them freely.
gist?
1538063080
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Gist is a simplified version of github for sharing snippets of code or one off scripts.