I think the title speaks for itself, but to clarify things, I want to know is it possible to make a variable value a random number from 0 to the value of another variable.
Let's assume that player in the game collecting special cards, and when he finds new card, variable that showing number of cards that he found, increases by 1.
And then in a specific event the game must show random card from his deck, so it must be random number from 0 to the final number of cards, that was found, and then many "if" conditions for each card to show it depending on random number.
Moreover, that system is bad because if the cards are just counts as +1 to a variable value, then the player must collect them in a strict sequence(if player will find 17 card after 15, then it will count as 16, so he can't break the sequence).
And because of that, ideally, i want to make a system, that will show random card from the one's, that he found and they can be found in any sequence. That would be just perfect.
Let's assume that player in the game collecting special cards, and when he finds new card, variable that showing number of cards that he found, increases by 1.
And then in a specific event the game must show random card from his deck, so it must be random number from 0 to the final number of cards, that was found, and then many "if" conditions for each card to show it depending on random number.
Moreover, that system is bad because if the cards are just counts as +1 to a variable value, then the player must collect them in a strict sequence(if player will find 17 card after 15, then it will count as 16, so he can't break the sequence).
And because of that, ideally, i want to make a system, that will show random card from the one's, that he found and they can be found in any sequence. That would be just perfect.