Loopindex - independent pick problem

Get help using Construct 2

Post » Tue Sep 15, 2015 9:47 pm

I've been running this program to watch for errors and I found that gFalse2 will sometimes have the value 0, while gFalse1 will have the data meant for gFalse2 which leads me to believe there is something wrong at line 15 because it is skipping the first interval of the loop and putting data only in the second. variable.

The array holds data like this [Answer,Question,FalseChoice1,...,FalseChoice5]
Image link in case this one is cut off http://i.imgur.com/4veqeFo.png
Image


I'm trying to figure out a better way to randomly pick the second variable (gFalse2) so that it is not the same as gFalse1, what can I learn from this and how might I correct it?
Last edited by Centra on Wed Sep 16, 2015 5:33 pm, edited 1 time in total.
B
10
S
2
Posts: 80
Reputation: 995

Post » Tue Sep 15, 2015 9:55 pm

loopindex works when you don't specify any name, so For "" from 0 to 1 OR since you gave it a name, you should be using: loopindex("setFalseChoicesLoop").
ImageImageImage
B
71
S
22
G
247
Posts: 3,756
Reputation: 137,558

Post » Tue Sep 15, 2015 10:19 pm

I didn't know that, thank you. Didn't fix the issue though
B
10
S
2
Posts: 80
Reputation: 995

Post » Tue Sep 15, 2015 10:57 pm

just a thought...add another Array :D

example.capx
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Tue Sep 15, 2015 11:34 pm

it occurred to me but I'd prefer to keep it all in one array if possible. I'd also like to understand what's causing the problem exactly
B
10
S
2
Posts: 80
Reputation: 995

Post » Wed Sep 16, 2015 7:50 pm

bump
B
10
S
2
Posts: 80
Reputation: 995


Return to How do I....?

Who is online

Users browsing this forum: TRMG and 11 guests