Skip to content

RainThunder/fefates-tools

Repository files navigation

fefates-tools

A collection of Nightmare modules and small tools for Fire Emblem Fates.

About Nightmare

Nightmare is a program that allow you to easily hex edit the data files using modules. With Nightmare, even those who don't have any knowledge in data structure and hex editing are able to edit the game's files and make some cool stuff. Nightmare is the tradition of Fire Emblem ROM hacking community.

A Nightmare module (.nmm file) is just a text file which defines structure in a data file.

Because Nightmare only allows editing fixed-size data, you can't add any new stuff into the game via these modules. However, based on the information in .nmm files, with some basic knowledge of .bin file format, you definitely can add something new to the game.

Requirements

  • A way to decrypt the game and extract the game's files. Currently, any 3DS with CFW or homebrew access is able to do this. For instructions, see below.
  • Nightmare: thane98's Nightmare for Fire Emblem Fates, Nightmare 1 or Nightmare 2.
  • FEAT, for decompressing .lz files.
  • BatchLZ77 / DSDecmp4 / lzx to recompress the edited file. I'm not sure if those tools work on other operating systems than Windows. lzx is open-source and written in C, so you might be able to compile it for other OSes.
  • If you want to run .py script, you need Python. Both Python 2 and Python 3 are supported.

Download

https://github.com/RainThunder/fefates-tools/archive/master.zip

List of modules, tools and files

Modules

  • Chapter
  • Character
  • Character (A_HANDOVER): Modify character data that will be used in Birthright path.
  • Character (B_HANDOVER): Modify character data that will be used in Conquest path.
  • Character (C_HANDOVER): Modify character data that will be used in Revelation path.
  • Class
  • Skill
  • Stat
  • Army (practically useless)
  • Item
  • Forge
  • Tutorial (practically useless)
  • Weapon Rank
  • Path Bonus
  • Visit Bonus
  • Battle Bonus
  • Dispos

Tools

  • fst_generator.py: Generates fst.bin for Fire Emblem Fates custom DLC.
  • arc.py: Extract and repack .arc files.
  • gamedata_module.py: Add new data to GameData.bin and automatically update all modules to reflect the changes. This tool is a workaround for Nightmare limitations.
  • trim.py: Trim the padding bytes caused by Nightmare 2.
  • castle_join.py: Convert castle_join.bin to tab-delimited text file and vice versa.

Data files

  • GameData.bin
  • A_HANDOVER.bin
  • B_HANDOVER.bin
  • C_HANDOVER.bin
  • Dispos files

Instructions

Decrypting

  • This guide or this guide is a good start.
  • Alternatively, you can download xorpads or decrypted ROMs / CIAs on other sites, or use the provided files in this repository.

Editing

  • All .lz files can be decompressed using FEAT (there are still some error that need to be fixed soon).
    • Just drag and drop .lz file into FEAT window.
  • How to use the modules and tools:
    • For Nightmare modules, you need to open certain .bin file with its respective module file (.nmm). Please read README.md in each module's folder for more details.
    • For tool usage, see Using the tools
  • After editing, drag and drop your modified file(s) to trim.py, then run BatchLZ77 / DSDecmp4 / lzx to recompress your edited file(s).
    • DSDecmp4: Type DSDecmp4 -c lz11 file.bin in the command line (file.bin is the name of the file that need to be compressed)
    • lzx: Type lzx -evb file.bin in the command line.
    • BatchLZ77:
      • Click Options -> LZ77 Type 11
      • Click File -> Compress Files...
      • Choose your edited file, then click Open.
      • Your edited file will be compressed to *.bin.compressed. Rename it to *.bin.lz.

Applying the patch

  • Main game: You can use one of the following methods:
    • Use NTR CFW's LayeredFS plugin.
    • Rebuild entire RomFS folder with RomFS Builder to use with HANS.
    • Rebuild 3DS or CIA to use with Gateway 3DS or CFW. Read one of the guide that was mentioned above for more details.
  • DLC: The instructions can be found here.

Using the tools:

  • fst_generator.py: Drag and drop your folder that contains your DLC files to this script.
  • arc.py: Extract and repack .arc files.
    • For Windows: Because default Windows' Command Prompt doesn't support unicode file names (which is pretty common in Fire Emblem Fates), you have to either use arc.bat or download an alternative command line shell for Windows.
      • To extract an .arc file, drag and drop it to the arc.bat script.
      • To repack a folder, drag and drop the folder to the arc.bat script.
    • For other OSes:
      • Open the Terminal.
      • Type python arc.py file.arc to extract a file named "file.arc".
      • Type python arc.py folder to pack a folder named "folder" to an .arc file with the same name.
  • gamedata_module.py:
    • Usage: python gamedata_module.py [--option id name | --character id name sp] ... [--support [i]]
    • Arguments:
      • option: "chapter", "character", "class", "item" are available options.
      • id: ID of the new data. Must be an integer.
      • name: Name of the new data, which is used for label.
      • sp: (--character only) Number of support character. For simplicity, support ID for the new character will be the same as that character's id.
      • --support, i: Generate support module for character at index i. If --support is used with --character, this tool will generate support module for the new characters (i will be ignored).
    • Note: New character will have his / her own attack and defense stance table by default.
    • Example:
      • python gamedata_module.py --item 405 ABC --item 406 DEF: Add two items, which takes 405 and 406 as IDs and IID_ABC and IID_DEF as labels, respectively.
      • python gamedata_module.py --character 400 ABC 47 --support: Add a new character who has support with 47 other characters, and generate a support module for that character.
      • python gamedata_module.py --support 4: Generate a support module for a character at index 4 in GameData.bin (in the original file, that character is Felicia).
  • trim.py: Drag and drop the padded files to this script, or if you prefer the command line: python trim.py files [files ...].
  • castle_join.py: Drag and drop castle_join.bin / castle_join.txt to this script.
    • Legacy tool (Python 2 only) can be found here.

See also

Special thanks

  • SciresM, for FEAT.
  • VincentASM, for his initial data mining.
  • Hextator, for Nightmare 2.
  • DeathChaos25, for his contributions.

About

A small collection of Nightmare modules and tools for Fire Emblem Fates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages