> For the complete documentation index, see [llms.txt](https://docs.shrinefox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shrinefox.com/flowscript/flowscript/importing.md).

# Importing Files

How to include other scripts in your script

At the beginning of a [**Flowscript**](/flowscript/flowscript.md), 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.<br>
* You can call [**procedures**](/flowscript/flowscript/procedures.md) by name from pre-compiled `.BF` files and other `.FLOW` files, and [messages](/flowscript/messagescript.md#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](/flowscript/flowscript/procedures.md) from another [flowscript](/flowscript/flowscript.md) (**Test.flow**).

Suppose we have the following files...

#### **Experiment.flow**

(our new `.FLOW`)

```c
// 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*)

```csharp
import( "Test.msg" );

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

```

#### **Test.msg**&#x20;

**(**&#x54;he `.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](/flowscript/messagescript.md#messages) in **Test.bf**'s embedded `.BMD` "*Message 3.*" would be shown in a message window.

{% hint style="info" %}
This is because the integer i&#x6E;**`ShowWindow()`**&#x69;s initialized with a value of 2, and then used as the first **parameter** (required input) in th&#x65;**`MSG()`**&#x66;unction. \
[Message](/flowscript/messagescript.md#messages) indexes start at `0`, so it'd actually show the 3rd [message](/flowscript/messagescript.md#messages).
{% endhint %}

### Importing Compiled Scripts

{% hint style="danger" %}
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.
    {% endhint %}

## Conclusion

Now that you understand pretty much every element of a [flowscript](/flowscript/flowscript.md), we can move on to getting user input with [**menus**](/flowscript/flowscript/menus.md), which is a great place to begin making your own scripts.

{% content-ref url="/pages/-Mh8hEH8cLJUnqDfRZU-" %}
[Menus](/flowscript/flowscript/menus.md)
{% endcontent-ref %}
