Day&Night Cycle ASM (FE7)

Lengthy Introduction

So the hack I’m working on would benefit greatly from a Day/Night cycle. At first I considered setting Turn events every 3/5 turns and using LOMA to change the map between the day version and night version of a given chapter. But then I realized I would run a very legitimate risk of not enough map space to store 2/3 maps for each chapter. (i’m using the word chapter very loosely here, the hack isn’t played in traditional Fire emblem structure.)

So My question is: how hard is it to create an assembly event which swaps a map’s tileset palette mid chapter? Is that something I could feasibly do if I follow the tutorial and tinker around for a couple weeks?

I’m hoping to swap between Day, Evening, and Night palettes while in a single chapter.

Also: Would it be terribly hard to change the in-game Turn counter into a clock which increments every turn?

I have no experience with ASM, but I’ve been poking around here for a couple years now so I’m more than willing to learn Assembly if it means I can get my hack off the ground.


1 Like

Assembly and Event are two different things, there is no assembly events.

If you mean an ASMC, you can’t do it with just that, unless you have a few different versions of the map, at which point using ASM doesn’t erally make sense anymore.
If you look at how the game knows which palette to use for a map, it gets that from a table, which is in ROM, you can’t modify something like that with code.

Instead you would need to make code to replace this palette id getting, so that it can get different palettes based on something (a set of flags probably), then you can control this from your events.

As for the turn counter display, it doesn’t sound hard to do.
These are all pretty basic ideas.

pd: I’d recommend you go for FE8.

If you are using in FE8, there is a patch I made.
However, there is only add one palette that can be changed.
This means that you can create a production like switching between day and night.
My version uses Flag0x28 to switch to background like music2 with Flag4.

Add Event: Switch Map Palette (Byte 0x92/146)

If you want to switch more than one (N) of them, you can create a table, but .
Zeta, as implemented, You can also do it in the way of adding to TrapData,
I think it’s more versatile and better.

//Similarly, I’m wondering if MapBGM could be stored in TrapData, so that we can switch the background music more dynamically.

One way you can do this in vanilla is to use the LOMA instruction.
TLP’s “Ch. 26: The Battle of Kin” uses this method to switch maps.
If it is a normal hack, map area is extra, so I think there is no problem with this method.