How do I populate a UI element from an array?

Get help using Construct 2

Post » Thu Oct 08, 2015 8:06 am

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. :cry:

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:

Image

How would I go about doing this, do you think?
Last edited by Dingo on Sat Oct 10, 2015 4:58 am, edited 1 time in total.
B
11
S
2
Posts: 13
Reputation: 601

Post » Sat Oct 10, 2015 4:57 am

Here's what the two arrays look like:

Image

Sorry for double-posting...
B
11
S
2
Posts: 13
Reputation: 601


Return to How do I....?

Who is online

Users browsing this forum: Clark Thy Lord and 1 guest