VFX API

The Microsoft Flight Simulator VFX API permits you to spawn visual effects that have previously been defined using The Visual Effects Editor.

 

The functions available for this API are as follows:

 

Function Description
fsVfxSpawnInWorld Spawn a VFX instance somewhere in the world.
fsVfxSpawnOnSimObject Spawn a VFX instance on a SimObject.
fsVfxPlayInstance Start a VFX instance playing.
fsVfxStopInstance Stop the given VFX instance from playing (this does not remove any particles that have already spawned).
fsVfxDestroyInstance Destroy the given VFX instance, removing any spawned particles from the simulation.
fsVfxIsInstancePlaying Check if the given VFX instance is playing or not.
fsVfxIsMinTimePassed Check if the minimum emission time specified in the spawn function has passed or not for the given VFX instance.
fsVfxIsValid Check if the given FX instance ID is valid.
fsVfxSetOffset Set the offset of the VFX.
fsVfxSetWorldPosition Set the Latitude, Longitude and Altitude of the VFX.
fsVfxSetRotation Set the rotation of the VFX.

 

You can find a sample project to use as a reference when using the VFX API here:

 

 

Typedefs

When using this API the following typedefs exist to help:

 

  • typedef unsigned long FsSimObjId;
    FsSimObjId: the ID of a SimObject. You can use 0, which is considered a "special" value that will always correspond to the current user SimObject ID.

 

  • typedef long long FsVfxId;
    #define FSVFXID_NULL 0xffffffff
    FsVFXId: the ID of a previously defined VFX.
    FSVFXID_NULL: this is a null ID macro, which will be return by the spawn functions if something has gone wrong.

 

  • typedef struct {
        const char* paramName;
        const char* RPNExpression;
    } FsVfxGraphParam;
    FsVfxGraphParam: a struct that contains the following parameters (used to set the values in a GraphParameter node):
    • paramName: the name of the graph parameter.
    • RPNExpression: an RPN expression.