OK i'm making a game with lots and lots of chests and one feature I want it to have is so that nearly any chest in the game has a random chance of being a mimic instead while still giving the items it was intended to give you upon defeat. Is this possible to pull off and if so, how do I do it?
Random chance of a chest being a mimic? How to do?
RPG Maker MV SupportWith a random chance variable and a conditional branch.
In the chest event, make a Control Variable command, set random number between what you want the chance for a Mimic to be (example: between 1 - 10)
Then make a Conditional Branch set to the Variable with the generated random number, and set it to whatever number you want to be for the chest to result in a battle (example: if Variable = 1), and create an else branch.
In the first result of the branch (Variable = 1), set a battle encounter.
In the other result of the branch (Else), set loot that the player would get.
Doing that would give the chest a 1 in 10 chance of resulting in a battle with a Mimic.
In the chest event, make a Control Variable command, set random number between what you want the chance for a Mimic to be (example: between 1 - 10)
Then make a Conditional Branch set to the Variable with the generated random number, and set it to whatever number you want to be for the chest to result in a battle (example: if Variable = 1), and create an else branch.
In the first result of the branch (Variable = 1), set a battle encounter.
In the other result of the branch (Else), set loot that the player would get.
Doing that would give the chest a 1 in 10 chance of resulting in a battle with a Mimic.
In this instance, would the loot set in (Else) still come up at the end of the fight, or would it just be the generic loot set for the Mimic encounter? I'm still a noob when it comes to eventing scripts, but I think that only solves half of the problem...
Sorry for the spanish on the program. Pay attention on the Comments (Green).
Also, if you got any doubt, ask again please.
Because you set the conditional branch for the variable to the value of the valuable, meaning it's always true. In the conditional branch for the variable, you need to set the constant to 1, instead of choosing the same variable.
No, it takes one or the other.
Well I got the thing working, but now I have another question. I want the event to be erased off the map in the event of a mimic battle. I remember you could do this easily in VX Ace, but the Erase Event event appears to be absent in MV.
Can it still be done? Because simply setting the chest to be transparent does not allow that spot to be passable.
Can it still be done? Because simply setting the chest to be transparent does not allow that spot to be passable.
Erase event is on the second page, under "Character".
Create a 2nd page under the condition of Self Switch A and erase its graphics and make sure it appears below characters.
Then, on the 1st page, turn Self Switch A on after the Mimic battle.
Then, on the 1st page, turn Self Switch A on after the Mimic battle.
Thank you for the help. I now have it working exactly the way I want it to. ^^
If every chest has a chance to be a mimic, you should create a common event for this. Put all of the code (the recommendations above are good) into a common event instead of putting it directly into the chest events. Then in each chest event, you want to use the Call Common Event command to run the Mimic common event. The purpose of doing it this way (as opposed to copying the same code onto every single chest event) is that if you decide to change something later you can change it in one place and it will instantly update for all chests instead of having to go through your entire game replacing the code on every single event.
Original thread: https://forums.rpgmakerweb.com/threads/random-chance-of-a-chest-being-a-mimic-how-to-do.46991/
