PDA

View Full Version : Structured messages



Ken L
September 23rd, 2016, 22:07
Is there a way through the Comm module to send structured messages?

By this I mean to have a similar level of control comparable to fomattedText control. Currently it seems to be as malleable as a normal string with the added bonus of being able to attach a number of icon resources.

My use case is to present nicely formatted output to the text chat using the limited tools available in formatted text controls like speed bubbles, description bubbles, tables, etc...

There is the cryptic deliberOOBMessage, but little documentation regarding its usage or format.

https://www.fantasygrounds.com/refdoc/Comm.xcp#deliverOOBMessage

Moon Wizard
September 24th, 2016, 00:41
Comm.deliverOOBMessage accepts a Lua table, and saves of the key/value pairs as strings. This table of string keys and values is passed to each client according to the recipients list (from host), or to the host (from client).

The Comm.onReceiveOOBMessage handler function registered will receive a single variable which is the table string keys and values.

You can use this to pass any arbitrary string key/value pair information between client and host.

Regards,
JPG

Ken L
September 24th, 2016, 03:42
So I take it there really is no way to format normal chat messages (such as using chat bubbles etc..)

Moon Wizard
September 24th, 2016, 09:40
The deliverChatMessage should allow you to send chat-specific messages.

Regards,
JPG

Ken L
September 25th, 2016, 05:24
This is related to the mood string? I can't find a reference as to what they entail.

I assume there's a 'mood' for each of the chat output flavors.

Moon Wizard
September 25th, 2016, 05:38
It's a combination of the mode string defined for the message, ...
https://www.fantasygrounds.com/refdoc/Comm.xcp

...and the mode frame defined in the ruleset.
https://www.fantasygrounds.com/refdoc/chatwindow.xcp

In CoreRPG, there are frames defined for "chat" and "story" modes. All other modes are output directly without a frame.

Regards,
JPG

Ken L
September 25th, 2016, 17:56
Ah, now that is interesting, so you could actually create your own modes, but it bellies on having a custom rule-set,. what is the mood string for then? The only thing I can think of is the scene moods.

Trenloe
September 25th, 2016, 18:02
https://www.fantasygrounds.com/wiki/index.php/Chat_Window#Moods