Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on October 17, 2012, 03:34:28 AM

Title: Generic message to event broker[SOLVED]
Post by: jeanfabre on October 17, 2012, 03:34:28 AM
Hi,

 So many frameworks are relying on sending messages that I thought I would make a simple broker so that you can send a message to this broker prefab and turn it into a PlayMaker event.

example, in nGui/EZGUI and other similar tools, for a given button or interactive component, set the "Event receiver" to this broker gameObject, send the message "messageBroker" exactly

in the PlayMakerMessageBroker, set up the "PlaymakerMessageBroker" component to point to a Fsm ( or not of you want broadcast the event) and define the name of the event.

 This way, you have a generic way to turn any message based framework or component into a playmaker event.You will need one PlaymakerMessageBroker gameObject per message. I suggest you rename the PlaymakerMessageBroker gameObject name to something meaningful for convenience, but not mandatory.


bye,

 Jean


Title: Re: Generic message to event broker
Post by: Sjones on October 19, 2012, 05:39:38 PM
thanks for the action jean, however I can not get it to work, I tried with the ngui interaction example scene to set a standard UI text to a specified string.

I have added the playmaker message broker object to the scene, I then drag and drop that object into the event receiver and put the "PlayMakerMessageBroker" string in the call when finished.

specifically I have put this on the UIButton tween script of the UI button in that scene.

When I could not get it to work I added a sendevent In the broker objects fsm to make sure that playmaker was setup correctly, this indeed did work so my guess is that there is an issue with setting it up, any ideas?
Title: Re: Generic message to event broker
Post by: jeanfabre on October 22, 2012, 03:22:42 AM
Hi,

 ok, please find example 2 of ngui with this broker in place.

 it will fire a "SHOW" event to an fsm placed in the camera.

 run, press "SHOW" and you will see that it calls the "SHOW" event in the camera fsm.

 warning: you need ngui and the message broker already, this package attached is just the scene.

bye,

 Jean
Title: Re: Generic message to event broker
Post by: Sarus on February 28, 2013, 09:18:37 AM
Hi Jean,

Just started using PlayMaker and found this script quite helpful.  However,  I think your instructions have a typo.

Quote
example, in nGui/EZGUI and other similar tools, for a given button or interactive component, set the "Event receiver" to this broker gameObject, send the message "PlayMakerMessageBroker" exactly

In looking at the script, you actually need to send the message "messageBroker" instead of "PlayMakerMessageBroker".  Once I changed this it works fine.

Just posted this here in case other folks were having issues when following the directions verbatim.
Title: Re: Generic message to event broker
Post by: jeanfabre on February 28, 2013, 12:19:27 PM
Hi,

 thanks for the correction :) always appreciated!

bye,

 Jean
Title: Re: Generic message to event broker
Post by: theBrandonWu on March 01, 2013, 09:14:14 PM
Thanks for the awesome tool! Updated the description in the prefab to avoid future confusions - I know I'll be coming back to this thread in the future ;p
Title: Re: Generic message to event broker
Post by: Gua on May 24, 2014, 07:17:03 PM
Thanks for the awesome tool! Updated the description in the prefab to avoid future confusions - I know I'll be coming back to this thread in the future ;p
Didn't work for me
Title: Re: Generic message to event broker
Post by: Gua on May 25, 2014, 12:12:08 PM
Problem was caused by wrong message. So it sin't solved in the last version.
Title: Re: Generic message to event broker
Post by: jeanfabre on May 26, 2014, 09:02:05 AM
Hi,

 sorry, does that means it's ok or it's not?

bye,

 Jean
Title: Re: Generic message to event broker
Post by: Gua on December 21, 2014, 10:24:40 AM
It's ok.
Title: Re: Generic message to event broker[SOLVED]
Post by: bigrip on April 07, 2017, 08:33:38 AM
hi
i have somer errors when i import .need some help

Assets/PlayMaker Custom Tools/Messaging/PlaymakerMessageBroker.cs(4,7): error CS0246: The type or namespace name `HutongGames' could not be found. Are you missing an assembly reference?

Assets/PlayMaker Custom Tools/Messaging/PlaymakerMessageBroker.cs(8,9): error CS0246: The type or namespace name `PlayMakerFSM' could not be found. Are you missing an assembly reference?

Assets/PlayMaker Custom Tools/Messaging/PlaymakerMessageBroker.cs(11,10): error CS0246: The type or namespace name `PlayMakerFSM' could not be found. Are you missing an assembly reference?
Title: Re: Generic message to event broker[SOLVED]
Post by: jeanfabre on April 07, 2017, 09:36:35 AM
Hi,

 It looks like you don't have PlayMaker installed.

 Bye,

Jean