# Does anyone has converted smart random plugin ??

For discussion and help with the Construct 3 Plugin SDK

### » Fri Aug 04, 2017 2:54 am

Does anyone has converted smart random plugin ??
B
77
S
45
G
49
Posts: 713
Reputation: 35,493

### » Fri Aug 04, 2017 4:40 am

B
71
S
22
G
274
Posts: 3,828
Reputation: 151,299

### » Fri Aug 04, 2017 4:49 am

blackhornet wrote:http://www.blackhornettechnologies.com/Construct3Stuff/C3plugins/bht_smart_random_1000.zip
Sorry, keep meaning to formalize my converted plugins.

HI @blackhornet
Today i have used smart plugin very first time and it really great to use
Thanks for this plugin
Now it also for construct 3, Amazing !
.
I want to ask 1 thing
I want to do random from 1-7
but only want to random 2-6
1 number should always come in 1st and 7 should be last
How can i do this
B
77
S
45
G
49
Posts: 713
Reputation: 35,493

### » Fri Aug 04, 2017 5:00 am

I'd suggest using a second array, where you place the two fixed values yourself, and copy the random values in-between.
B
71
S
22
G
274
Posts: 3,828
Reputation: 151,299

### » Fri Aug 04, 2017 5:14 am

blackhornet wrote:I'd suggest using a second array, where you place the two fixed values yourself, and copy the random values in-between.

second array ?
means i have to use a array plugin for that
I am using this in Global variables
I have 2 global variable
Frames & Appear
when frame >7 it revert to 0 and
when frame >7 then Appear do random (only values between 1-7)
B
77
S
45
G
49
Posts: 713
Reputation: 35,493

### » Fri Aug 04, 2017 5:45 am

Sorry, I consider the smart random to be the first array, since it uses an array internally, but I guess you can juggle the the logic to keep an index - on index=1, use value 1, on indices 2-6 use smart random, on index=7, use value 7. Seems clumsy compared to an array, but if you are determined to not use an array, that will work. I would put this in a function myself.
B
71
S
22
G
274
Posts: 3,828
Reputation: 151,299

### » Fri Aug 04, 2017 6:43 am

blackhornet wrote:Sorry, I consider the smart random to be the first array, since it uses an array internally, but I guess you can juggle the the logic to keep an index - on index=1, use value 1, on indices 2-6 use smart random, on index=7, use value 7. Seems clumsy compared to an array, but if you are determined to not use an array, that will work. I would put this in a function myself.

you mean
i make a variable = Index
when index = 1 set "Appear" variable to 1
when index = 2 set "Appear" variable to "Smart random"
when index = 3 set "Appear" variable to 7
if yes
then how to stay on index value 2 while 2 is playing 5 times
B
77
S
45
G
49
Posts: 713
Reputation: 35,493

### » Fri Aug 04, 2017 1:08 pm

No, when index is 2,3,4,5,6, set variable to 'smart random', when index=7, set variable to 7. In otherwords index >=2 AND index <=6...
B
71
S
22
G
274
Posts: 3,828
Reputation: 151,299

### » Fri Aug 04, 2017 2:05 pm

B
33
S
18
G
29
Posts: 2,493
Reputation: 21,450

### » Sat Aug 05, 2017 5:39 am

blackhornet wrote:No, when index is 2,3,4,5,6, set variable to 'smart random', when index=7, set variable to 7. In otherwords index >=2 AND index <=6...

I am getting repeated number using smart random

what i did is >
make 2 variable Index & Appear
each click add 1 to index

Smart random values
Start = 2
End = 6
Repeat Threshold

when Index = 1 >>>> set appear to 1
when Index > 1 & index < 7 >>>> set appear to BHTSmartRandom.Next
when Index = 7 >>>> set appear to 7

I am getting repeated numbers between 2-6
B
77
S
45
G
49
Posts: 713
Reputation: 35,493

Next