How to make a zone-based reinforcement wave spawn after another?

I’m trying to make a situation where one wave of reinforcements appears right after another zone-based reinforcement wave finishes.

For example: When a player unit steps into a specific zone, reinforcements 1 (let’s say Warriors) spawn for 2 turns. THEN reinforcements 2 (Heroes) spawn for another 2 turns. Let’s say they’re spawning from two fort tiles.

I’ve tried to make it like this:

1. Set Flags ON in the Start Event: I turned Flag 0C and Flag 0D ON.

2. In range conditions: I created two events so that when a player unit steps into the zone, the flags turn OFF (one event turns off Flag 0C with Completion Flag 0B, and the other turns off Flag 0D with Completion Flag 0E).

3. In turn conditions: I created an event (Turn 1-255) with Completion Flag 0C to load Reinforcement 1. Then, I created another event (Turn 1-255) with Completion Flag 0D that checks if Flag 0C is ON before loading Reinforcement 2.

When playtesting, reinforcements 1 worked fine. Reinforcements 2 came out one turn after reinforcements 1, just as I wanted. BUT, it seems like the event runs twice, so now they have doubled in quantity (4 mages spawn instead of 2).

What did I do wrong?

Range events with the exact same range behave weirdly so you should not have them. It’s been a while since I looked into it but if memory serves, it will trigger the first matching range event, but will set the flag for the last matching range event. If you make just one of their coordinates different they should work properly, but in this case it doesn’t even look like you need multiple.

As for multi-turn events, this is where counters should be used:

-In the start event, set one counter to 4 and set the turn event’s completion flag.
-In the turn event, check the counter. If it’s >= 3, spawn the Warrior unit group, else spawn the Hero unit group. Then decrement the counter, and if it is not 0 unset the turn event’s completion flag.
-In the range event, unset the turn event’s completion flag.

I’m following you. But there’s a problem. I didn’t even step into the zone and it already loaded the Heroes. Can you check where I went wrong?

Start event: (I’m testing on chap 8 of FE8)

Turn event:

So I think these lines of code mean Check counter ID0. If it’s < 3, jump to Conditional ID 9000 (which is the Heroes). If it’s >= 3, execute the following (which is the Warriors). Correct?

Then reduce the counter. When it gets to zero, turn ON the completion flag = event ends.

Range event:

(I just realized that I’m so dumb for creating 2 range events in the same zone to turn off the flags, when I could have put turning off both flags into just one event lol)

I’m still a noob so bear with me :pensive_face: I just took examples from the vanilla game and learned from them so I haven’t fully grasped all of it yet.

-Your turn event is set up to conditionally spawn the warriors and unconditionally spawn the heroes. You need to add a LABEL after the heroes and a GOTO to that label after the warriors.
-Your turn event is not setting its own flag OFF, so it’ll only trigger once (and presumably spawn both the warriors and heroes).
-I don’t like using that “reduce the counter” macro because I’ve seen it cause problems. I recommend COUNTER_SUBTRACT, then COUNTER_CHECK, to set it up like I suggested in my previous post.
-The range event seems correct. Are you sure you set its range properly?

If you press F5 with the ROM open in FEBuilder, you’ll open it with the debugger attached. In the debugger, check if the flag for your turn event is ON, as it should be. If it’s not, make sure you’re restarting the chapter, and not resuming it. You can also use the Flag Usage editor to see every event in that chapter that does something with each flag, so make sure nothing else is setting the turn event’s flag to OFF.

Oh I see it now. I was using a save file that was already on turn 3/4, so in that save the start event (unedited version) had already loaded. That’s why flag 0D was OFF the whole time, even in my previous tests with different methods :man_facepalming:

(And I realized I had set the wrong flag in the Event editor in the last edit. Flag 0E instead of 0D)

Tested quickly and it works now! Warriors for 2 turns, Heroes for 2 turns, then it stops. Perfect! :laughing:But just to be sure, can you check my code one more time to see if there are any errors or things I can improve?

So what I get from this is it will Check counter ID0. If it’s < 3, jump to Conditional ID 9000 (which is the Heroes). If it’s >= 3, execute the following (which is the Warriors).

Then it goes to Conditional 9001: subtract 1 from Counter ID0, then check the counter again. If the result is 0, jump to Conditional ID9002 (which ends the event and turns ON the event flag. It won’t run anymore.) If the result is not 0, keep the flag 0D OFF so the event keeps running on the next turn.

Right?

The event looks right. Just a few things to keep in mind:

-You could put a GOTO 0x9001 just before LABEL 0x9001 as well. It’s redundant, because you’re just telling the event to go to the next command, which it was already going to do anyway, but personally helps me with visualization and it takes minimal extra space, so I tend to do it.
-COUNTER_SUBTRACT (and _ADD) always change the counter by 1, doesn’t matter which value you put in the 00 field. Just repeat the command if you want it to change by more than 1.
-Completion flags are turned ON when the event starts, not when it ends, otherwise turning its flag OFF wouldn’t do anything.

Thanks @Shuusuke you’re so helpful.