PDA

View Full Version : deliverMessage



Grimmbart
January 16th, 2010, 22:29
Hi.

With the function "function deliverMessage( messagedata, recipient ) ",
i want to send the message only to the GM.

How can i do that ?

Foen
January 16th, 2010, 22:34
You should pass the empty string ("") as the second parameter, I think ;)

Foen

Grimmbart
January 16th, 2010, 22:37
With the "" parameter, nobody receive the message !!

Grimmbart
January 16th, 2010, 22:41
Wonderful !!

Now it's OK :
I use deliverMessage when message is for everybody, and addMessage when it's only for the GM.

Foen
January 16th, 2010, 23:17
Sorry, you are quite right: sorry about that!

Foen
January 16th, 2010, 23:23
Hang on, that isn't right - doesn't addMessage just send it to yourself?

Foen

Ikael
January 17th, 2010, 10:11
the addMessage will only send the message to one who calls it. I think there is no way to actually send message to only GM. Of course you can use the ChatManager.deliverMessage(messagedata, ""), which will send the message to GM, but it will lose some content of the message such as the icon, dicelist etc. By the way, is this a bug or what?

I hope there would be feature in future where players could easily send complete messages to only GM.

Tarostar
January 27th, 2010, 18:10
As I found out in my quest to change how die results were logged in the chat history, see this thread (https://www.fantasygrounds.com/forums/showthread.php?p=84336#post84336), you can deliver messages to only the GM.

The trick is to use addMessage when the User.isHost() and ChatManager.deliverMessage(message, "") otherwise. See the thread for the actual code snippet.

Cheers!