PDA

View Full Version : deliverOOBMessage, dicetower



Fenloh
August 3rd, 2011, 11:30
Hi,

how exactly does the deliverOOBMessage work?

Due to the Edgeroll feature some data must be changed, once the Roll has commenced. It works fine, if the Dicetower ist not used, since the dicetower returns the rSource as nil.

To fix this i have added msgOOB.custom=rSource to the message, that is deliverd via Comm.deliverOOBMessage(msgOOB,""); but i just could not follow up an that.

The next step that i found was in the manager.oob processOOBMessage, but the variable used there is only msg and it is also without the custom part that i have added.

I need to return the rSource from the dicetower, that is why i tried it via that way.

Fenloh

Moon Wizard
August 3rd, 2011, 12:07
The deliverOOBMessage and onReceiveOOBMessage functions work very similar to their deliverMessage and onReceiveMessage counterparts.

There are 2 main differences:
* Messages sent using the deliverMessage function that are not handled by the ruleset will be treated as chat messages.
* Messages sent using deliverMessage support a very specific set of attributes (text, sender, mode, ...), while messages sent using deliverOOBMessage will support any number of attributes as long as they are strings (or numbers which will be converted to strings).

So, given the 2nd point above, you will not be able to pass in the rSource object, since it is a table object. You can try passing rSource.sType, rSource.sCTNode and rSource.sCreatureNode fields as attributes of your OOB message, and then rebuilding the actor record on the receiver side. I used this technique in the 3.5E ruleset in a function called onCastSave in manager_action_spell.lua.

Regards,
JPG

Fenloh
August 3rd, 2011, 13:38
Works fantastic,

many thanks,

fenloh