How do I randomize event locations (like hidden mimics on chests)

Hi there forum!


Right now Im working on an XP project, but this is a very general question  that might help many other people as well (and other specific forums are kinda slow sometimes), so please read:


Well as my first project got inspired by Driftwood tutorials to go for a dungeon crawler, so working on engaging puzzles and mechanics is very important to keep it fresh and replayable as a quick grab an play game. 


So I wanted to have a mechanic in which lets say as an example we have 5 chests throught the map, but I want 3 of them to drop items and 2 to be a mimic (classic) but I want to make sure the mimic locations are randomized, for replay factor. 


What do you think about it?


Thanks beforehand!
Decide an order for your chests (1 to 5) then set a variable value to be a random number between 1 and 5, After that randomize a second variable until the value you get is different from the one of you other variable. Now you have 5 numbered chests and 2 variables that indicate which chest number is a mimic. The only thing you have to do is to set up chest events to be mimic or chest.


Example:
Chest n #n is the chest number (between 1 and 5)
if (variable1 == n) || (variable2 == n)
  #mimic code here
else
  #chest code here
end


This works for almost everything and should work for XP as well.
That's exactly what I needed, you rule Heirukichi  BD
Just what i needed too!
Moving this to XP support.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-randomize-event-locations-like-hidden-mimics-on-chests.71217/