I'll just create a new thread and go over my entire process. Hopefully it will help others out (including myself!) This is partially based on Jeans explanation in another thread (that I can't find at the moment for some reason).
Preperation:
I'm trying to create a Highscore table. I have a game-manager object with two Array Lists on it; 'scores', and 'names'. For the purpose of testing, I've prefilled both Arrays with 10 names and Integers.
I have a second GUI object with an FSM on it that's responsible for only displaying the highscores. It is disabled by default and is only enabled when the user clicks the Highscores guiButton.
Lastly, I have a Prefab of NGUI UILabels that are used to display the highscores when the list is generated.
States:
In state1 I copy the ArrayList contents of 'scores' from index 0 with a count of 10 to the ArrayList 'sorted'.
In state2 I use the ArrayList Sort action to order them.
From there I go into a series of looping states, beginning with a "lookUp" state with an ArrayListGetNext action. Starting Index is 0 which is set by an Int Var that gets incremented after each loop, and the End Index is 9. This is where I encounter the first bug, as the ArrayListGetNext action shows this error:
The fsmVar value <System.Single> doesn't match the value <System.Int32>
I'm not sure what to make of that.
Ideally that state would deliver the current index score of the 'sorted' ArrayList. In the following state I use an ArrayList Index Of action to find the matching value in the original 'scores' ArrayList, and store its Index in another Int variable. This is where I see the second error:
gui_highscores : FSM_highscore : findPlayer : ArrayListIndexOf : start index and count out of range
The ArrayList Index Of action has a starting Index of 0, and a Count of 10. I am not sure why this occurs either.
Ideally it should pick up the index for the matching value in 'scores', and then use ArrayListGet action to get the String data from the same index in the 'names' ArrayList, and store it in a String variable.
So now my "highscore" FSM has stored copies of the first name and score from the original Arrays, so moving on to the next state, I use an Ngui Tools Add Child action to instantiate my highscore gui Prefab beneath the GUI's UIGrid children, and then after doing the appropriate type conversions and build string actions, I use the Ngui Set Text action to display the name and score data in the prefab.
After this the FSM loops back to my "lookUp" state to get the next index value in the 'sorted' ArrayList, and repeat the steps.
I've had a number of hiccups that mystify me, but currently the two above errors are the persistent ones. Can anyone explain these?
I am using Unity 3.5.7 and the latest version of both PlayMaker and ArrayMaker.