I've edited the post so it's a bit more succinct... I do tend to go overboard with my typing. Also I'm probably asking a bit much.
I'm currently trying to learn arrays for a mech game I'm creating. Each mech uses the same group of object types and gets all of their data in the form of stats, which animation to use, weapons etc from two global arrays.
I've got accessing arrays down, but I'm still a little fuzzy on looping through them. What I want to do is loop through a certain part of the mech array, which stores which weapons are in weapon slots, and determine how many non-zero entries I have in there (and resize a Weapon List UI element based on that), and then for each non-zero entry somehow create a new 'UI listing' with the weapon name, weapon cool down, weapon ammo etc. Kind of like this:
How would I go about doing this, do you think?