How to pick random from a table without getting duplicates
Epsilon94
LondonMember, PRO Posts: 8
I've made a table containing 50 different words. I have 6 different text fields that fetches a random word from the table.
Here's what I can't figure out:
1. How to pick a random word from the table without getting duplicates within the other 5 fields.
2. How to make it pick every word except for a specified one, make it pick from the 49 not specified.
Thanks in advance.
Here's what I can't figure out:
1. How to pick a random word from the table without getting duplicates within the other 5 fields.
2. How to make it pick every word except for a specified one, make it pick from the 49 not specified.
Thanks in advance.
Comments
I don't quite get your idea, could you please elaborate?
I solved my first question with the copy table behaviour then delete the one that is being displayed. I do however still have some problems / questions :
How can I make it so that one specific word gets displayed randomly in a different actor every time the level starts?
Ex:
I have 6 actors fetching data from the table, each time this specific level gets reset (try again) I need a predetermined word to appear on a new actor.
This way you can't just reset the scene and get the highscore by spamming the same button now that you know where the answer is.
Thanks.
In each word display actor, have When attribute self.myPosition=game.wordPosition --> Display Text or Change Image or however you want to display the word.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks @tatiang
I'm still having problems with "duplicates". It looks like the row that gets picked won't be deleted properly. My table does not have to be saved between different sessions, do I still have to use the copy table behaviour?