Modding Docs
  • 👋Welcome
  • 💡Getting Started
    • 🎩Persona 5 Royal (PC) Mod Support
      • 🚧Manually Installing PC Mods
    • 🎩Persona 5 Royal (Switch) Mod Support
      • 🎩P5R Mods on Switch Console (CFW)
      • 🎩P5R Switch Mods on PC Emulator (Yuzu/RyujiNX)
      • 🚧Manually Installing Switch Mods
    • 🎩Persona 5 Royal (PS4) Mod Support
    • 🎩Persona 5 (PS3) Mod Support
    • 📺Persona 4 Golden (PC) Mod Support
    • 📺Persona 4 Golden (PSVita) Mod Support
    • 📺Persona 4 (PS2) Mod Support
    • 🌘Persona 3 Portable (PSP) Mod Support
    • 🌘Persona 3 FES (PS2) Mod Support
  • 📄Scripting
    • Intro to Scripting
      • Resources
    • AtlusScriptCompiler
      • Run via Commandline
        • Decompile
        • Compile
        • Batch Dump .FLOW/.MSG
      • Run via GUI
    • Flowscript
      • Procedures
      • Variables
      • Scope
      • Arrays
      • Enums
      • Loops
      • Conditionals
      • Functions
      • Importing Files
      • Menus
    • Messagescript
      • Markup
      • Message Variables
    • Library Functions
      • Persona 5
      • Persona 5 EX
      • Persona 5 Royal
      • Persona 4
      • Persona 4 Golden
      • Persona 3
      • Persona 3 FES
      • Persona 3 Portable
      • SMT III: Nocturne
      • Digital Devil Saga
Powered by GitBook
On this page
  • 1. Specifying the Input File
  • 2. Specify that you are Compiling
  • 2. Specifying the Library
  • Included Libraries
  • 3. Specifying Output Format
  • Output Types
  • 4. Specifying Encoding
  • Encodings
  • 5. Specifying the Output File
  • 6. Hooking
  • Setup
  • Conclusion

Was this helpful?

  1. Scripting
  2. AtlusScriptCompiler
  3. Run via Commandline

Compile

Convert BF and BMD into flowscripts and messagescripts

PreviousDecompileNextBatch Dump .FLOW/.MSG

Last updated 3 years ago

Was this helpful?

As previously mentioned, can .FLOW and .MSG into .BF and .BMD respectively. Read the previous sections for more information.

1. Specifying the Input File

First, you must tell the program what file we're working with. For , this must be a .FLOW or .MSG file.

C:\Users\Username>"C:\Path\To\AtlusScriptCompiler.exe" "C:\Path\To\field.bf.flow"

You can simply drag AtlusScriptCompiler.exe and then field.bf.flow onto the command prompt window. This will automatically wrap each paths in quotes, which keeps arguments separate in case your paths contain spaces.

2. Specify that you are Compiling

Now, let's tell the program what to do with that file. Add -Compile, separated by a space.

C:\Users\Username>"C:\Path\To\AtlusScriptCompiler.exe" "C:\Path\To\field.bf.flow" -Compile

2. Specifying the Library

A Flowscript Library instructs the compiler on function names and parameters. In order to work with the input file, you have to tell the compiler which Library to use with -Library.

C:\Users\Username>"C:\Path\To\AtlusScriptCompiler.exe" "C:\Path\To\field.bf.flow" -Compile -Library P5

Included Libraries

Library Name

Usage

DigitalDevilSaga

-LibraryDDS

Nocturne

-LibrarySMT3

Persona3

-LibraryP3

Persona3FES

-LibraryP3FES

Persona3Portable

-LibraryP3P

Persona4

-LibraryP4

Persona4Golden

-LibraryP4G

Persona5

-LibraryP5

Persona5Royal

-LibraryP5R

PersonaQ2

-LibraryPQ2

3. Specifying Output Format

You should also choose an Output Type with -OutFormat. This determine the version and endianness of the generated BF or BMD.

C:\Users\Username>"C:\Path\To\AtlusScriptCompiler.exe" "C:\Path\To\field.bf.flow" -Compile -Library P5 -OutFormat V3BE

Output Types

Output Type

Usage

Persona 5 BF

-OutFormatV3BE

Persona 5 (PS3) BMD

-OutFormatV1BE

Persona 5 (PS4) & Persona 3/4 (PS2) BF/BMD

-OutFormatV1

4. Specifying Encoding

An Encoding can be specified using -Encoding. It lets the compiler know what set of characters to use.

C:\Users\Username>"C:\Path\To\AtlusScriptCompiler.exe" "C:\Path\To\field.bf.flow" -Compile -Library P5 -OutFormat V3BE -Encoding P5

Encodings

Game Name

Usage

Persona 5

-EncodingP5

Persona 4

-EncodingP4

Persona 3 (FES)

-EncodingP3

PersonaQ(2) or any game using Shift-JIS/CP932

-EncodingSJ

5. Specifying the Output File

Finally, you can name the Output File using -Out.

C:\Users\Username>"C:\Path\To\AtlusScriptCompiler.exe" "C:\Path\To\field.bf.flow" -Compile -Library P5 -OutFormat V3BE -Encoding P5 -Out "C:\Path\To\field.bf"

If -Out is not specified, it will default to the input filename and folder, but with the output filetype appended. In this case, that would be C:\Path\To\field.bf.flow.bf.

At this point, you can press Enterto begin compiling. But, there are a few optional commands which might be useful to you.

6. Hooking

AtlusScriptCompiler is not perfect, so it doesn't hurt to be proactive. With hooks, we can avoid potential compiler issues when recompiling an entire .BF script.

Enable Hooking by adding the-Hook argument.

C:\Users\Username>"C:\Path\To\AtlusScriptCompiler.exe" "C:\Path\To\field.bf.flow" -Compile -Library P5 -OutFormat V3BE -Encoding P5 -Out "C:\Path\To\field.bf" -Hook

Setup

  1. Open the .FLOW and copy the procedure you want to edit.

  2. Paste it into your .FLOW that references the .BF, and add _hook to the procedure name.

  3. Edit the procedure however you'd like.

  4. Compile your new .FLOWwith the-Hook argument.

Conclusion

Not all games have libraries available. Knowledge of reverse engineering game executables is required to generate a library, as you'll have to find the offsets of function signatures yourself. A sample script for P3/P4 (PS2) can be seen .

Hooking can be handy when you're compiling a .FLOW and only want to replace specific in an .BF.

When your .FLOW into .BF, this redirects existing in an .BF file to replacement with a matching names that end in _hook_().

The original still exists and can be called by name in your .FLOW script, since the original data is not overwritten when hooking a function. References to the original in the original .BF are simply redirected to your replacement.

the .BF that you're referencing in the .FLOW you're compiling.

the original .BF file.

Now that you know how to (de)compile with , you're ready to read, edit, and create scripts. If you haven't already, read on to see how to use the to make (de)compiling even easier:

📄
AtlusScriptCompiler
compile
compiling
here
procedures
imported
compiling
procedures
imported
procedures
procedure
procedure
Decompile
Import
AtlusScriptCompiler
GUI
Run via GUI