Hi, I'm trying to setup an event that activates only when none of a certain event (or events) are present on the map. I would like a door (among other events) to trigger once all enemies in the room are dead but it's tricky because I'm utilizing a random map generation plugin that (while not setup yet) will eventually place a random amount of enemies on every map, so it has to be able to count the amount of events in the room and then subtract 1 every time one is killed. I have a switch already called "Room Clear" as well as the door tied to that switch being on, I'm just struggling with the conditional event count. Help is appreciated, thank you!
Event Count Based Condition
RPG Maker MZ SupportYou could just have a variable increment every time you spawn an enemy, and subtract from that variable when you defeat it.
if the amount of enemies are random, you require a variable to check the
random enemies (var enemies = 3....10)
so that random enemies should spawn, than you set that variable to another
variable so it contain that number set.
check this variable on the door if its >= than the enemies killed or are all dead,
to flip the switch.
this is the basic spawn and door mechanic that I would use though.
random enemies (var enemies = 3....10)
so that random enemies should spawn, than you set that variable to another
variable so it contain that number set.
check this variable on the door if its >= than the enemies killed or are all dead,
to flip the switch.
this is the basic spawn and door mechanic that I would use though.
I don't know how you generate your events, but I suppose the encounter events that get copy pasted yould just have a paralell first page that adds+1 to a variable, which then gets reduced whenever the encounter is defeated. Door opens when variable is 0.
Wait you're right it's so simple how did I not think of that aha wow, thank you!
killed enemy +1, or -1 is totally up to you, there might be even over 10-20
methods that can achieve the same way, just pick the easiest to work with,
more variables can be useful, specially if other events are connected to it.
good luck with your project, maybe I try your demo once ready.
methods that can achieve the same way, just pick the easiest to work with,
more variables can be useful, specially if other events are connected to it.
good luck with your project, maybe I try your demo once ready.
Original thread: https://forums.rpgmakerweb.com/threads/event-count-based-condition.162685/