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
  • Usage
  • Importing Uncompiled Scripts
  • Importing Compiled Scripts
  • Conclusion

Was this helpful?

  1. Scripting
  2. Flowscript

Importing Files

How to include other scripts in your script

PreviousFunctionsNextMenus

Last updated 3 years ago

Was this helpful?

At the beginning of a , you can import a .BF, .FLOW .BMD or .MSG file.

Usage

  • Chaining together multiple .FLOW scripts is a great way to keep your code clean and organized.

  • You can call by name from pre-compiled .BF files and other .FLOW files, and by name (or index) from pre-compiled .BMD files.

Importing Uncompiled Scripts

Suppose the file we are creating is named Experiment.flow, and we want to use a from another (Test.flow).

Suppose we have the following files...

Experiment.flow

(our new .FLOW)

// Import another Flowscript into the script
import( "Test.flow" );

void Main() {
	// Call procedure from the imported FlowScript
	ShowWindow();
}

Test.flow

(The .FLOW we're importing)

import( "Test.msg" );

void ShowWindow() {
	int messageNumber = 2;
	MSG_WND_DSP();
	MSG( messageNumber, 0 );
	MSG_WND_CLS();
}

Test.msg

(The .MSG imported by the .FLOW we're importing)

[dlg FirstMessage] [s]Message 1.[e]

[msg SecondMessage] [s]Nessage 2.[e]

[dlg ThirdMessage] [s]Message 3.[e]

Results

Importing Compiled Scripts

The Importing section of this guide is still incomplete. Pending additional information on the following:

  • Importing Compiled Scripts

    • With .BF and .BMD you can reference procedures, variables and messages by name, but variable names and comments are lost. You can still decompile these to see the message names/indexes and procedure names in order to reference them.

Conclusion

If run in-game, the in Test.bf's embedded .BMD "Message 3." would be shown in a message window.

This is because the integer inShowWindow()is initialized with a value of 2, and then used as the first parameter (required input) in theMSG()function. indexes start at 0, so it'd actually show the 3rd .

Now that you understand pretty much every element of a , we can move on to getting user input with , which is a great place to begin making your own scripts.

📄
flowscript
menus
Menus
Flowscript
procedures
procedure
flowscript
messages
message
Message
message