SpeakForMe: Speak as a token without impersonating it

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: SpeakForMe: Speak as a token without impersonating it

Post by plothos »

Hey Rumble, can you explain what the color problem is? In our last session I think it stopped working for all four people for the duration of the 5 hour session. :(
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: SpeakForMe: Speak as a token without impersonating it

Post by Rumble »

plothos wrote:Hey Rumble, can you explain what the color problem is? In our last session I think it stopped working for all four people for the duration of the 5 hour session. :(

Actually, I can't. I don't know why it fails; my assumption is that eventually some tag gets closed improperly in the chat window's HTML rendering and it breaks from then on out. Azhrei suggested another thing to try, but I hadn't gotten to it yet.

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: SpeakForMe: Speak as a token without impersonating it

Post by plothos »

Hmmm, maybe, but for the past few days I've pretty much just not had it work at all right from the get-go. Maybe some element of the framework is causing that problem for us suddenly. It wasn't a problem before.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: SpeakForMe: Speak as a token without impersonating it

Post by Rumble »

plothos wrote:Hmmm, maybe, but for the past few days I've pretty much just not had it work at all right from the get-go. Maybe some element of the framework is causing that problem for us suddenly. It wasn't a problem before.
I don't know - I uploaded the token with the changes just a second ago, but I might have already done that now that I think about it.

I've had some very strange things happen lately with MT, bizarre fluke stuff. Silent failures (as in, macro code errors that should pitch a total fit with java.lang.errors and null pointer exceptions simply failing without any indication); heck, just now I had DeviantNull's framework open, and then I closed it and went to a different campaign, and when I clicked on a token, it threw an error about a token in DeviantNull's campaign file!


Edit: aaand I just figured that one out. A frame was still open from that campaign, and it had some mouseover stuff in it that was freaking out.

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: SpeakForMe: Speak as a token without impersonating it

Post by Malekith »

Hey Rumble.
I've taken a good look at your latest code since the problems that plothos mentioned about our last session. Both in the MT code (which is practically perfect) and by looking at the chat log of our session in microsoft expression web (looking at the output html code) and I'm 99% certain I have found the reason behind the colour problem! Though the trailing character names with the emote layout aren't easy (if possible) to remove.
Basically MT formats any chat output like so:
Base code

Code: Select all

<div>
  <table cellpadding="0">
      <tr>
          <td style="padding-right: 5px" width="40" valign="top">
            <img src="asset://tokenimageidnumber">    (if there's an impersonated token)
          </td>
          <td style="margin-right: 5px" valign="top">
            SpeakerName:
          </td>
          <td valign="top">
            <span><font color="#number">         (the HEX value of your default font colour)
            Outputted Text</font></span>
          </td>
      </tr>
   </table>
</div>
Now if a macro output (or i suppose anything sent to the chat window) has any of the tags (i'm not entirely sure which ones) then the basic MT chat formatting is overwritten.
e.g.
Speak As code

Code: Select all

    <div>
      <table cellpadding="0">
        <tr>
          <td style="padding-right: 5px" width="40" valign="top">
            <img src="asset://1cac8a96e08f5784a2173ff3514b5ab9-40">
            
          </td>
          <td style="margin-right: 5px" valign="top">
            Fobba:
          </td>
          <td valign="top">
            <span color="maroon"><font color="#009999">Ha! Fair enough, 
            scrapechin</font></span>
          </td>
        </tr>
      </table>
    </div>
A section from the chatlog of Plothos' well mannered dwarf ;)
This comes out at grey (Plo's chosen colour) rather than maroon (Fobba's Speak As colour).
Now I fully agree with your use of span colour to change the text as font is a deprecated tag. However I think what's happening is that somewhere along the output line the MT is making a decision about which tag to use. Sometimes I'll see the span colour and sometime I see the font colour, I'm not sure if there's a preference - that'd need more testing to see. (Aside for a second: I also thought that the span tag needed to be set out something like: <span style="font-color:gray,text-face:Arial"> but I seem to be mistaken as the emote option is working fine due to the other <div> closing).
hence the solution would be to change the font colour tag to <font> instead of <span> so that there's only one value for the font colour to be picked from, but you could still use the span tags for background colours and font face if you wanted though.
Hope it helps, I've already made the change and tested it and it seems to work :)

Mal

EDIT: for completeness, I forgot to mention that whispers, /e and other such non-standard chat things are treated slightly differently in the html, but all still have their own <div> at least
Mal

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: SpeakForMe: Speak as a token without impersonating it

Post by plothos »

Confirmed. Mal seems to have fixed it, based on our brief test.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: SpeakForMe: Speak as a token without impersonating it

Post by Rumble »

If you want to pull down the latest SpeakEasy token, edit the changes, and send it back to me, that would be cool with me (rather than repeat all the work) - of course, if you're using the latest one, then just send me a copy (or post it here) and I'll consider that the latest update (I keep them in an SVN repository).

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: SpeakForMe: Speak as a token without impersonating it

Post by Malekith »

Attached should be the right one.
the change is simple really, just on the rspk.SpeakForDialog Macro where it says:

Code: Select all

 [h,if(!emote): what =strformat("<span color='%{color}'>%{italicOpen}%{boldOpen}%{underlineOpen}%{what}%{underlineClose}%{boldClose}%{italicClose}</span>"); what = strformat("</div> * <span color='green'>%{who} %{what}</span><div>")] 
and replace it with this:

Code: Select all

 [h,if(!emote): what =strformat("<font color='%{color}'>%{italicOpen}%{boldOpen}%{underlineOpen}%{what}%{underlineClose}%{boldClose}%{italicClose}</font>"); what = strformat("</div> * <font color='green'>%{who} %{what}</font><div>")] 
I replaced the spans on the emote lines with font so that it displays properly outside MT, <span color="green"> works for MT (weirdly) but most versions of html in other programs now need it to be <span style="color:green">, but it's not essential (just for completeness and mimmicing MT).

Mal
Attachments
speakEasy.rptok
(62.64 KiB) Downloaded 100 times
Mal

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: SpeakForMe: Speak as a token without impersonating it

Post by Rumble »

Ah. That's odd - I'd just changed it from <font> to <span> as an attempt to solve the color problem. I'll change it back and see if it works.

Malekith
Giant
Posts: 245
Joined: Wed Jan 07, 2009 4:36 pm
Location: Gloucester, England
Contact:

Re: SpeakForMe: Speak as a token without impersonating it

Post by Malekith »

Yeah I see.
Well, I thought the color issue was fixed, or at least I know I know I fixed it on my end :lol:. I thought you were just moving to span to be more reliable/flexible and it just turned out that it created more confusion due to conflicting tags. span can still be used for other things and may be a better idea in future MT (if they change the default as they update the html version), but right now span color just confuses things xD AFAICT.

Mal
Mal

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: SpeakForMe: Speak as a token without impersonating it

Post by plothos »

Hey Rummy, I was just using what I think is the latest version (the token says 1.5) and I noticed that word wrap still isn't happening in the text entry field. I seem to remember you saying you either had or were going to enable that. Is it not happening?
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: SpeakForMe: Speak as a token without impersonating it

Post by Rumble »

plothos wrote:Hey Rummy, I was just using what I think is the latest version (the token says 1.5) and I noticed that word wrap still isn't happening in the text entry field. I seem to remember you saying you either had or were going to enable that. Is it not happening?
I just forgot - got working on my other frameworks. I'll see if I can make it happen.


Edit: it does not appear to be possible to do so. Or at least, I have no idea how to make it work.

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: SpeakForMe: Speak as a token without impersonating it

Post by plothos »

Alrighty. Thanks for looking into it.
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
Raoden
Dragon
Posts: 381
Joined: Fri Dec 18, 2009 2:33 am
Location: San Diego

Re: SpeakForMe: Speak as a token without impersonating it

Post by Raoden »

I've been messing around with some macros that try to force the output of SpeakForMe to display only for certain players; and I'm having trouble.

macroLinkText() commands that have a "target" parameter (which is the key to the whole fake impersonation of SpeakForMe) seem to ignore that "target" parameter if their "output" parameter is 'list'.

Is there any way to work around this?
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G. K. Chesterton

Wonderful HTML/CSS reference * Color Manager * Token Manager 2.0

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: SpeakForMe: Speak as a token without impersonating it

Post by Rumble »

Hey, Raoden, sorry I didn't respond earlier (I didn't see the updated thread!). Honestly, I don't know if you can work around it - I'll look at it, but I'm about to head to bed.

I'll check it out tomorrow; it may simply be a limitation of the system.

Post Reply

Return to “Drop-In Macro Resources”