Hell, I just wanted to share this with everyone. Nothing to intense, but hope it helps with creating some fun events for people. This is taken from my
hub page.
.
In this tutorial you will learn how to make an event that outputs a random action. You will be able spawn a random monster and then have it drop a random item. More specifically this is for games that use visible monsters rather than step based encounters.
** This tutorial is for RPGMaker MV but can easily be translated to earlier versions of RPGMaker.
Random monsters visible in game
Things you will need
1 Event, 1 Variable, 2 monster troops
STEP 1
The first thing to do is create a variable. I named my variable "Random 1-100" for easy reference. Next create a new event. On the first event page you can setup up to 4 different options for the random selection. In this example I used a possible 3 options for the event to create.
10% chance of a healing fairy to spawn
45% chance of monster A
45% chance of monster B
The trigger for this page will be "parallel". This will cause the event to trigger as soon as the player enters the map. In the contents window add "Control Variables" with your newly created variable "set" to "random 1 ~ 100"
The next line will be a "conditional branch". Choose "variable" and then find your variable and use operand less than (<) with a constant of 11. We use 11 because the random number generated starts at 1 and we want a 10% chance, so less than 11 will utilize 1-10 out of 100. Before closing the dialog ensure to tick the "Create Else Branch" at the bottom so that we can add in the rest of the options for the random actions.
Now to set up the next area. Under the "else" section add another "conditional branch" and set it up in the same fashion except this time you will be setting the constant to 56. I choose this number because I want an equal chance of getting the 2 monsters so this will utilize 11-55 of the possible 100. Again ensure that you tick the box for "Create Else Branch". Close the dialog.
Now that we have set that up we will fill each of the branches with self switches. These switches will create one of three possible outcomes. The first one goes directly below the first "If" statement. Here you will add "control self switch A = ON" The next one will go directly below the second if statement "control self switch B = ON" and lastly directly below the second "Else" you will add "control self switch C = ON"
Refer to the image below to ensure yo have it setup correctly.
Step 2
Add a second event page. This will create a fairy that can heal your party. Under conditions tick "Self Switch A" I chose the stock image of a fairy located in the nature section. For the trigger I am using "action button". Feel free to set the movement up to your liking. I chose random for mine. Also don't forget to ensure that the priority is "same as characters" so that the player can actually activate it.
In the "Contents" add "Show Text" and type something to the your liking. Next, add "Recover All command". After that I have the fairy fade out. To make this I just add a set move route targeting this event. Add "change opacity" 50 then 100, 150, 200, and finally 255. This will make it seem to fade though keep in mind at this point the event technically still exists, it just can't be seen. Close the move route dialog and add commands to turn all of the self switches off followed by an erase event. This will return the event to its original state and then erase it. Keep in mind that events that are erased will reset each time you enter the map. This is intentional as in this example as I want the event to respawn each time you enter the map.
Refer to the image below.
Step 3
Now to setup the first monster. Add a third event page. Set the condition to "self switch B" find an image that matches the monster you want to use. I chose a slime for mine. Set the movement to approach and ensure that the priority is "Same as character" as well as the trigger to "player touch". This will make it so the monster moves toward the player. ** in order to trigger the battle without the player needing to move, you may need a plug in** for now the player will need to step onto the monsters tile to trigger the battle.
In the contents section add Battle Processing:"your troop here". I made a troop called Weak Blue Slime*2 for this example. The rest of the contents will happen after the battle takes place. Next add a "wait" of 30 frames followed by a fade out in the same fashion as the previous step. This time however, I want to set the event to face down so I add a 15 frame wait followed by a "set move route(this event):Turn down". Finally, I add "control self switch D: ON"
Refer to the image below.
Step 4
In this step we will copy and paste the previous event tab. We will only make a few small changes. First change the conditions to "self switch C". Next change the image to a new enemy for the second troop. Lastly, in the contents section chance the battle processing to reflect the second troop.
Refer to the image below.
Step 5
In this step we will create a treasure chest to drop after the monster is defeated. Remember in the last steps we set the event to face down? This is where that comes into play. When the treasure is spawned by the event you need to have the event already facing down otherwise the chest may be slightly open already. So lets get to it.
First, tick the condition to "self switch D". Image to a chest of your liking. Make sure that the only option that is ticked is "Direction Fixed". Next set the priority to "Same as characters" and trigger to "Action Button".
In "contents" add "Play SE:Chest1". Then to make the chest look like its opening add a "set move route(this event)" to direction fix off, turn left, wait 3, turn right, wait 3. After that we will make the treasure chest drop a random amount of gold. We will take the same idea from step 1. I want there to be a 20% chance to drop each of the amounts of gold. To do this first we will call the same variable from step one. Again we will create conditional branches nested within each other and set in increments of 20. Refer to the image below. After adding each of the branches, insert the wanted gold or items into each branch.
OPTIONAL: I used a plugin called Tiny_PopUpIcon to create a popup effect rather than having a text box appear each time. If you chose not to try that plugin make sure you add a text box corresponding to the item or gold amounts so that the player knows what they got.
After you finish setting the loot options set all of the "self switches" to off and "erase" the event. Make sure this is after all of the conditional branches.
Refer to the images below.

See all 7 photos
Pin ItSee all 7 photos
Thanks for checking out this tutorial. Feel free to expand and try these ideas in other parts of
RPGMakerMV.
Some of the ideas come from the
Variables Guide created by
Celianna.
本贴来自国际rpgmaker官方论坛作者:xadder处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/randomized-event-based-actions.54224/