playMaker

Author Topic: ArrayMaker Send Event does not seem to repeat  (Read 1353 times)

stain2319

  • Playmaker Newbie
  • *
  • Posts: 9
ArrayMaker Send Event does not seem to repeat
« on: May 03, 2020, 03:14:45 PM »
Hopefully I can explain this well.

So I have about 10 game objects which I want to react to an event sent when an item is added to an array.

Essentially when the event is received it takes some action to update some other variables.

It seems to only run once, the first time I add any item to an array, but not again after that.

I can see in the Playmaker editor that the loop on each object is triggered 1 time when I first add an item to the array.   But on adding subsequent items it does not run again, as if the event is not being sent each time.

Example:

My array:



As you can see I expect the "item_added" event to be sent whenever something gets added.

Here is one of the objects I have which has a watcher that simply sits there and has the item_added event on it:



Now in Play mode I add one item to the inventory array and it runs one time as we can see:



Note that if I inspect the other 10 items with the same FSM on them I can see that all of them show this "1" which is expected, as I expect all the objects to react to the item_added event.

The item got added as we can see:



So I add the next item to the array and it is also successful:



However the loop number does not change, showing that item_added doesn't seem to be getting triggered again, and whatever action is supposed to be taken is not taken.



Am I missing something obvious?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: ArrayMaker Send Event does not seem to repeat
« Reply #1 on: May 04, 2020, 07:22:23 AM »
Hi.
Due to not using Global events, its possible that the event is not triggered if the current state is not on the 'Wait For Inventory Update'

So if something would be added to the array and the current active state is for example 'Wait'. the event can not be triggered

Here is a video about global events :


May i ask whats the wait used for?

BUT

After some testing i did notice that Remove Event is not triggered at all.
(add and set are sending events correctly)

Also State Loop Counts seems to be broken (tested on 1.9.0p19 and p20)
i simply made a loop with a wait (state 1 wait 1 sec, state 2, go back to state 1)
and it only set to 1 not higher.

I will Ping Jean to have a look at it.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: ArrayMaker Send Event does not seem to repeat
« Reply #2 on: May 04, 2020, 02:39:20 PM »
Hi.
Alex just mailed me and the State Loop Counts is actually not broken.

it shows the loop count in a single frame, not the total loop.

He did also mention that its a good idea to add a total loop on a state, so we might see that on a next update.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: ArrayMaker Send Event does not seem to repeat
« Reply #3 on: May 05, 2020, 03:15:57 AM »
Hi,

 it works here, I think your problem is that your event transition is not global so if when the proxy sends the Add event, your listening fsm is not on the state with the transition event, then it won't be triggered. that's by design, if a global transition is a regular state transition, that state must be active for the transition to occur, else promote that transition to global, then the current active state doesn't matter and you will catch that global event always.

Bye,

 Jean

stain2319

  • Playmaker Newbie
  • *
  • Posts: 9
Re: ArrayMaker Send Event does not seem to repeat
« Reply #4 on: May 06, 2020, 01:52:45 PM »
Thanks! That helped.  The wait states were mostly for debugging purposes as "placeholders" for real actions.  I ended up using global events and then also just adding a "send event" action to some of my states where needed which seems overall more reliable than the array-based events (or maybe that part is my imagination.)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: ArrayMaker Send Event does not seem to repeat
« Reply #5 on: May 06, 2020, 02:07:36 PM »
Hi.
The Disable event is confirmed not to work, it will be fixed asap.

The other events are working and should work fine :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: ArrayMaker Send Event does not seem to repeat
« Reply #6 on: May 13, 2020, 03:05:47 AM »
Hi,

 yes, remove events are not plugged, I'll see if I can implement that finally, but that might be tricky... I'll see how I can go about it.

Bye,

 Jean