playMaker

Author Topic: Get Next Child pointer does not increase?  (Read 1886 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Get Next Child pointer does not increase?
« on: August 28, 2023, 02:29:17 PM »
For some reason Get Next Child is not getting the following child.
I got it working before, but now for some reason it stopped.

This is my setup:

1. I get the first child by using Get Next Child.
2. I enable the first CP (ChekcPoint), CP_00.
3. At this point I have CP_00 which when activated gets called with the CP_Triggered global event. The global event gets called, I see it each time, that is working fine, but the Get Next Child just does not proceed adding 1 to the index. I should get CP_01, but it just doesn't change anything.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Get Next Child pointer does not increase?
« Reply #1 on: August 29, 2023, 10:37:36 AM »
Hi.
It looks like there is no transition looping back to the state with the 'Get Next' Action

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Get Next Child pointer does not increase?
« Reply #2 on: August 29, 2023, 11:35:18 AM »
Hi.
It looks like there is no transition looping back to the state with the 'Get Next' Action

So the variable pertains to a single state, it's not one for the FSM.
When I switch to another state, it's a different variable.

TiaRenner

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Get Next Child pointer does not increase?
« Reply #3 on: September 15, 2023, 08:11:21 AM »
Same here.

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Get Next Child pointer does not increase?
« Reply #4 on: September 15, 2023, 11:47:54 AM »
Same here.

The counter variable seems limited at the single state.
So if you do a Get Next Child in a state and then move away, and do another Get Next Child in another state, that Get Next Child will start from the beginning again, and you will have 2 variables of Get Next Child.
I may be wrong, I didn't check it, but intuitively, I think this is how it works.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Get Next Child pointer does not increase?
« Reply #5 on: September 15, 2023, 05:18:50 PM »
Hi.
If you have a "Get Next" in state 1 and a "Get Next" in state 2
They work independent from each other.
Its best to play around a bit with them so you can see.

If you want to reset the loop you can also use the 'Reset' (set the bool to true, and trigger the state with the Get Next action, the action it self will the start from the beginning again and will set that bool to false)

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Get Next Child pointer does not increase?
« Reply #6 on: September 15, 2023, 08:22:06 PM »