playMaker

Author Topic: Sending events with data attached partial fail to received [SOLVED]  (Read 1472 times)

Shuohigh

  • Playmaker Newbie
  • *
  • Posts: 3
I have some fsm attached to same gameobject, where a "master" fsm controlling other fsms by sending events with event data attached.

My current problem is : When master fsm sent out 2 events to "laser rotation" fsm and "laser movement" as show in the attachment pics, only "laser rotation" received event. I've also tried reverse the event sending order, it seems regardless of the fsm type (rotation or movement) the first event will never be received.

Am I missing something here? How could this be solved?



SOLVED : Issue is causing by accessing one FsmArray object in different actions at the same time. After assign a copy of the original object and let them use the copy, problem is solved.
« Last Edit: August 14, 2017, 06:52:44 AM by Shuohigh »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi,
The actions you use are these "RunFSM" can you show how you have set them up?

maybe you set a finshed event to them, if so it will finish right on the 1st one and the others are not triggered.
if so try setting the finished to none if you have a "Finish Transition" it will still go to the next state but after all are done.

If you use a different transition name place that one on the last action (in this case)

Also i would not recommend the change the action names, use the description and state name / color for clarity

or name them like this : Run Fsm - my comment

Shuohigh

  • Playmaker Newbie
  • *
  • Posts: 3
Thanks for the reply!

I've screenshot the source code of action "Laser Rotation Run Next", all other actions are doing the same thing only using different data type.

My goal here is trying to have some fsms running parallel and will notify the master fsm when it done its current job. Then the master fsm will send the next job to it and tell it to start doing that.

All "jobs" are store in an FsmArray of customized Unity.Object type. Master fsm will only finish, said "Laser Rotation Run Next" for example, that action when there is no more job(job of type rotation) for it.

As I understand from timeline log output, only the first event sent will not be received. All others is running as I expecting to be.

Also I've try manually trigger that "Laser : Rotation Run Next" event in "Laser Rotation" fsm. It seems all data is arrival just fine, only problem is that event could not trigger that global transition form "OnWaitting" to start doing job.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Sending events with data attached partial fail to received [SOLVED]
« Reply #3 on: August 14, 2017, 08:25:21 PM »
Hi,
Did you make these actions?
or are they from an asset?
I can't recognize them

what i can see is (on the states image) that OnWaiting is not a Global Transition
also i think you might need to turn on sequence (right click in the state window and select Action Sequence)
else the sending event from both actions (laser rotation and laser movement) might be send simultaneously.

Also be sure you are not sending 2 different event @ the same time to an FSM.
That won't work, because an FSM can be only on 1 state at a time.

Shuohigh

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Sending events with data attached partial fail to received [SOLVED]
« Reply #4 on: August 14, 2017, 09:56:41 PM »
Thanks for the reply.

Yes, they are actions made by me. I've got it working as expected.
I want to have both actions send out event simultaneously, and they are targeting different PlaymakerFSM components so it is fine.

Thanks for the help anyway.