marcrobledo / acnl-editor

An Animal Crossing: New Leaf savegame editor made in HTML5
https://www.marcrobledo.com/acnl-editor/
MIT License
153 stars 33 forks source link

Ability to Edit Town Ordinances #39

Closed Cuyler36 closed 5 years ago

Cuyler36 commented 6 years ago

While @Slattz and I were looking at how Town Ordinances are set, I discovered that you could set multiple Town Ordinances at once. I'll give a brief explanation on how Town Ordinances work:

Offset 0xXXXCF contains the currently enabled ordinance flags. Specifically bits 1-4 (where 0 and >4 are used for something else).

Offset 0xXXXD1 contains the flag saying that a Town Ordinance change has been scheduled for that day (bit 4, 0x10). We don't really care about this flag, but if it's enabled, the player will not be able to change their Town Ordinance until the next day.

Offset 0xXXXD3's upper nibble contains the current town ordinance. 0x00 = Early Bird, 0x10 = Night Owl, 0x20 = Bell Boom, 0x30 = Keep X Beautiful. 0x40 means there is no ordinance in effect. The game uses this value to set 0xXXXCF on every new day. This includes both days where the ordinance has been changed, and days it hasn't. Setting this byte to 0x70 stops the game from updating 0xXXXCF, effectively locking in the ordinance flags there.

In conclusion, we're able to enable up to all four Town Ordinances (Early Bird overwrites Night Owl's effects if they're both enabled) at once. Then, by setting 0xXXXD3's upper nibble to 0x70, we freeze those values in place.

EDIT: I forgot to mention, when multiple ordinances are enabled, Isabelle will say that the last ordinance in the checkbox order is in effect currently. Example: Both Bell Boom & Keep X Beautiful ordinaces are enabled, Isabelle will say that "Keep X Beautiful" is the active ordinance. Despite what she says, the others are still enabled.

I added the checkboxes under the Other tab. I'm not sure if the design is acceptable, so you may want to review it. Here's a preview in Chrome: Preview

Slattz commented 6 years ago

Perhaps a radio button should be used for 'Early Bird' and 'Night Owl' instead since they don't work together? Or perhaps a warning or something? Otherwise people will be confused and wondering why Night Owl doesn't work while Early Bird is on :sweat_smile:

Cuyler36 commented 6 years ago

A notification alert will now be shown when both are checked. It notifies the user that Early Bird will override Night Owl when they are both enabled.

marcrobledo commented 6 years ago

I'll merge this as soon as possible :-)

Slattz commented 5 years ago

@marcrobledo Any updates on this pull request?

marcrobledo commented 5 years ago

Sorry guys, I was working on a big update for the editor. That's why I decided to put off your pull request until my update was ready. However, after a few months without working on this, today I wanted to resume my work and I had a lot of trouble to catch up, it's been a while since I left ACNL hacking. Anyway, I decided to revert back to the old version (and promised myself not to touch this project anymore, unless it's needed). So I merged your pull request. Thanks a lot :-)

I'm also going to add a few features from the abandoned update, which will probably be my latest addition here.