playMaker

Author Topic: Different behavior with break than without  (Read 1558 times)

Laralyn

  • Playmaker Newbie
  • *
  • Posts: 21
Different behavior with break than without
« on: August 01, 2013, 11:35:38 AM »
I have a simple loop that's part of a much more complex FSM. The loop in question, though, is isolated and at the end of the FSM's process, so I'm pretty sure nothing else in the FSM is affecting it.

The loop is:

State 1:
Set index

State 2:
Count entries in array
If index < (entries in array - 1) then proceed (if not, exit)

State 3:
ArrayListGet @ index (returns a game object)
Get name for the game object just returned
Send event to that game object (collapseMe)

State 4: index++ and loop back to state 2

If I execute this without a breakpoint, the first game object in the array does not receive the collapseMe event. If I set a breakpoint on State 3, the first game object DOES get the collapseMe.

I thought it might be a race condition, so I tried setting a Wait to test that, at the end of State 3. It still happened, even with the Wait.

What else could be causing this? I'm so close to getting this very complex (for me) FSM working and this is the last hang-up. :-)

Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Different behavior with break than without
« Reply #1 on: August 02, 2013, 09:44:45 AM »
Hi,

 you should use, ArrayGetNext action or ArrayGet Previous

have you tried with this?

bye,

 Jean