Event to run when all enemies cleared from map

● ARCHIVED · READ-ONLY
Started by ChaosNiGHT 6 posts View original ↗
  1. Okay, so I've created a map that contains several events that trigger on player touch to begin battle processing and erases itself once the combat is completed. The idea is that the player must complete all these combat events to clear them off the map. I've got that up and working correctly. What I'm trying to do now is have a simple event trigger once all the combat events are gone that directs the player to the next map. As far as I can tell, the easiest way to do this would be a switch, but I can't figure out a way to tell the switch the condition (all enemy events gone) to get it to turn on. I'm still somewhat new to this, so am I just overlooking something?
  2. Every time you defeat an enemy troop, add one to a variable (you can put this in the if win condition). Then set the event you want to run to run when the variable is >= the number of enemy troops you placed (autorun or parallel process works here, depending on what you want it to do). Just be sure to set up the event to turn off once it runs else it will run forever!
  3. bgillisp's solution is the one I would have come up with. I think it's the best way to do it.
  4. That did it perfectly, thank you.
  5. Note - if you are using Erase Event, when you leave the map and come back again, those events/enemies will have returned. So you could have 10 enemies on the map, fight 5 of them, leave the map and return, which causes all 10 to respawn, fight 5 again, and you'll think the map has been cleared, when there are still 5 more enemies to defeat.

    To prevent this, you will either need to make sure the player can't leave the map, reset the variable to 0 when leaving the map if all enemies haven't been defeated, or also turn on a self switch on each event and add another blank page conditioned by the self switch, so a defeated enemy doesn't respawn when you leave the map and return (in that case, don't reset the variable).
  6. The specific part of the game I'm working on is a series of maps where the PC's hometown is under attack. They should clear the enemies out of each area, at which point an event will indicate to the player which way to go next and activate the events to transfer to that location. At this time, I'm not putting in the ability to go back. Once all the scenarios have been completed, a cutscene will play, and the player will be taken back to the not-under-attack version of the town map.