Help with creating odds of getting certain prizes in a lottery

I'm using RPG Maker VXAce and I'm trying to create a lottery draw where there are 12 items the player can win: 4 common items, 4 uncommon items, and 4 rare items. I want to make it so there is a 70% chance to get a common item, 20% chance to get an uncommon item, and 10% chance to get a rare item.
I thought I'll be able to do it with Control Variable - choosing Random Numbers 1-100 and Conditional Branches, but there seems to be no way to get all three options working (there is Equal, Less, Greater, combinations of these three options, and Not Equal).
Is there a way to get it to work WITHOUT scripting (with only events, variables, and switches)?
then you're doing things wrong - this should be easy with events.
however we can't tell you what you did wrong without a screenshot of your event...

best guess? you ignored the order of the conditional branches
You only need r40. If you are using r100 as a baseline and it's an integer that the player sees, you'll have to do it a different way.


1
2
3
4
5-6
7-8
9-10
11-12
13-19
20-26
27-33
34-40
Hmmm, isn't it easier to just make first page:

variable 1 to random number 1-10
self switch A ON
if variable 1 > 7
-> self switch B ON
if variable 1 > 9
-> self switch C ON

then in your pages A, B & C (common, uncommon, rare) you roll between 1-4 and decide the items and turn off the self switches
Cough. GemRoulette ACE. Cough.
Hey,

Some more detail on the general approach:

If you want common items to have a 70% chance, you would select 70 of the outcomes of your 1-100 roll to result in a common item (the easiest option would probably be to select outcomes 1-70, or 1 to whatever your chance is).
For the 20% uncommon items, you would then select 20 more outcomes for that (since outcomes 1-70 are already taken, they would probably be 71-90, with rare items occupying 91-100)

Usually you can check if a variable is within a certain range by using two nested "Conditional Branches", one checking if your variable is greater/equal to the minimum value, and one checking if it is less/equal to the maximum value.
For the 1-70 case you don't have to check the lower bound, since the variable could not have rolled a number below 1:
Code:
Control Variables: #0011 Dice = Random 1..100
Conditional Branch: Dice <= 70
    Comment: 1-70: Common Item was selected.
 
Else:
    Conditional Branch: Dice <= 90
        Comment: 71-90: Uncommon Item was selected.
                 (Rolls below 71 were already filtered by the last Branch)
 
    Else:
        Comment: No further Conditional Branch needed for the 91-100 case.
                 (Rare Item was selected.)
      
    Branch End
Branch End
To then roll for the individual item options, you can either further break down your 1-100 roll or make a new roll.

Either way, good luck with your project.
First of all, Thank You to everyone, I didn't expect such quick replies.
And:
Hey,

Some more detail on the general approach:

If you want common items to have a 70% chance, you would select 70 of the outcomes of your 1-100 roll to result in a common item (the easiest option would probably be to select outcomes 1-70, or 1 to whatever your chance is).
For the 20% uncommon items, you would then select 20 more outcomes for that (since outcomes 1-70 are already taken, they would probably be 71-90, with rare items occupying 91-100)

Usually you can check if a variable is within a certain range by using two nested "Conditional Branches", one checking if your variable is greater/equal to the minimum value, and one checking if it is less/equal to the maximum value.
For the 1-70 case you don't have to check the lower bound, since the variable could not have rolled a number below 1:
Code:
Control Variables: #0011 Dice = Random 1..100
Conditional Branch: Dice <= 70
Comment: 1-70: Common Item was selected.

Else:
Conditional Branch: Dice <= 90
Comment: 71-90: Uncommon Item was selected.
(Rolls below 71 were already filtered by the last Branch)

Else:
Comment: No further Conditional Branch needed for the 91-100 case.
(Rare Item was selected.)

Branch End
Branch End
To then roll for the individual item options, you can either further break down your 1-100 roll or make a new roll.

Either way, good luck with your project.
Thank you very much, this solved my problem.
This thread is being closed due to being report as solved. If you need it reopened, let us know. Thank you!~

Original thread: https://forums.rpgmakerweb.com/threads/help-with-creating-odds-of-getting-certain-prizes-in-a-lottery.168501/