playMaker

Author Topic: Generic message to event broker[SOLVED]  (Read 8761 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Generic message to event broker[SOLVED]
« 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


« Last Edit: December 22, 2014, 03:52:30 AM by jeanfabre »

Sjones

  • Full Member
  • ***
  • Posts: 203
Re: Generic message to event broker
« Reply #1 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Generic message to event broker
« Reply #2 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

Sarus

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Generic message to event broker
« Reply #3 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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Generic message to event broker
« Reply #4 on: February 28, 2013, 12:19:27 PM »
Hi,

 thanks for the correction :) always appreciated!

bye,

 Jean

theBrandonWu

  • Playmaker Newbie
  • *
  • Posts: 18
    • Studio Pepwuper
Re: Generic message to event broker
« Reply #5 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
Studio Pepwuper: http://www.pepwuper.com
One Month Game School (now on SkillShare): https://www.skillshare.com/r/user/thebrandonwu

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Generic message to event broker
« Reply #6 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

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Generic message to event broker
« Reply #7 on: May 25, 2014, 12:12:08 PM »
Problem was caused by wrong message. So it sin't solved in the last version.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Generic message to event broker
« Reply #8 on: May 26, 2014, 09:02:05 AM »
Hi,

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

bye,

 Jean

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Generic message to event broker
« Reply #9 on: December 21, 2014, 10:24:40 AM »
It's ok.

bigrip

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Generic message to event broker[SOLVED]
« Reply #10 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Generic message to event broker[SOLVED]
« Reply #11 on: April 07, 2017, 09:36:35 AM »
Hi,

 It looks like you don't have PlayMaker installed.

 Bye,

Jean