Importing Files
How to include other scripts in your script
At the beginning of a Flowscript, 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 procedures by name from pre-compiled .BF files and other .FLOW files, and messages 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 procedure from another flowscript (Test.flow).
Suppose we have the following files...

Experiment.flow

(our new .FLOW)
1
// Import another Flowscript into the script
2
import( "Test.flow" );
3
4
void Main() {
5
// Call procedure from the imported FlowScript
6
ShowWindow();
7
}
Copied!

Test.flow

(The .FLOW we're importing)
1
import( "Test.msg" );
2
3
void ShowWindow() {
4
int messageNumber = 2;
5
MSG_WND_DSP();
6
MSG( messageNumber, 0 );
7
MSG_WND_CLS();
8
}
9
Copied!

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

If run in-game, the message 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. Message indexes start at 0, so it'd actually show the 3rd message.

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

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