So I would like to know how to randomize something to get when you click a category. Example: I click potions. The person randomly gives me Potion, Hi-Potion or Full Potion. How do I do this?
Randomize
RPG Maker VXAce SupportControl Variables - Random Number combined with Conditional Branches.
Does making each item have a different rate require a script? I want it to make the rarer items harder to get.
Nope, just requires mathematics. Figure out what the percent chance you want it to be for each item, then set up the control variable based on that.
Example. Say I want a 50% chance of getting a Potion, a 30% chance of getting a Hi Potion, and a 20% chance of getting an Elixir. 50 + 30 + 20 = 100, so I set the control variable to be a random number between 1 - 100. Then, if it is <= 50, I give the party a potion, if it is between 51 and 70, I give the party a Hi Potion, and if it is > 70% I give the party an Elixir.
You'll need nested conditional branches to pull it off (the between 51 and 70 requires one for >= 51 and a second one for <= 70), but it will work.
Example. Say I want a 50% chance of getting a Potion, a 30% chance of getting a Hi Potion, and a 20% chance of getting an Elixir. 50 + 30 + 20 = 100, so I set the control variable to be a random number between 1 - 100. Then, if it is <= 50, I give the party a potion, if it is between 51 and 70, I give the party a Hi Potion, and if it is > 70% I give the party an Elixir.
You'll need nested conditional branches to pull it off (the between 51 and 70 requires one for >= 51 and a second one for <= 70), but it will work.
Omg never thought of that! Thanks!
How do you make a conditional branch that is if variable is x-y, do this?
Original thread: https://forums.rpgmakerweb.com/threads/randomize.61449/