playMaker

Author Topic: non-global Global Events  (Read 2715 times)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 296
    • View Profile
non-global Global Events
« on: March 13, 2015, 03:26:29 PM »
A ways back in the lifetime of this tool it was changed so that any Events sent between FSMs had to be Global.  Recently a colleague discovered that Send Event By Name could still be used to send any Event from one FSM to another without it being marked as Global.  Have I been misunderstanding this whole time the use of these Actions and nature of Global Events, or what's going on here exactly?

redikann

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: non-global Global Events
« Reply #1 on: March 14, 2015, 09:05:57 AM »
There is a State machine Send Event which can actually pinpoint Game objects And FSM within in them and then send to a specific local event. So say you have a local event 'Jump' and you use it as a Global transition(appearing above the state) but it's not Global. Within that state it can act like a global but outside FSMs cant cause it to fire unless something like the Send Event is used.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: non-global Global Events
« Reply #2 on: March 14, 2015, 09:40:56 AM »
Global events are recognized in the editor, so you can connect them in actions from an intuitive dropdown, and the names are updated everywhere if you rename them.

Send by name does not have those advantages, but is always available. This is a common way of sending events from scripts.

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 296
    • View Profile
Re: non-global Global Events
« Reply #3 on: March 15, 2015, 01:29:28 PM »
I may not have described my question well enough.

I understand how Send Event and related states work.  However the current functionality contradicts the documentation:
https://hutonggames.fogbugz.com/default.asp?W834

"NOTE: Events must be marked Global to send between FSMs."

Currently it's possible to send non-global events between FSMs via Send Event By Name.  So what happened?  Is the documentation wrong?  Did the Send Event restrictions change? 

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: non-global Global Events
« Reply #4 on: March 15, 2015, 01:32:30 PM »
Maybe it's just unclear, but you do need to set them to global for them to be used in that manner. Otherwise you must fire them by name.

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 296
    • View Profile
Re: non-global Global Events
« Reply #5 on: March 15, 2015, 02:41:53 PM »
Maybe it's just unclear, but you do need to set them to global for them to be used in that manner. Otherwise you must fire them by name.

Could you elaborate on what's unclear to you?  I am sending non-global events between FSMs using Send Event By Action.  This is demonstrably operating in exactly the way the documentation is saying it should not. 

I've actually been using PlayMaker since 2011, so I remember when the Global Event limitation was implemented, (when global Events themselves were introduced), and this was not possible at the time. 

Either this is a bug with Send Event By Name, a unique function or caveat that is not properly documented, or something else.  I'm hoping Alex or Jean can shed some light on the intended functionality.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3618
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: non-global Global Events
« Reply #6 on: March 15, 2015, 06:16:53 PM »
The global flag is more of an organizational/UI thing. It lets the editor limit the events you see in selection menus based on the context. Otherwise you would have to select from all the events in your project when sending events between FSMs.

Quote
"NOTE: Events must be marked Global to send between FSMs."

This could be worded better. Events must be marked as global so you can select them when sending events between FSMs. But there's nothing technically limiting their delivery (e.g., if you use Send Event By Name).

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 296
    • View Profile
Re: non-global Global Events
« Reply #7 on: March 16, 2015, 05:09:02 PM »
Thanks Alex!