Randomize

DogeWorm

That Insomniac
Veteran
Joined
Apr 30, 2016
Messages
68
Reaction score
3
First Language
English
Primarily Uses
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?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,969
Reaction score
13,603
First Language
English
Primarily Uses
RMMV
Control Variables - Random Number combined with Conditional Branches.
 

DogeWorm

That Insomniac
Veteran
Joined
Apr 30, 2016
Messages
68
Reaction score
3
First Language
English
Primarily Uses
Does making each item have a different rate require a script? I want it to make the rarer items harder to get.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,431
Reaction score
14,167
First Language
English
Primarily Uses
RMVXA
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.
 

DogeWorm

That Insomniac
Veteran
Joined
Apr 30, 2016
Messages
68
Reaction score
3
First Language
English
Primarily Uses
Omg never thought of that! Thanks!
 

DogeWorm

That Insomniac
Veteran
Joined
Apr 30, 2016
Messages
68
Reaction score
3
First Language
English
Primarily Uses
How do you make a conditional branch that is if variable is x-y, do this?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts



I've been experimenting with improved memory management again, which allowed me to include items to increase player path length. These are both 44 grid spaces long, and stable. :LZSexcite:
I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!
Stream will be live shortly! I am going to be playing some Among Us! Feel free to drop by!
Ami
tv program always get the ratings (it's the reason why drama series has 1000+ episode),also full and nonsense of censorship (weird blur, a scene getting cut because the unconvenient viewer,but it unconvenient to me either. you never see what the original is)

i know the reason is to take cover the viewer from the negative thing,but i just laughing and mocking of them that they're always suck :guffaw:
Star Chart Idea - Just something I am working on.

Forum statistics

Threads
104,460
Messages
1,006,442
Members
135,966
Latest member
Kleik
Top