Custom Flow node description format

enums = {                                     // Defines file global reusable enums

    <name> = [                                // Name of of the enum
                                              // the node value will be translated from string
                                              // to int using this mapping
        {
            name = "<engine name>"            // Then name of the enum value as known by the engine side

            value = 0                         // Integer value for the enum item
                                              // Optional, if not specified a value will be generated
                                              // using idstring32 of "name"
        }
    ]
}

ui_browse_specs = {
    <name> = {
        ui_browse_function =  "<function>"          // The method in FlowNodeBrowseFunctions to
                                                    // to call to retrieve items to select from.
                                                    // Optional

        ui_browse_title = "<title>"                 // The title of the browser window.
                                                    // If the input type is an enum this changes
                                                    // the UI element from a pop-up menu to a
                                                    // searchable pop-up dialog.
                                                    // Optional

        ui_browse_resource_input = "<input_name>"   // The source input ui_browse_function should
                                                    // use to fetch items from.
                                                    // This is usually a "unit" input
                                                    // Optional

        ui_types =
        [
            "<type>"                                // Extension type to allow, one or more entries
        ]

        // This structure can also contain custom entries that the browse function requires.
    }
}

custom_types = {                                // Defines file global reusable enums
    <name> = {                                  // Name of of the custom type

        type = "<custom_type>"                  // Type identifier which tells editor which
                                                // inputs/outputs matches

        ui_name = "<user interface name>"       // Human readable name for the custom type

        size = n                                // Size of field in bytes
                                                // Default is 4

        align = n                               // Optional. Specify alignement requirement for field
                                                // Default is 4
    }
}

nodes = [
    {
        name = "<engine name>"              // The name of the node type as known by the engine side

        ui_legacy_class = "<class name>"    // If a Node class in editor backend has been replace
                                            // with a definitions driven node class add the
                                            // old class name so migration can be done
                                            // Optional.

        ui_custom_backend_implementation = true/false  // If editor backend has a custom
                                                       // data model implementation for the
                                                       // node type set to true, otherwise
                                                       // editor backend will use the
                                                       // generic flow node implementation
                                                       // Default is "false"

        ui_name = "<user interface name>"   // Human readable name for editor UI

        ui_category = "<category>"          // Hierarchical position in the editor menu UI
                                            // Delimited by forward slash

        ui_brief = "<brief>"                // Brief description for editor UI

        type = "<type>"                     // "simple" or "standard" - a "simple" does not have
                                            // any callback functions
                                            // Default is "standard"

        ui_scopes = {                       // Limits where this node can be used
                                            // If omitted, all scopes default to true
                                            // If empty, all scopes default to false

            UnitFlowEditor = true/false     // Show node type in unit flow editor
                                            // Default is "true"
            LevelFlowEditor = true/false    // Show node type in level flow editor
                                            // Default is "true"
        }

        ui_spawnable = true/false           // Allow node to be created in the editor or not
                                            // Default is true

        inputs = [
            {
                type =                      // C type
                    "event"
                    "unit"                  UnitReference
                    "actor"                 ActorConnector*
                    "mover"                 Mover*
                    "vector3"               Vector3
                    "float"                 float
                    "bool"                  unsigned
                    "string"                FlowString
                    "id"                    FlowId
                    "quaternion"            Quaternion
                    "camera"                Camera*
                    "light"                 Light*
                    "mesh"                  MeshObject*
                    "material"              Material*
                    "resource"              FlowString
                    "enum"                  int
                    "custom"                byte[]
                    "generic"               <input>         // The generic type stores the type
                                                            // information of the input in the
                                                            // static data section, one unsigned for
                                                            // each generic input field
                    "compiletime_string"    char[]          // This does not generate an input field but
                                                            // is used as an input for custom flow node compilers

                resource_type = "<resource_type>"           // Only applicable when type = "resource" or "id"
                                                            // If it is present the value the field has will be
                                                            // added as a resource into the compilation with the
                                                            // type "<resource_type>"
                                                            // Not applicable if the field is defined as "external"

                ui_browse_spec = {}                         // Inline browsable type definition
                                                            // See global definitions for browsable spec
                                                            // Optional.

                ui_browse_spec = "<global_defintion>"       // Use a globally defined browsable spec
                                                            // Optional.

                is_required = true/false                    // Set to true if the input field is required
                                                            // to be either set or connected
                                                            // Optional. Defaults to false

                custom_type = {                             // Inline custom type definition
                }                                           // Only applicable when type = "custom"
                                                            // See global definition for custom types

                custom_type = "<custom_type>"               // Use globally defined custom type definition
                                                            // Only applicable when type = "custom"

                enum = [                                    // Inline enum definition.
                ]                                           // Only applicable when type = "enum"
                                                            // See global definition for enum types

                enum = "<global_enum_name>"                 // Use globally defined enum definition
                                                            // only applicable when type = "enum".
                                                            // The node value will be translated
                                                            // from string to int using this mapping

                ui_name =  "<user interface name>"          // Human readable name for editor UI

                ui_hidden = true/false                      // Defines if the input is shown in the
                                                            // editor user interface

                name = "<engine name>"                      // Name of the input as known by the
                                                            // engine side

                external = true/false                       // If the input source is an external
                                                            // source or a source from the flow itself.
                                                            // Default is "false"
                                                            // Not applicable on event, resource or enum

                required = true/false                       // Does the input have to be set/connected or not
                                                            // Default is false

                ui_initial_value =  <initial_value>         // The initial value of the input data field when
                                                            // the node is created in editor
                    // type       // initial_value_type
                    "float"       float
                    "bool"        true/false
            }
        ]

        dynamics = [    // Local "dynamic" variables are internal to the node implementation and can not be
                        // set externallyfrom editor or other node - they can change value during the
                        // execution of the flow
            {
                type =              // C type           // Default value
                    "unit"          UnitReference       UnitReference(0)
                    "actor"         ActorConnector*     nullptr
                    "mover"         Mover*              nullptr
                    "vector3"       Vector3             vector(0,0,0)
                    "float"         float               0.f
                    "bool"          unsigned            0
                    "string"        char[128]           FlowString
                    "id"            IdString64          FlowId
                    "id32"          IdString32          IdString32()
                    "quaternion"    Quaternion          Quaternion(0, 0, 0, 0)
                    "unsigned"      unsigned            0
                    "camera"        Camera*             nullptr
                    "light"         Light*              nullptr
                    "mesh"          MeshObject*         nullptr
                    "material"      Material*           nullptr
                    "custom"        byte[]              zero

                default_value = (type dependent)                // The default value, used if data_node
                                                                // does not resolve to a value. Optional.

                    vector3:     [float, float, float]          // x, y, z
                    float:       float
                    bool:        int                            // 0 == false, 1 == true
                    string:      string
                    id:          string
                    quaternion:  [float, float, float, float]   // x, y, z, w
                    unsigned:    int

                custom_type = {                                 // Inline custom type definition
                }                                               // Only applicable when type = "custom"
                                                                // See global definition for custom types

                custom_type = "<custom_type>"                   // Use globally defined custom type definition
                                                                // Only applicable when type = "custom"

                data_node = "<path>"                            // The sub-node path which stores the
                                                                // initial value in the level flow source
                                                                // file under the node entry.
                                                                // Optional.
            }
        ]

        statics = [     // local "static" values are internal to the node implementation and can not be set
                        // externally from editor or other node - they are fixed at compile time or load time
            {
                type =              // C type           // Default value
                    "unit"          UnitReference       UnitReference(0)
                    "actor"         ActorConnector*     nullptr
                    "mover"         Mover*              nullptr
                    "vector3"       Vector3             vector(0,0,0)
                    "float"         float               0.f
                    "bool"          unsigned            0
                    "string"        char[128]           FlowString
                    "id"            IdString64          FlowId
                    "id32"          IdString32          IdString32()
                    "quaternion"    Quaternion          Quaternion(0, 0, 0, 0)
                    "unsigned"      unsigned            0
                    "camera"        Camera*             nullptr
                    "light"         Light*              nullptr
                    "mesh"          MeshObject*         nullptr
                    "material"      Material*           nullptr
                    "custom"        byte[]              zero

                default_value = (type dependent)        // The default value, used if data_node
                                                        // does not resolve to a value. Optional.

                    vector3:    [float, float, float]           // x, y, z
                    float:      float
                    bool:       int                             // 0 == false, 1 == true
                    string:     string
                    id:         string
                    quaternion: [float, float, float, float]    // x, y, z, w
                    unsigned:   int

                enum = [                                    // Inline enum definition.
                ]                                           // Only applicable when type = "enum"
                                                            // See global definition for enum types

                enum = "<global_enum_name>"                 // Use globally defined enum definition, only applicable
                                                            // when type = "enum", the node value will be translated
                                                            // from string to int using this mapping

                custom_type = {                             // Inline custom type definition
                }                                           // Only applicable when type = "custom"
                                                            // See global definition for custom types

                custom_type = "<custom_type>"               // Use globally defined custom type definition
                                                            // Only applicable when type = "custom"

                data_node = "<path>"                        // The sub-node path which stores the initial value in the
                                                            // level flow source file under the node entry. Optional.
                                                            // Path is forward slash delimited
            }
        ]

        outputs = [
            {
                type =              // C type           // Default value
                    "event"         OutEvent            n/a
                    "unit"          UnitReference       UnitReference(0)
                    "actor"         ActorConnector*     nullptr
                    "mover"         Mover*              nullptr
                    "vector3"       Vector3             vector(0,0,0)
                    "float"         float               0.f
                    "bool"          unsigned            0
                    "string"        char[128]           FlowString
                    "id"            IdString64          FlowId
                    "quaternion"    Quaternion          Quaternion(0, 0, 0, 0)
                    "camera"        Camera*             nullptr
                    "light"         Light*              nullptr
                    "mesh"          MeshObject*         nullptr
                    "material"      Material*           nullptr
                    "event_array"   OutEvent[n]         n/a
                    "custom"        byte[]              zero

                ui_name = "<user interface name>"       // Human readable name for editor UI

                name = "<engine name>"                  // Name of the input as known by the engine side

                data_update = "push"/"query"            // Update type, for the output, default is "push"
                                                        // Not applicable for event type

                external = true/false                   // If the input source is an external source or a source
                                                        // from the flow itself. Default is "false"
                                                        // Not applicable for resource or enum

                default_value = (type dependent)        // The default value, used if data_node does not resolve
                                                        // to a value. Optional.

                    vector3:     [float, float, float]        // x, y, z
                    float:       float
                    bool:        int                          // 0 == false, 1 == true
                    string:      string
                    id:          string
                    quaternion:  [float, float, float, float] // x, y, z, w

                custom_type = {                         // Inline custom type definition
                }                                       // Only applicable when type = "custom"
                                                        // See global definition for custom types

                custom_type = "<custom_type>"           // Use globally defined custom type definition
                                                        // Only applicable when type = "custom"

                data_node = "<path>"                    // The sub-node path which stores the initial value in the
                                                        // level flow source file under the node entry, or where the
                                                        // array of output event names are listed.
                                                        // Path is forward slash delimited
                                                        // Optional.
                                                        // For type "event" where "external" is true and
                                                        // data_node is not given the registered name of the
                                                        // event will be the node "type" value.
            }
        ]

        dependencies = [
            {
                type = "<action>"                       // The type of action to do for the dependency
                                                        // Set to "include" or "preload"

                resource_type = "<resource_type>"       // Resource type

                data_node = "<path>"                    // The sub-node path which stores the name of the resource in
                                                        // the level flow source file (under the node entry)
                                                        // Path is forward slash delimited
            }
        ]

        nested_flow = {                                 // Indicate that flow can have nested flow
            input_filter = [                            // A list of names of inputs that should be filtered out
                                                        // To have no filter, omit the input_filter section

                "<input name>"                          // Name of variable to filter out
                                                        // See inputs = [ { name = "input name") ]
            ]
            output_filter = [                           // A list of names of outputs that should be filtered out
                                                        // To have no filter, omit the output_filter section

                "<output name>"                         // Name of variable to filter out
                                                        // See inputs = [ { name = "input name") ]
            ]
        }
    }
]