Making a clear all enemies room
Advanced
So, you want to make a room where you have to "clear all enemies" to progress? or something like that?
Well, if you have a decent understanding of how flags work, then this lesson should be easy for you to understand.
Ok, so I made it, so that when you kill all 3 of these critters, a message saying "Victory!" will appear.
The first thing I did, is give them all their own event numbers.
And I made them all, run their event on death.
Let's look at what those events do:
You may have noticed the pattern with all of them, each one changes the critter entity into a smoke entity.
A sound is played(enemy killed?), a flag is set, and then it goes strait to event #0105
Let's look at the rest of the events:
So, event #0105 does a flag jump, to event #0106
And then event #0106 has a flag jump to event #0107
And then event #0107 will do a flag jump for event #0108
Then finally, the event displaying "Victory!" will run.
Now, all of the critters events, set their own flag:
#0102 sets flag 2000
#0103 sets flag 2001
#0104 sets flag 2002
All 3 of these flags need to be set, in order for the flag jumps to be able to jump, all the way to event #0108
Here's a cool thing about the way this is set up. The order in which the critters die, doesn't matter.
Remember, all of the critter events will go to event #0105
If I killed the 2 critters that gave flags, 2000 and 2002, then event #0107 wouldn't do anything
Because it needs flag 2001, to be able to jump to the next command, and thus, we do not get our message.
Once we kill the last one with flag 2001, then the game goes to event #0105 once more.
And now that we have all the flags we need, the game will go right to event #0108 that displays the message.
Navigation
Previous Section: Textbox
Next Lesson: Editing other TSC files
Table of Contents
|