playMaker

Author Topic: Array Get Next issue[SOLVED]  (Read 446 times)

Zombeh

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Array Get Next issue[SOLVED]
« on: September 18, 2019, 01:53:13 AM »
I've been having some issues with Array Get Next.  In the context of this image, I've got another FSM that updates the units inside a trigger to an array using an "on enter/exit".  This FSM then gets the info from that array and is supposed to check the units in it against 2 other arrays (blufor and opfor) to get a true/false as to whether those units are inside the trigger.  If blufor is detected it ticks down an HP bar per second, if both are detected it is supposed to just basically loop every second until they aren't.

Now as far as I can tell, everything within the whole FSM works properly.  The main array is updated properly, the 2 arrays to check against are populated.  Even the first full check sequence seems to work properly, properly tagging both the blufor and opfor objects as being present.  The second go around one second later seems to be the issue, where the result variable within both of the Array Get Nexts stays on the second element in the array.  I'd read up that this was an issue with needing to use the reset flag, but it seems to have no effect.  That include both the regular Array Get Next and Array Get Next 2, with reset flags properly swapping to true.

I feel like I'm missing something simple, but does anyone have any ideas on what could be the issue?

Thanks!  Here's a link to the image of the Playmaker window.  Don't mind the transition naming, unless that somehow is the problem.

https://imgur.com/3wTSBtM
« Last Edit: September 18, 2019, 04:54:13 PM by djaydino »

Athin

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Array Get Next issue
« Reply #1 on: September 18, 2019, 02:49:29 AM »
Heya,

So this is a bit hard to follow but to me, it sounds like you aren't resetting the Get Next properly.  Keep in mind that anytime the get next action plays, it sets that reset flag to false (That trip me up quite a bit when I started using it) so you only want to set it to true once you are done your search or starting again.  If you are using the same flag for multiple get next actions then they could be resetting one and not the other (May be the problem you have?)

The picture isn't too much help unless we can see each state and actions in them.

Zombeh

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Array Get Next issue
« Reply #2 on: September 18, 2019, 03:23:11 AM »
Here's a compilation picture with all the states involved.  Might be a bit hard to read the transitions since Imgur didn't seem to like it's size or something.  I also cut the "blufor" section of the Array Get Next out of the main loop to test, since the "opfor" currently always ends up as the element 0, so I can easily see that it's not resetting from element 1 (only 2 elements in this scene currently), and thus not reflagging the opfor boolean as true.

You'll also see that it says reset flag isn't marked, that's just because I forgot to swap it back on for the screen shots, while I was testing bool reset states in different parts of the FSM.  No matter where I've reset, or even without having reset on, it all seems to work exactly the same.  One run works fine, but second time around it never resets.

Here's the new link:

https://imgur.com/9PhaIVy

Zombeh

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Array Get Next issue
« Reply #3 on: September 18, 2019, 04:40:11 AM »
Well no idea what the issue was with that previous version, but I made a new more in-depth one that works without trying to rely on Array Get Next to set the bool.

Thanks for the help!