How do I establish a range for "Set value at" in an array?

Get help using Construct 2

Post » Thu Dec 08, 2016 3:48 am

I am trying to zero out a specific range in my 3D array.

example: array> set value at (1,5,0) to 0

But instead of just the single Y5 location in the example, I want to set Y5 through Y20 to 0.
B
40
S
18
G
5
Posts: 98
Reputation: 5,651

Post » Thu Dec 08, 2016 7:41 am

Image

(1,5,0)=0
(1,6,0)=0
.
.
.
(1,19,0)=0
(1,20,0)=0
Image
B
65
S
23
G
7
Posts: 1,502
Reputation: 10,890

Post » Thu Dec 08, 2016 9:03 pm

Excellent!

Regarding two ranges at the same time is this correct?

Imagegif uploader
B
40
S
18
G
5
Posts: 98
Reputation: 5,651

Post » Fri Dec 09, 2016 12:40 am

For some reason the system doesn't allow me to use a global variable in addition to the 2 ranges as shown above.

When I try:
set value at (SelectedPlayer,loopindex("Players"),loopindex("Stats")) to 0
It does not work.

When I try:
set value at (8,loopindex("Players"),loopindex("Stats")) to 0
It does work.
B
40
S
18
G
5
Posts: 98
Reputation: 5,651

Post » Fri Dec 09, 2016 12:43 am

No reason that shouldn't work. Something else is wrong.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Post » Fri Dec 09, 2016 2:03 am

Ah, yes, something else was wrong. I was having the global variable reset too early.

Thank you
B
40
S
18
G
5
Posts: 98
Reputation: 5,651


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests