Mouse-catching Minigame

So for my Warriors game, I thought it made sense to have a hunting minigame. I just need to know how to execute it.

Basically we have a mouse appear on the map and run away from the player. If the player touches the mouse, it disappears; the number of mice "caught" is remembered and displayed somewhere.
Sounds easy enough to set up actually, I have all but the counting system already done in one of my projects.

The counting would kinda lose me unless it was done as "add 1 mouse-tail item to inventory" or some such. I'm not very good with variables...
Add your events - they will be triggered by Player Touch, and the easiest would be to set the Autonomous Movement to a custom move route, with Move Away From Player as the action, and repeated. Then in the event commands, turn on a self switch and add 1 to the variable, then check to see if the variable is the required number of mice to catch, and if it is, do whatever 'game over' triggers. Add a second page that's conditioned by the self switch and has no graphic, so the mouse disappears once it's caught.


If you have more mice than you need to catch, the event commands could be surrounded by a conditional branch, so the mouse is caught and the variable is incremented only if the variable is less than the required number of mice. In fact, I'd put all of that logic into a common event (no trigger), and in your 'mouse' events, just do a Call Common Event. So if you ever need to make the code more complicated, you've only got to do it once.


The only issue with this method is that 'move away from player' isn't always a very clever AI. It could move into something and not go around it, making it very easy to catch.
I got around that by having the "Custom" move route with both "Repeat action" and "Skip if cannot move" checked and movement rate and frequency set to High.

It is set to "turn away from player" move forward several steps, "Turn away from player" again, move several steps forward then "Turn at random" and move several steps. That way it would skip to the "Turn at random" if it got stuck. Sometimes it pauses for a few seconds though if the "Turn at random"  results in it turning into a wall again.

I basically explained how I did it in mine, but if you wanna check it out anyway: https://www.dropbox.com/s/jn3rstz45r9one4/Mini%20game.zip

Good luck on yours!

Original thread: https://forums.rpgmakerweb.com/threads/mouse-catching-minigame.19301/