Here is the video for reference (Thank you ArmoredKori!)
Go subscribe to this man on Twitch ASAP.
Here is a link to the pastebin of the event.txt, which I will also be attaching below. Feel free to use it as reference for creating your own Battle Series events!
Here are images showing how I set up the ENTD, World Map Conditionals for triggering the event, Attack.Out, and Event conditionals.
I had to adjust the Orbonne event to make space for my event! I also moved the Orbonne event from its original spot (offset 4000) to its setup event slot (offset 2000).
Just one slot?? That's right!
As you can see, all units except for Worker 7 are set not to be present at all. This meant for me that every time I ChangeMap'd and the ENTD data was reloaded, I only had to RemoveUnit Worker 7 and could AddUnit in the enemies I wanted for the fight.
Again, I had to modify Orbonne's event conditionals to make space for my event. RIP Vanilla, everyone please use TLW as a base (or make a totally custom mod) instead.
I appended my new events conditionals to the end of Vanilla's list. You can see how I got the event to be called over and over again, each time the player wins the fight the event is called again. In the event you can see that I only tell it to go back to the world map if the player beats every fight or if they refuse the challenge.
The world conditionals. This fight is only available in Chapters 2 and 3 because I can control Ramza with his unit ID 02 in those chapters, and I didn't want to put in the effort to check what his unit id was and swap it in if you tried it in chapters 1 or 4 (where his unit id is 01 and 03 respectively). The variable I am using for the check here is actually what background the shops are currently set to!
The Same Event Multiple Times
If you've opened up the event.txt you'll see that it starts with a switch statement.
//Var x0070 will be used to track what part of the event to run
Case(x0001) //PART 2
Case(x0002) //PART 3
Case(x0003) //PART 4
Case(x0004) //PART 5
Case(x0005) //PART 6
Case(x0006) //PART 7
Case(x0007) //PART 8 (FINAL)
Default() //First part no jump, run part 1 below
Every time this event starts, this Switch checks Var x70, if its value matches a Case, it will run that section. Each of those sections has a JumpForward that brings it to the appropriate part of the event. At the end of every 'PART' of the event, I use JumpForward(x01) to go to ForwardTarget(x01), which is right before the end of the event so I can skip over the parts we haven't gotten to yet. This allows us to create an event that is itself its own Pre-battle, Mid-battle, and Post-Battle events. At the end I use the PostEvent(x80,x0000) command to bring the player back to the world map.
A single event can be quite large, this event has a ton of instructions in it but only uses 5952 bytes out of a possible 8192. If you wanted to create an even longer battle series you could write events that have better looping logic to save space, or use more than one event slot. I just wanted to show that if you really wanted to, you could significantly reduce the amount of space required for multiple events (so don't ever say that FFT doesn't give you enough space!). SOMETIMES using a little more space to keep yourself organized might be the best way to go, especially because condensing things down to this level can make it confusing. Be mindful of why you would do something like this
Bringing The Team Back
When you load in your party into an event with a battle formation screen and then ChangeMap, they are wiped away like the units in the ENTD that are not flagged Always / Randomly present. I tried AddUnit-ing them back in, but that presented a strange graphical glitch: Units would take hits from enemies and not react, and no damage would show up even though their health would actually change, unless they had taken a turn first. I discovered the fix for this by looking around in pSX's memory editor, here is the excerpt from the event.txt where I talk about it:
//Battle Stats x0001 has to be the same as what it was at the start of the event,
//otherwise when units are hit before they get their turn they will not react
//(But still take damage). This is just a graphical glitch, but an important one to take care of to make things looks good
//It gets set to FF on ChangeMap, so it must be assigned
I run this code block every time I ChangeMap. I believe that the numbers are correlated to the fact that in battle stats the player party are stored in those slots (The 16th (0x10) to the 20th (0x14)). The event will still run fine if the player brings less than the full party.
Bringing the Enemies Back
ChangeMap seems to reset ENTD data to a certain point, when I AddUnit enemies in that have previously been defeated / crystal / treasure'd after a ChangeMap, they appear with full HP and MP. I have to do more testing to see what happens with things such as Inviting an enemy and broken gear.
Thank you to ArmoredKori for creating the Map Pack and inspiring me to do this event for you! It was fun
If anyone has any questions about anything I've done here in the event, that I talked about here or otherwise, please respond to this topic or message me on Discord! I hope that we can work out all the kinks of the battle series system and have it included in lots of mods in the future