How do I get a working random/shuffled card system?

Get help using Construct 2

Post » Mon Oct 03, 2016 1:16 am

That makes a lot of sense when you put it like that, I will look more into this thankyou.
B
7
S
2
G
1
Posts: 28
Reputation: 881

Post » Tue Mar 14, 2017 7:19 am

how do i keep the card from repeating???
the random function sometimes picks up a prior value.
B
20
S
7
G
5
Posts: 16
Reputation: 3,908

Post » Tue Mar 14, 2017 1:45 pm

You can use this to get an array of unique numbers: plugin-smart-random_t163624
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Mar 16, 2017 6:36 am

thank you for the response.
I just started Construct 2.
So I'm at scratch,,, is there any capx file for reference??

I don't know how to input the array values to BHTSmartRandom
B
20
S
7
G
5
Posts: 16
Reputation: 3,908

Post » Thu Mar 16, 2017 6:47 am

I don't have a card example, but you don't input the values, it will generate them for you. Give a range of 1 to 52, for example, and decode the cards from there. Or, use it four times for each suit from 1 to 13.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Mar 16, 2017 6:55 am

thanks again for a quick reply..

Just gonna try both the method you just said..
Still have a query though,,, do we need an array?
B
20
S
7
G
5
Posts: 16
Reputation: 3,908

Post » Thu Mar 16, 2017 6:59 am

Yes, you need to pull the values out one by one into your own array.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Mar 16, 2017 7:19 am

https://mega.nz/#!VZNVgC6C!PPO8Z_E__Hlt ... lxDr8Z_Yso


This is what I've done but the value gets repeated
B
20
S
7
G
5
Posts: 16
Reputation: 3,908

Post » Thu Mar 16, 2017 2:06 pm

It's hard to tell what's going on in a screen shot. Can you post what you have so far?
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Mar 16, 2017 2:40 pm

@rah: You can also check the How do I FAQ and see there are some examples on the subject :

Obtain non-repeating numbers from a fixed set - LINK

Obtain random numbers without repeat - LINK

Another way to obtain random numbers without repeat (lottery like) - LINK

Randomize an array without duplicates/repeat numbers - LINK
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests