Final Fantasy Hacktics

Modding => Help! => Topic started by: Porklin on February 27, 2020, 02:34:16 pm

Title: TLW event editing - Custom events repeating
Post by: Porklin on February 27, 2020, 02:34:16 pm
Hey folks,

So I've spent the last couple of days trying to work my head around a problem that I'm having. I've made a custom battle. I can get it to enter from the worldmap at the right time, I can get the event running and dialogue going. I can get the battle to start, and I can get the battle to end when all enemy units are defeated.

After that, there's an event (same scenario) with some dialogue between characters, an option to recruit a character, and then the event ends.

And THEN, that post-battle event repeats (though, the dialogue is either absent or garbled this time). The option to recruit the character repeats. Sceen fades to black. Rinse, repeat. Seemingly ad infinitum.

I just want to get back to the world map!

I'm trying to figure out where my issue might be. Does this seem like a problem with the event script? The Attack.Out file/editor?

EDIT: Here is the text of the event that keeps repeating
WaitForInstruction(x43,x00)
Wait(00010)
InflictStatus(x01,x00,x00,x0C,x00)
WaitForInstruction(x43,x00)
Wait(00010)
FaceUnit(x07,x00,x01,x01,x00,x00,x02)
FaceUnit(x07,x00,x01,x00,x00,x00,x02)
BgSound(x05,+000,+030,x00,180)
Wait(00030)
DisplayMessage(x10,x70,x0001,x01,x00,x00,+00000,+00000,+00000,x00)
WaitForInstruction(x01,x00)
Wait(00010)
Focus(x07,x00,x07,x00,x00)
Camera(+00020,+00287,+00256,+00302,+03584,+00000,+04096,+00032)
WaitForInstruction(x04,x00)
Wait(00010)
DisplayMessage(x10,x70,x0002,x07,x00,x00,+00000,+00000,+00000,x03)
WaitForInstruction(x01,x00)
Wait(00010)
Focus(x01,x00,x01,x00,x00)
Camera(+00000,+00001,+00356,+00302,+03584,+00000,+04096,+00032)
WaitForInstruction(x04,x00)
Wait(00010)
DisplayMessage(x10,x70,x0003,x01,x00,x00,+00000,+00000,+00000,x00)
WaitForInstruction(x01,x00)
Wait(00010)
Focus(x07,x00,x07,x00,x00)
Camera(-03780,+00060,+00540,+00302,+03584,+00000,+04096,+00032)
WaitForInstruction(x04,x00)
FaceUnit(x01,x00,x07,x00,x00,x00,x00)
WaitRotateUnit(x07,x00)
Wait(00010)
DisplayMessage(x10,x70,x0004,x07,x00,x00,+00000,+00000,+00000,x03)
WaitForInstruction(x01,x00)
Wait(00010)
Focus(x01,x00,x01,x00,x00)
Camera(+01386,+00040,+15360,+00302,+03584,+00000,+04096,+00032)
WaitForInstruction(x04,x00)
Wait(00010)
DisplayMessage(x10,x70,x0005,x01,x00,x00,+00000,+00000,+00000,x00)
WaitForInstruction(x01,x00)
EditBGSound(x05,+030,+010,x00,x3C)
Wait(00060)
Wait(00020)
EventSpeed(x02)
DarkScreen(x00,x01,012,064,x00,004)
WaitForInstruction(x36,x00)
DisplayConditions(x02,060)
WaitForInstruction(x38,x00)
DisplayConditions(x03,060)
WaitForInstruction(x38,x00)
DisplayConditions(x04,060)
WaitForInstruction(x38,x00)
DisplayConditions(x05,060)
WaitForInstruction(x38,x00)
DisplayConditions(x06,060)
WaitForInstruction(x38,x00)
DisplayConditions(x07,060)
WaitForInstruction(x38,x00)
RemoveDarkScreen()
WaitForInstruction(x36,x00)
EventSpeed(x01)
AddUnitStart()
{82}()
AddUnitEnd()
Wait(00080)
EditBGSound(x05,+010,+000,x00,x3C)
Wait(00060)
ZERO(x007D)
ColorScreen(x02,000,000,000,255,255,255,+00060)
WaitForInstruction(x0C,x00)
WaitAddUnitEnd()
EventEnd()

//INSTRUCTION SECTION END -  TEXT START
//Message x01
{font:08}{Ramza}{br}
{font:00}Are you OK?{end}

//Message x02
{font:08}???{br}
{font:00}It appears so...{br}
But what plane is this...{end}

//Message x03
{font:08}{Ramza}{br}
{font:00}Plane?{br}
Are you sure you're OK?{end}

//Message x04
{font:08}???{br}
{font:00}Hm. Yeah.{br}
Who're you?{end}

//Message x05
{font:08}{Ramza}{br}
{font:00}We're military cadets.{br}
{br}
I think we can help{br}
you figure things out.{end}

//Message x06


It's essentially an exact copy of Event "014 Mandalia Plains (Algus Alive)" with edited dialogue.

Here's the code for the attack.out spreadsheet
0100FD01010019005401
160019005501 <- this is the event that's repeating

And here is a screenshot of my attack.out editor scenarios.attack.out screenshot.png

Thanks!
Title: Re: TLW event editing - Custom events repeating
Post by: Xifanie on February 27, 2020, 02:54:23 pm
If your event loops before it is supposed to end, something is wrong with your event.
If your event successfully completes and loads itself again, something is wrong with your ATTACK.OUT setup.

Either way, we're going to need your event script and/or ATTACK.OUT setup screenshot.

Quote from: Porklin on February 27, 2020, 02:34:16 pmIt seems like the new forum setup doesn't really allow for spoilers, so please let me know if I should dump my event script here - otherwise I'd rather spare your eyes the clutter. I'll edit it in if asked.
I fixed the spoiler tag several days ago 😜
Title: Re: TLW event editing - Custom events repeating
Post by: Porklin on February 27, 2020, 04:31:13 pm
Quote from: Xifanie on February 27, 2020, 02:54:23 pmIf your event loops before it is supposed to end, something is wrong with your event.
If your event successfully completes and loads itself again, something is wrong with your ATTACK.OUT setup.

Either way, we're going to need your event script and/or ATTACK.OUT setup screenshot.
I fixed the spoiler tag several days ago 😜

Alright, it definitely sounds like then it's an Attack.out problem. I've updated the initial post to include some additional info. Given that the event is being triggered from the world map seemingly without problems, I didn't include the worldmap conditions code, but I can as well.
Title: Re: TLW event editing - Custom events repeating
Post by: Xifanie on February 27, 2020, 04:55:03 pm
Sorry, I'm a bit out of it today.

Re-reading everything and seeing that this is a battle event, your problems would be with your event/battle conditionals, so we'd definitely need to look at those.

Your ATTACK.OUT looks fine at first glance, but I can't say if you're using enough slots without seeing your event/battle conditionals.

The world map conditionals are unnecessary for the time being.

EDIT: I would also advise against using instructions that don't have a name. If we don't know what they do, at worst they'll break your event and at best they won't do anything.
Title: Re: TLW event editing - Custom events repeating
Post by: Porklin on February 27, 2020, 05:06:53 pm

Quote from: Xifanie on February 27, 2020, 04:55:03 pmSorry, I'm a bit out of it today.

Re-reading everything and seeing that this is a battle event, your problems would be with your event/battle conditionals, so we'd definitely need to look at those.

Your ATTACK.OUT looks fine at first glance, but I can't say if you're using enough slots without seeing your event/battle conditionals.

The world map conditionals are unnecessary for the time being.


Ok, so I'm just using two lines of code

0100FD01010019005401 <- (This is the prebattle event that's working just fine, apart from the player party marching when I want them to be still)
160019005501<- (This is the event that I dumped above)

So, from what I think I've learned, that should be essentially two commands - run through event 0154, and then once all enemy units are dead, run through event 0155.

An analogue already in TLW would be the Zigolis Swamp battle, which similarly has a prebattle convo and a post-battle convo:

0100FD01010019006300
160019006400
Title: Re: TLW event editing - Custom events repeating
Post by: Xifanie on February 27, 2020, 05:51:36 pm
Something doesn't add up.

Are you using event [scenario] slots 0x154 and 0x155, as according to your battle conditionals,
or 0x13A & 0x13B with event conditional set [event script] 0x9A, as according to your ATTACK.OUT screenshot?

Also a reason why it's good to include the whole event, including the Offset() line
Title: Re: TLW event editing - Custom events repeating
Post by: Porklin on February 27, 2020, 06:57:34 pm
Quote from: Xifanie on February 27, 2020, 05:51:36 pmSomething doesn't add up.

Are you using event [scenario] slots 0x154 and 0x155, as according to your battle conditionals,
or 0x13A & 0x13B with event conditional set [event script] 0x9A, as according to your ATTACK.OUT screenshot?

Well, the honest answer is that I was using both. But, by rectifying that (I'm now just using 154 and 155) I was able to run the event to completion and return to the world map!

I did then immediately jump right back into the event when I tried to move, but I have an idea of how to go about fixing that (making sure I change the variables I used to call the fight).

Thanks for your help, Xifanie! From what I gather I've been using a bunch of your tools, so double thanks for all the work you've put in! I've just been wading into hacking after playing FFT for the last 20 years. It's just made me love it more.
Title: Re: TLW event editing - Custom events repeating
Post by: Nyzer on February 27, 2020, 07:07:17 pm
I've never actually done any tinkering with the conditionals myself, but something about your Attack.OUT screenshots stands out to me (though I would have expected different errors from it, so idk).

The second scenario is set to have no event script.
Title: Re: TLW event editing - Custom events repeating
Post by: Xifanie on February 27, 2020, 07:28:12 pm
Quote from: Porklin on February 27, 2020, 06:57:34 pmI did then immediately jump right back into the event when I tried to move, but I have an idea of how to go about fixing that (making sure I change the variables I used to call the fight).
You're correct! Normally it's just setting the Story Progression Variable to a new value at the end of the victory event (in this case).

Quote from: Porklin on February 27, 2020, 06:57:34 pmThanks for your help, Xifanie! From what I gather I've been using a bunch of your tools, so double thanks for all the work you've put in! I've just been wading into hacking after playing FFT for the last 20 years. It's just made me love it more.
My pleasure! It's nice to see new people tackle Event Editing. 😀

You've already tackled everything that is involved in making them and organizing them, which is no small feat. The links between the scenario data, world map conditionals, event/battle conditionals and event scripts can feel quite daunting and it's a lot to grasp at once... but you've done it. Congratulations! 🎉
Title: Re: TLW event editing - Custom events repeating
Post by: Porklin on February 28, 2020, 07:42:35 pm
Aaand it's working! Turns out I was handling offsets improperly too, I think. Just have three more custom events to get up and running and I can put a bow on the little personal patch I've tasked myself on getting together. Thanks again!