Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started 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
-
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?
-
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
-
Hi Jean,
Just started using PlayMaker and found this script quite helpful. However, I think your instructions have a typo.
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.
-
Hi,
thanks for the correction :) always appreciated!
bye,
Jean
-
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
-
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
-
Problem was caused by wrong message. So it sin't solved in the last version.
-
Hi,
sorry, does that means it's ok or it's not?
bye,
Jean
-
It's ok.
-
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?
-
Hi,
It looks like you don't have PlayMaker installed.
Bye,
Jean