playMaker

Author Topic: Array List Get Next Issue [SOLVED]  (Read 1447 times)

Athin

  • Full Member
  • ***
  • Posts: 163
Array List Get Next Issue [SOLVED]
« on: August 26, 2018, 04:26:56 AM »
Hey all,

I've been having this issue with this action and I'm hoping I can find some help here.

What I have is 5 inactive buttons on my screen all in an Array.  When I select a unit,I have an Array List Get Next action to grab the first button.  Right below that action is a simple check if its activated or not.  If not the action repeats until an inactive button is found. I have everything working correctly but one issue I can't solve.  Every time I select and deselect a unit, the next time I select them again the second button activates rather then the first again.  This continues to the third and forth button as I select and deselect the units.

I found a Reset setting on the get next action and tried setting that to true to force it to start from the beginning of the array again but it just doesn't seem to work.

Does anyone have any ideas what I'm doing wrong?

Thanks

« Last Edit: August 28, 2018, 05:38:37 AM by Athin »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array List Get Next Issue
« Reply #1 on: August 26, 2018, 09:20:37 AM »
Hi.
With 'get next actions' you should do things in the next state.
its not good to do things below the action.

for the reset :
you need to use a variable there and if you want to reset, you should set that variable to 'True' Before reaching the action.

what reset does is :
Each time the action is activate it will check if the 'reset' variable is true before continuing the action.

If 'true' then the action is reset and the variable is set to false so that when it loops back it is not reset again.

if you wish to reset the action again you will need to set the variable to 'true' again
(by using 'Set Bool Value' for example)

So if you set it manually it will actually reset once and never again.
(if it loops thru all items it will automatically reset tho)

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Array List Get Next Issue
« Reply #2 on: August 28, 2018, 05:38:22 AM »
Hey Djaydino,

Thanks for the help with that.  I didn't realize that the flag for the reset changed to false after it gets used.  That was my problem!

Thanks so much!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array List Get Next Issue [SOLVED]
« Reply #3 on: August 28, 2018, 06:03:15 AM »
Hi.
No Problem, Happy to help :)