#Random Card Selection

1 messages · Page 1 of 1 (latest)

halcyon temple
#

After every wave, I want them to give 4 random cards. Right now, I'm working on the part where no card is a copy of the others in the deck. How can I do this?

dry fulcrum
#

As i dont bother to really read scripts unless theres an actual error within it

halcyon temple
dry fulcrum
halcyon temple
#

idk why i didnt think of that, ill try it

dry fulcrum
halcyon temple
#

the screenshot shows a function thats meant to pick a different card until it finds one that isn't already in the lineup

#

so if card 1 is A, card 2 will flip through the possible cards until it finds one that isnt A

dry fulcrum
# halcyon temple so if card 1 is A, card 2 will flip through the possible cards until it finds on...

Ok so basically still the same solution! ^^
Let's say a candidate is picked called "Card A" in the 2nd slot or any slots above one, as Its impossible for the first slot to be a clone.

First:
Once a card has been picked i assume you call the function to check if its a clone

Second:
Check if the card if the card matches with anything in the slots table,

Third:
If it doesnt pass, use a repeat to repeat picking cards until its not the same card as in other slots

Else just put it inside of the card slots table with just its name, and slot number

#

Although my answer isnt entirely accurate to the actual solution, depending on how you code it in... Butttt.... this is just a good example on how you can fix it Doublethumbs

#

But i also don't trust myself so oh well!

#

Just make sure you’re not endlessly re-rolling, it’s usually safer to remove picked cards from the pool so duplicates can’t happen at all.

halcyon temple
dry fulcrum
#

No problem! Glad i could help 'v'

halcyon temple
#

update it worked, thank you p() you are the funny chin beard 🙏

dry fulcrum
#

Glad you got it working! :D