How do I refill an array

Get help using Construct 2

Post » Wed Feb 15, 2017 7:52 am

I have the following construction:

On a start of a lay-out, I fill an array with a few values.

Image

In the lay-out on a given moment, a value gets removed:

Image

When I restart the lay-out, I want the array is refilled/ reset. However, the values that where removed don't show up again in the array. How can i make this work?
B
7
S
1
Posts: 23
Reputation: 421

Post » Wed Feb 15, 2017 11:26 am

I've found the solution: I do need to set the size of the array on the start of the layout.
B
7
S
1
Posts: 23
Reputation: 421

Post » Wed Feb 15, 2017 2:07 pm

Bah, if you are happy with that.
But if you delete 2 values, you are stuck again.

So, since an array is Global by default, you can as well do this:

https://www.dropbox.com/s/xx5bc4fi186bv ... .capx?dl=0

Start with an empty one (by empty i mean, not even an index on X)
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 15, 2017 10:20 pm

@StudioGJ your problem is that "delete" is used to delete the entire array position, not to clear it. So if your array starts with 3 positions, after one delete it will have 2.
Use "Array -> Clear" instead.
Lead developer at Octeto Studios
Visit our portfolio at: http://www.octetostudios.com/ :)
Facebook || Twitter || Youtube
B
37
S
7
G
5
Posts: 217
Reputation: 5,614

Post » Thu Feb 16, 2017 9:16 pm

Ok, thanks for the tips guys! I will look into that.
B
7
S
1
Posts: 23
Reputation: 421


Return to How do I....?

Who is online

Users browsing this forum: dop2000, namaewayukidesu, Yahoo [Bot] and 9 guests