Foen
May 30th, 2009, 07:26
Sounds like a trivial question, and I'm sure it is something simple that I've overlooked, but how can I send a simple number to the chat window using addMessage or deliverMessage and a message data object?
The documented message data fields are text, sender, mood, font and icon, in addition to which I have also used diemodifier and dice. Diemodifier can be used to add an adjustment to a die roll, so setting diemodifier to 4 and dice to {"d6"} rolls 1d6+4 in the chat window.
If diemodifier is set to a number (other than zero) and dice is set to an empty list, I almost get what I want but the number is displayed in the chat window with a question mark next to it (see the last entry in the attached thumbnail) whereas a dragged number value doesn't display such a question mark. Also this method doesn't work if the number value is zero.
There must be an internal mechanism to do this, as you can drag a number directly to the chat window (rather than using addMessage or deliverMessage) and it doesn't display the question mark and it also allows a zero value to be displayed.
Typing "/die 0 test" also works, but I'm stumped as to how this can be achieved using addMessage or deliverMessage.
Finally, I have also tried intercepting in incoming number values using onReceiveMessage and iterating over the fields in the message table. The only fields which are present are text, font and sender. There are no numeric fields at all.
Anyone else get this to work?
Stuart
The documented message data fields are text, sender, mood, font and icon, in addition to which I have also used diemodifier and dice. Diemodifier can be used to add an adjustment to a die roll, so setting diemodifier to 4 and dice to {"d6"} rolls 1d6+4 in the chat window.
If diemodifier is set to a number (other than zero) and dice is set to an empty list, I almost get what I want but the number is displayed in the chat window with a question mark next to it (see the last entry in the attached thumbnail) whereas a dragged number value doesn't display such a question mark. Also this method doesn't work if the number value is zero.
There must be an internal mechanism to do this, as you can drag a number directly to the chat window (rather than using addMessage or deliverMessage) and it doesn't display the question mark and it also allows a zero value to be displayed.
Typing "/die 0 test" also works, but I'm stumped as to how this can be achieved using addMessage or deliverMessage.
Finally, I have also tried intercepting in incoming number values using onReceiveMessage and iterating over the fields in the message table. The only fields which are present are text, font and sender. There are no numeric fields at all.
Anyone else get this to work?
Stuart