Your First Add-On

Creating FFS add-ons is quick and easy. All you need is a copy of FlyInside Flight Simulator and your favorite text editor!

First things first, as a sim add-on developer, you'll want Debugging Tools enabled for sure. Navigate to "Help -> About -> Usage Options" and check off "Show Debugging Tools". That's it, you'll see a "Debugging Tools" menu appear with a bunch of useful new options!

About Dialog

Now that we're ready to develop, fire up your favorite text-editor and create a file within the Simulator directory Data\Scripts\FirstAddon.chai

Every add-on script needs to contain the following functions:


def onStart()
{

}

def onGraphicsFrame()
{

}

onStart() is called when your script is loaded. onGraphicsFrame() is called every frame. Save these functions into your script, and run FlyInside Flight Simulator. Once the simulator loads, open the "Debugging Tools -> Script Manager" window from the menubar at the top of the screen. You should see your new add-on script listed.

Script Manager

To run your add-on, simply click the checkbox next to it. Because your script is empty, nothing should happen. Let's make it do something!


def onStart()
{
    print("Hello, world!");
}

def onGraphicsFrame()
{

}

Now try again. There's no need to restart the simulator, you can simply check and uncheck the checkbox next to your script.

Script Manager

Before proceeding to the following tutorial, I recommend reading up on ChaiScript. While we cover simulator functions and provide plenty of examples, we don't cover the language itself.

How can you create an add-on which loads with the simulator, instead of needing to open it through the Script Manager every time? Simply name the file "Startup_FirstAddon.chai". FlyInside Flight Simulator will load any script which starts with "Startup_" when the simulator first loads.