playMaker

Author Topic: "Get Event Sent by" problem  (Read 4278 times)

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
"Get Event Sent by" problem
« on: January 27, 2019, 08:22:38 AM »
I have serious problems with Get event sent by, or get event info.

Most of the times calling a global event that has any of those two actions the first, got properly the game object who fired the event from, so the callback to them is working after the global event has finished.... but sometimes, it gets totally wrong the game object who actually fires it, as it can be something totally unrelated that never ever is calling this global event.

I have use set event data as well as set event info for the guy who is calling the event, but no luck.

Why sometimes they got totally wrong GameObjects that are actually NOT calling this event?

Right now, the event is called by a UI button game object that I needed to create a trigger event on the inspector to know when it has been highlighted or not, as "uGuiOnSelectEvent"  is not working.

http://hutonggames.com/playmakerforum/index.php?topic=10356.0

So after that this trigger fires (select/deselect) the "get event sent by" im talking about will always got the button as the game object who fired it, and its totally unrelated.


miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: "Get Event Sent by" problem
« Reply #1 on: January 27, 2019, 09:16:19 AM »
Confirming that the "Event Trigger (Script)" on the inspector is totally messing up my "get event sent by" action.

Again, the game object that has this trigger event script is non related to the Game Object that has action "get event" on a global event and its never calling this global event EVER.

I have fixed it by Enable and Disable behavior on the "Event Trigger (Script)" but its kinda weird that has to be done like this. Doesn't seems like the best solution for it.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4005
  • Official Playmaker Support
    • LinkedIn
Re: "Get Event Sent by" problem
« Reply #2 on: January 27, 2019, 01:00:32 PM »
What version of Unity/Playmaker are you using?
Are you using the built-in UI events and actions or the uGUI addon?

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: "Get Event Sent by" problem
« Reply #3 on: January 27, 2019, 01:07:13 PM »
Confirming now that simply doesnt work
Event trigger event doesnt have anything to do with it.

So this remains the same: A UI button is forcing a "get event sent by" of another game object. Only happens when I interact with this button (highlighting it or pressing it).

After that, any "get event sent by" action on ANY game object will be triggered by this UI button.

Any ideas?

Im using latest playmaker / 2018.2 and yes, official Ugui actions.


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4005
  • Official Playmaker Support
    • LinkedIn
Re: "Get Event Sent by" problem
« Reply #4 on: January 27, 2019, 01:18:35 PM »
Double checking that when you say official uGUI actions you mean the built-in ones NOT the downloadable add-on. UI events and actions were integrated in 1.9.0 and you should use the add-on only if you need some extra functionality it provides. Checking so I can try to repro with the same setup you have...

If you can PM me a project that demonstrates the issue it would be very helpful.

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: "Get Event Sent by" problem
« Reply #5 on: January 27, 2019, 01:21:25 PM »
How can I be sure?
I have the Ugui proxy downloaded from the ecosystem I think.
I can share my SVN project.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4005
  • Official Playmaker Support
    • LinkedIn
Re: "Get Event Sent by" problem
« Reply #6 on: January 27, 2019, 01:37:19 PM »
Since 1.9.0 you don't need the Ugui proxy anymore.
Is this an older project that you started with an older version of PlayMaker?

Please PM about sharing the project.

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: "Get Event Sent by" problem
« Reply #7 on: January 27, 2019, 02:16:22 PM »
Yes, its a 1,5 years project.
Im now on latest PM.

How can i delete the old actions from the ecosystem?
Ill PM you as well

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4005
  • Official Playmaker Support
    • LinkedIn
Re: "Get Event Sent by" problem
« Reply #8 on: January 27, 2019, 02:42:24 PM »
Since it's an old project I wouldn't delete the old actions - you would have to rename a lot of events and swap out actions. The integration was designed to work side by side with the old system for this reason. I mainly wanted to know so I could reproduce the same issue on my end... but if you can PM me a project that's even better!

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: "Get Event Sent by" problem
« Reply #9 on: January 27, 2019, 03:13:30 PM »
Btw, the issue is not repro using a controller. Only when the mouse is highlighting the buttons UI.

Just sent you an EXE file link while working on sending you the SVN.

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: "Get Event Sent by" problem
« Reply #10 on: February 03, 2019, 02:34:54 PM »
Any chances to replicate this?

EpicMcDude

  • Junior Playmaker
  • **
  • Posts: 58
Re: "Get Event Sent by" problem
« Reply #11 on: October 24, 2024, 01:09:39 PM »
5 years later I'm having this issue. "Get Event Sent By" will catch the correct object only if I don't activate my pause menu Canvas.

If I click ESC to pause the game and bring up the Pause Menu, then this action will always get the first UI button on that canvas, regardless of who is sending the event.

Any way to fix this?

EDIT: Removing any FSM reference, such as an FSM Component and an Event from On Click to another FSM from the UI button will prevent this from happening. But of course this is not a fix or a usable workaround since it means removing button logic.
« Last Edit: October 24, 2024, 01:55:15 PM by EpicMcDude »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15552
  • Official Playmaker Support
Re: "Get Event Sent by" problem
« Reply #12 on: October 25, 2024, 04:29:01 AM »
Hi,

The issue is that by the time you check, another event was sent.

The solution is to defer the event using "next frame event". I would add next frame event on non critical events such as the one emerging from a UI setup, so before you decide to implement a next frame event, make sure you know both events that are in conflict and take some time to think about the best way to add a frame delay, which one would be more likely to be fine with a delay basically.

I do that very often, especially as your UI and content gets more and more interlinked, you end up often with loops between content and UI so that both are refreshed and reflect the proper application state, on these scenario, having a proper delay sequence is essential. I sometimes even use IOS event system paradigm where I will send an event saying "GOING TO DO THIS" then and event "I AM DOING THIS" and then and event "I HAVE DONE THIS", which lets everything else catch up, and act properly on what's going to happen. A
 frame delay between these 3 phase of an action is helpful. The added benefit is that you can have another part of your app interfere and cancel THIS or else do something before THIS is done, etc etc.

If that doesn't help, can you explain in details the event you are sending and the one that gets detected instead?

Bye,

Jean


EpicMcDude

  • Junior Playmaker
  • **
  • Posts: 58
Re: "Get Event Sent by" problem
« Reply #13 on: October 28, 2024, 10:31:44 AM »
Interesting, thanks for the additional insight!

In case of my event, it's a simple damage event from an NPC to the Player - I was testing with only 1 NPC where they damage the player and it sends the "Damage" event and the Player has the "Get Event Sent By" action to know which attacker it was.

It works greats, it gets the correct Object and the FSM that sent the event, up until I bring up the Pause Canvas, then the action stops working and even after many "Damage" events are sent, the "Get Event Sent By" action will only ever have for example my "Continue" button.
If I delete the "Continue" button from my Pause Canvas, then the action will get the next child button and so on.

Deleting any FSM related component will stop the "Get Event Sent By" action from being 'hijacked' by the UI buttons. When the UI Button is incorrectly shown as the event sender, no FSM information is displayed, it's always blank.

I was having a similar issue with Get/Set Event Properties, but using the "Set FSM Game Object" action fixes this issue. It seems setting or getting the explicit game object works better than any other event information actions.