How to: Simple Random-Result?

LordFleck

Villager
Member
Joined
Jun 12, 2013
Messages
9
Reaction score
0
First Language
English
Primarily Uses
I've spent... a lot of time looking for a simple Random-Result how-to guides? (A plugin would be super cool). It seems every time I find something, its about VXAce or about Random Battles. I found a perfect one on MV... but my luck, the guide was done using pictures... and the pictures were all broken links. Its obvious that my problem here is a full grasp of usage of "Variable", setting, tying them in, and accessing.

If someone could illustrate in steps how to carry out the following example, it would help a lot (learn my doing)...

Requested Example (Results/Goal):
Ingame: The player has choices on a menu. Lets say one of the choices is
-Explore

When you click on Explore, you get sent to a random map (1 out of 5 different maps). On the map (after reading a short story message popup), you automatically get one of 3 random items, in random quantities between 0-3.

(Which is really just two different uses of "random events" - ONE where a "menu choice" sends you to a random map. -TWO where an event gives you some random stuff.)

Thanks for any and all help!
 

SwiftSign

Veteran
Veteran
Joined
Aug 5, 2015
Messages
184
Reaction score
45
First Language
English
Primarily Uses
RMMV
Set a variable to a random number, then you can use it in script call. For example to add a random number of random items set var 1 to the item ID (1-3) and var 2 to the quantity (also 1-3) then script call. I've attached an image of the control variable part.

Script call example:
$gameParty.gainItem($dataItems[$gameVariables.value(1)], $gameVariables.value(2));
 

Attachments

Milennin

"With a bang and a boom!"
Veteran
Joined
Feb 7, 2013
Messages
2,511
Reaction score
1,642
First Language
English
Primarily Uses
RMMV
Go to control variable. Set variable random between 1-5.
Then, create a conditional branch that checks if that variable is equal to 1. If yes, set player teleport to map 1. If not, add a new conditional branch within that to check if it's equal to 2. Repeat those steps to cover all 5 outcomes.
After that, roll a random number in a variable again, and create new conditional branches to take into account all possible outcomes. Add in a random variable roll between 1-3 to set item quantity.

Honestly, the process is easy with basic knowledge of variables (look up a variable tutorial for beginners), but it'll become more tedious to set up, the more possible outcomes you want to create with it because it's just repeating the same thing over again, but with different values.
 

Mihe

Veteran
Veteran
Joined
Apr 16, 2014
Messages
193
Reaction score
71
First Language
English
Primarily Uses
RMMV
I've spent... a lot of time looking for a simple Random-Result how-to guides? (A plugin would be super cool). It seems every time I find something, its about VXAce or about Random Battles. I found a perfect one on MV... but my luck, the guide was done using pictures... and the pictures were all broken links. Its obvious that my problem here is a full grasp of usage of "Variable", setting, tying them in, and accessing.

If someone could illustrate in steps how to carry out the following example, it would help a lot (learn my doing)...

Requested Example (Results/Goal):
Ingame: The player has choices on a menu. Lets say one of the choices is
-Explore

When you click on Explore, you get sent to a random map (1 out of 5 different maps). On the map (after reading a short story message popup), you automatically get one of 3 random items, in random quantities between 0-3.

(Which is really just two different uses of "random events" - ONE where a "menu choice" sends you to a random map. -TWO where an event gives you some random stuff.)

Thanks for any and all help!
The process is the same, for your random events and menu choice. Here are some steps to follow:

Step 1: Make a new event. Open up the event commands and go to Control Variables.


Step 2:
Create a single variable and give it a name. A name isn't necessary, but it helps to keep track of your variables in my opinion.



Step 3:
Put the Operation to "Set" and put the Operand to "Random". You can now control the quantity of possible outcomes to happen. This means you will need to make an outcome for each value included between the two values you've inputted.



Step 4: Start a new line beneath your Control Variables command and click on Conditional Branch.


Step 5: Set your Conditional Branch to check a Variable. You shall have it check the previous Variable you've just created. Make sure to set the checking options to "=". This will help the Branch understand its condition.


Step 6: Make sure your Branch is further including a Constant value(s) in the option. This will help it recognize all of the random possible outcomes you've included.


Step 7: Look at Step 3 to see the amount of outcomes or values you've included. In that example, you've added values 1 through 6. That means that you will have to repeat Step 6 for each value you have included.


And there you go! You've setup an event that will randomly give you any of those 6 outcomes!

Here's an example:
 
Last edited:

LordFleck

Villager
Member
Joined
Jun 12, 2013
Messages
9
Reaction score
0
First Language
English
Primarily Uses
Thanks so much everyone! I've got a nice random flow of responses!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top