I am not the computer i made it with. As i recall. There is a path layed out in the layout. Your question was, how do i writes those steps down in an array. So far you are with me. After that i destroyed all the footsteps, so they dont occupy memory, and its not needed to do complicated pickactions to find that one footstep.
So, now they ONLY exist in the array. Thats the real meaning of the array. At this point there are no steps in the field (steps.count=0-
Then, when there are no steps in the field (steps.count = 0), its creates a step with the first values of the array, AND it deletes that first value of the array. So the next step in the array becomes the first step, ready for the next move. Now steps.count = 1 (one step in the field), so this condition will not be true as long as that step exists.
When the player arrives on the destination of a step (pathfinding arrived) , that step gets destoyed. Now steps.count is a again zero. Now it starts all over. And it creates a new step according the array.
Thats a perfect and very very easy flow. No variables for a state, no extra checking conditions.
And, dont forget, because i destroyd all steps, and because it works with just one step, no complicated conditions to pick the next step out of to many.