Best way to set the data of an array

Get help using Construct 2

Post » Tue Oct 15, 2013 9:09 pm

Can I have an example of the best way to set the data of an array?
B
9
S
3
G
1
Posts: 191
Reputation: 1,725

Post » Tue Oct 15, 2013 10:04 pm

Think we need a little more than that

What data do you want to store in the array, what is it's function, what is the game etc.

This might be a good place to start - https://www.scirra.com/tutorials/307/arrays-for-beginners

B
8
S
2
G
1
Posts: 45
Reputation: 1,007

Post » Tue Oct 15, 2013 10:39 pm

I guess just a simple two dimensional array of people and various descriptors, using the text object to display it, and maybe arrow keys to go up and down the list.
B
9
S
3
G
1
Posts: 191
Reputation: 1,725

Post » Thu Oct 17, 2013 1:49 am

I'm only asking since there doesn't seem to be many good .capx examples of arrays.
B
9
S
3
G
1
Posts: 191
Reputation: 1,725

Post » Thu Oct 17, 2013 2:09 am

Do you mean setting an array at runtime or edit-time?
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Thu Oct 17, 2013 3:30 am

I mean, setting up an array in the editor. I know I could set the data of the array cell by cell, but that doesn't seem... particularly good.
B
9
S
3
G
1
Posts: 191
Reputation: 1,725

Post » Thu Oct 17, 2013 5:21 am

You can't set values of an array in the editor. It has to be done at run time.
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,727

Post » Thu Oct 17, 2013 8:44 am

@ryackov

You could also have a text input box on the screen and use a 'Set at' array function. I am sure there is probably a way to import from an CSV file and dump it into an array - have a look round the forum.

Here is a quick and dirty example of an array with names using the up/down arrow keys to scroll through them

https://www.dropbox.com/s/v8ffs6n3fkw16pm/ArrayExample.capx

I am very new myself, so Imagine there is a better way of doing it sainsy2013-10-17 08:51:22
B
8
S
2
G
1
Posts: 45
Reputation: 1,007


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests