Skip to content

Huichelaar/FE8U_bases

Repository files navigation

FE8U_bases

A patch for FE8U. Allows the player to enter a previously completed chapter from the world map with a different set of events. These chapters have free movement enabled.

Gif broken

Implementation / Features

This patch makes use of Sme's and Mokha's Free movement patch. It also includes Sme's Trap Rework and 7743's PLIST Split. Some changes were made to Free Movement (FMU):

  • When FMU starts, the initially controlled unit is set to be the one at the start of the gGMData.units[] array. This was done as I'd otherwise have to find a free/redundant byte in SRAM to save to or adapt EMS to this patch as well, which could introduce more snags for the user when adapting the patch to an existing project.
  • Originally an unsaved flag was used to determine if FMU is active. In this adaptation Chapters are marked as either base or non-base chapters in ROM. Now, the game determines if FMU is active by checking if either the original flag is active, or the chapter is a base chapter (or both hold true). Like the previous point, this was done to avoid having to adapt EMS.
  • FMU originally allowed the player to switch which unit is controlled by pressing select. Now, a global flag needs to be set to allow this functionality. This flag can be configured in FreeMovement.event.
  • The controlled unit can face in one of four directions (North, East, South, West). If you wish to trigger a talk event, the controlled unit needs to be facing the unit whose event you wish to trigger. Like vanilla, the talk event still requires two specific units to trigger it. As the direction the unit faces is not preserved when switching the controlled unit, I'd recommend leaving the flag mentioned in the previous point unset. Facing direction could be stored in two bits in a unit's RAM UnitStruct. I'll leave implementing that as an exercise to the reader.

Other additions were made as well:

  • To determine whether a worldmap node has an available base chapter, the third bit (0000 0X00) of the flags in the world map nodes struct was used. Redundancy in the world map save data was used to save the 29 extra bits (one per world map node, of which vanilla has 29), without relying on or hindering the potential presence of EMS. If you've replaced or modified the functions used to save or load world map struct data (EMS does not replace these by default), you will probably need to modify the functions in the save directory. Details on what redundancy was exploited can be found in loadWMSave.asm and saveWMSave.asm (repeat).
  • An ASMC, or ASM Call, was added to set and unset the flags determining a world map node has a base available or not. There are three macros:
    • WLC_baseChapterAvailable(nodeID): Makes base available for given world map nodeID.
    • WLC_baseChapterUnavailable(nodeID): Makes base unavailable for given world map nodeID.
    • WLC_baseChapterInvertAvailability(nodeID): for a given world map nodeID, makes its base unavailable if it were available before, available if it were unavailable before.

Building

Apply WMLoadChapter.event to a clean FE8U ROM using Everything Assembler, AKA EA. Borgo Ridge has a few interactable map events (map objects and other people to talk to). You can enable the base using one of the ASMC macros and get a feel for things.

Adapting to an existing project

If you're making a bigger ROMHack or project involving multiple patches and you're using FEBuilderGBA as your main tool, you might be familiar with Custom Build. Whilst it's generally not recommended to mix buildfile patches and FEBuilderGBA, if the patch you're interested in using is not available in FEBuilderGBA, Custom Build is one way to still adapt the patch.

If you're using Custom Build or buildfiles as your tool/editor/w/e, pay attention to the following things when adapting the patch to your project:

  • TextProcess is used in this patch. If you're already using TextProcess, re-organize the text directory.
  • ROM Chapterdata has been repointed to allow the extra base chapters to be added. If you've already repointed Chapterdata, re-organize chapters.event.
  • Vanilla makes use of a switch statement at 0xBD084 to determine if a chapter has skirmish/valni/lagdou settings, or is merely used as story. This patch repoints this switch statement in chapterType.event. If you've already repointed this, you might want to re-organize.
  • Events for the base chapters can be found in events.event. If you're keeping your chapter events elsewhere, you might want to move these there as well.
  • The PLIST split is applied in PLISTSplit.event. This directory also contains the other PLISTs. Re-organize as you deem fit.
  • If you're already applying TrapRework, you'll need to re-organize the TrapRework directory.
  • If you're already using a different version of FreeMovement, you should probably remove that patch.
  • There's a table, indexed by Standing Map Sprite (SMS) IDs in gfx.event. Each entry in the table consists of a pointer to compressed graphics of the different direction-facing SMSes. Only one entry, corresponding to Eirika's SMS, has a pointer, the others are NULL. If you wish to add more graphics of SMSes facing left, right or up, format them the same way as EirikaIdles.png and add their pointer to the table.

Known Issues

  • Sometimes, during Free Movement, the controlled unit staggers when moving. Not sure what causes it. Seems to happen when changing directions sometimes. Stopping movement and starting seems to be a way to fix it when it happens.

Credits

Lemme know if I forgot anyone and I'll add them. Credits to:

About

Allows people to enter a previously completed chapter from the world map with a different set of events.

Resources

Stars

Watchers

Forks

Packages

No packages published