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
12
S
2
Posts: 83
Reputation: 1,051

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
72
S
22
G
290
Posts: 3,884
Reputation: 159,509

Post » Tue Sep 15, 2015 10:19 pm

I didn't know that, thank you. Didn't fix the issue though
B
12
S
2
Posts: 83
Reputation: 1,051

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,519
Reputation: 11,104

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
12
S
2
Posts: 83
Reputation: 1,051

Post » Wed Sep 16, 2015 7:50 pm

bump
B
12
S
2
Posts: 83
Reputation: 1,051


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests