How do I stop the random array from repeating

Get help using Construct 2

Post » Fri Apr 24, 2015 11:24 am

Hi Guys ,

Im working on this Trivia game template ( it is not mine i just found it in the examples).
In the template, the questions sometimes repeat after each other ( it is random ) . For example question 5 can show up two times in a row or even 4 times in that specific time span.

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

I added Array_____> Delete "random_number" from X, each time the questions are asked but what it does is that it will make the question disappear from the array but it will keep the blank question showing up.

Can someone plz help on this, How can i stop the questions from repeating ?

thanks
B
8
Posts: 12
Reputation: 330

Post » Fri Apr 24, 2015 11:33 am

When deleting one of the index, you should resize the array as well to reflect the fact that this index is gone.
So resize to array.width - 1 should make it work.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Fri Apr 24, 2015 12:38 pm

Kyatric wrote:When deleting one of the index, you should resize the array as well to reflect the fact that this index is gone.
So resize to array.width - 1 should make it work.


Thanks Kyatric for ur help, much appreciated .

I did try it but the same thing happens, maybe im doing it wrong or i didnt get what u meant. I will post a screenshot of it. sry im still a noob.

Image
B
8
Posts: 12
Reputation: 330

Post » Fri Apr 24, 2015 1:23 pm

NUMBER OF _QUESTIONS .....isn't constant..in your case... so unchek that ...

Image


capx:
http://s000.tinyupload.com/index.php?fi ... 9716080569
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Fri Apr 24, 2015 2:25 pm

korbaach wrote:NUMBER OF _QUESTIONS .....isn't constant..in your case... so unchek that ...


There you have it, thank u very much for ur time and help korbaach.
it was the only thing that i didnt think of. Here you can see the different of a pro with a noob

thanks again
B
8
Posts: 12
Reputation: 330


Return to How do I....?

Who is online

Users browsing this forum: Ryan Kocourek and 21 guests