Spurious output from macros with comments - known issue?

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
Post Reply
Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Spurious output from macros with comments - known issue?

Post by Phergus »

So the following macro code produces the correct output on the GM's and macro-clicker's chat but also produces blank output lines on all the other clients.

Code: Select all

<!-- foo -->
[s,g,r:1d100]
This also happens with just the 's' roll option or just the 'g' roll option.

Take out the comment and it works as expected.

Is this a known issue? If so, is there a workaround?

MT versions 1.4.0.5 and 1.4.1.7.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Spurious output from macros with comments - known issue?

Post by Full Bleed »

Phergus wrote:So the following macro code produces the correct output on the GM's and macro-clicker's chat but also produces blank output lines on all the other clients.

Code: Select all

<!-- foo -->
[s,g,r:1d100]
This also happens with just the 's' roll option or just the 'g' roll option.

Take out the comment and it works as expected.

Is this a known issue? If so, is there a workaround?

MT versions 1.4.0.5 and 1.4.1.7.
You need to hide the comment.

Code: Select all

[h: "<!-- foo -->"]
http://lmwcs.com/rptools/wiki/Introduct ... o#Comments
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spurious output from macros with comments - known issue?

Post by aliasmask »

Better yet, use UDFs, hide output and use broadcast for output.

My starter token has all the basics for creating UDFs for you: http://forums.rptools.net/viewtopic.php ... er#p267681

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Spurious output from macros with comments - known issue?

Post by Phergus »

Full Bleed wrote:You need to hide the comment.

Code: Select all

[h: "<!-- foo -->"]
http://lmwcs.com/rptools/wiki/Introduct ... o#Comments
Thanks FB. :lol: Hide the hidden output by hiding it. I should have expected that. :lol:

Too bad the documentation on the wiki doesn't just say that HTML comments create spurious output so don't use them.
In contrast, in MapTool's macro language, anything between the comment tags is hidden from chat, but if you embed macro commands in there, they will be executed.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Spurious output from macros with comments - known issue?

Post by Phergus »

aliasmask wrote:Better yet, use UDFs, hide output and use broadcast for output.
Not sure that addresses the issue that even if I hide all output in a macro a single HTML comment will produce a line of empty output to all clients. My goal is to have comments in my macro code and apparently the documentation is flat wrong.
aliasmask wrote:My starter token has all the basics for creating UDFs for you: http://forums.rptools.net/viewtopic.php ... er#p267681
Thanks. I'll look over your stuff.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Spurious output from macros with comments - known issue?

Post by aliasmask »

Html comments still produces output. If you go to the chat log you would see the blank lines are actually your html comments. But since they are not shown in text, you don't see anything.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Spurious output from macros with comments - known issue?

Post by Phergus »

Well that explains why the chat log files are so big.

For every line of of actual chat output there are 10 or so lines of HTML comment plus all the HTML formatting code.

Your recommendation about UDFs was because they can produce no output at all if the ignoreOutput flag is set to true?

You'll have to forgive my ignorance about the macro functions as even though I have been using MapTool for 12 years I rarely used macros until a couple years ago. Until four weeks ago I had never saved a chat log let alone looked at one.

Thanks AM.

Post Reply

Return to “MapTool 1.4”