playMaker

Author Topic: Simultaneously sending same event multiple times to one target [SOLVED]  (Read 3272 times)

Demonocrat

  • Playmaker Newbie
  • *
  • Posts: 14
Hi!

I have a current situation:
I have FSM that create automatic "bounds" between objects.
Each "tick" object stores information about who connected to it, by receiving "connecting" event from objects on the scene.
Here is how it works http://take.ms/fGeKwb
I check gameobject that sent even in "remember enemy" and then assign/unassign it to slot 1, 2 or 3

The problem is that sometimes FSM fails to receive "Aimed At" event, I think its because they all sent by all aiming objects simultaneously.
But what is even more weird that sometimes it aims at itself, through there is no way object can send "aimed at" or "unaimed at" to itself. So because of that strange bug i had to add "SelfAimChek" state.

Adding delay to "send event" don't help since all enemies come from same prefab and get same delay in the end, so they send event simultaneously anyway.

Is there any way to fix this situation without completely rewriting logic?
« Last Edit: September 17, 2013, 02:32:39 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Simultaneously sending same event multiple times to one target
« Reply #1 on: September 16, 2013, 02:58:32 AM »
Hi,

 Have you been able to make progress on this? I am back tracking pending threads. If you still need help on this, let me know.

bye,

 Jean

Demonocrat

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Simultaneously sending same event multiple times to one target
« Reply #2 on: September 16, 2013, 05:02:22 AM »
Hi!
Well, i had to rewrite everything and create separate FSM that wents through all tagged game objects in the scene and set states in them one by one, instead of letting those object handle events themselfes...
So i still have no idea if there is a way to handle multiple inputs of same event in one FSM

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Simultaneously sending same event multiple times to one target
« Reply #3 on: September 16, 2013, 07:48:49 AM »
Hi,

 I think there is not way actually.

 What I would do is use arrayMaker, and each ennemy register itself against an array, and then your player can process that array by iterating through it.

 so, you have a GameObject that every ennemy knows, and they all know that there is an ArrayList in there, so each adds it's reference to that array. Then the player simply iterate through each gameobject in that list, knowing it's an ennemy and then can process them/ delete them as it goes through the list.

 does that make sense?

Bye,

 Jean

Demonocrat

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Simultaneously sending same event multiple times to one target
« Reply #4 on: September 16, 2013, 08:09:38 AM »
Hi!
Yeah, thats exactly what I did =)
So I guess problem solved then ))