Picking random number without repeating (4 different attributes)
Hello to GS Community,
I would like to ask you:
I have 4 global attributes called A B C D. A has value of 1(real), B 2, C 3, D 4. That is the default. On a specific occasion, they should change their value random(1,4) but I do not want them to repeat ( A 2, B 3, C 1, D 1 is repeating) or in other words to make 1,2,3,4 in a random way. How to do that?
Thank you
Comments
This could help:

http://www.arcaderz.com
Or you can use a Table with 4 rows ( values from 1 to 4 )
row 1 = 1,
row 2 = 2,
row 3 = 3,
row 4 = 4;
pick a random number :
random(1,tableRowCount(yourTable)) -> let's say the random number is : 2;
remove the row number 2 (row 2) , using the Add/Remove Row behaviour:
The new table:
row 1 = 1,
row 2 = 3,
row 3 = 4,
and so on.
http://www.arcaderz.com
I believe I also did a tutorial on how to achieve this (except using tables). I think you can find it in my community tutorial thread - since it uses tables, you can pick from the equation and use what you need to make it work for your game.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Okay here is the link to a template @tatiang made then just pick four rows to assign to your attributes. I used it to do what you are after that way.
http://forums.gamesalad.com/discussion/53553/demo-randomize-table-rows#latest
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Thank you @jeezzcake that indeed helped.
I have made the same thing as @jeezzcake suggested but I want to make it a twist:
Every 10 successful moves (game.success) to change the numbers. I tried to add rows once game.success%10 but it doesnt seem to work.
Any ideas, guys?
If you want to repeat the random process, you have to create a default table with 4 rows and the working table(same as the default table), from which you remove the randomly chosen rows.
Then every 10 successful move copy the default table into your working table.
Now you have the 4 rows table to work with again.
http://www.arcaderz.com
I do these with tables with the rows as randomized: ie. 1,3,4,2 etc. - then you just randomly pick the row value. I use this a lot for sets of 10 for example.
This might be useful:
http://forums.gamesalad.com/discussion/comment/476096/#Comment_476096