An event leading to a battle?

Hi again, you guys were so helpful last time i asked a question, now i have another puzzle. Well, it's puzzling to me anyway.


I would like to link the outcome of an event to the start of a battle. I'm not sure if the two can interact normally within the game or i need a plugin to do it but this is an example of what i would like to do.


The hero sees a sleeping orc, he attempts to tiptoe past without waking him. A random number generator will determine whether or not his sneaking is successful. If it is then he just carries on his merry way but if unsuccessful a battle ensues, with some text in between maybe just to tell the hero he has woken the orc up.
I suggest you follow the link to the starting point in my signature and work through the tutorials mentioned there.


Everything you want can be done with basic event commands (more specifically, control variables and conditional branch for the random check, battle processing to start the battle and show text for your messages), and the fastest way to the solution is to work the tutorials intended to show you which commands exist and how to use them.


I suggest especially the Variables Guide - that game was written in Ace, but the handling of variables is identical from RMXP to RMMV as that is only mathematics.
Just set an event near the orc that the player will be forced to pass over.  Below Characters, Player Touch.


If you want a 1 in 4 chance of waking the orc, do a Control Variables > Set > Random > 1-4


Then a Conditional Branch - if variable = 1, show text followed by battle processing.

Original thread: https://forums.rpgmakerweb.com/threads/an-event-leading-to-a-battle.63794/