Menu
Lumberyard
Legacy Reference

Managing Flow Graph Modules

Flow Graph is deprecated and will be removed in a future version of Lumberyard. Learn about Script Canvas, Lumberyard's new visual scripting environment.

This topic references tools and features that are legacy. If you want to use legacy tools in Lumberyard Editor, disable the CryEntity Removal gem using the Project Configurator or the command line. To learn about the latest features, see the Amazon Lumberyard User Guide.

A module is simply an exported flow graph that can be loaded and called from another flow graph during gameplay.

Any flow graph can be converted to a module by first creating a new module using Flow Graph Editor and then copying the flow graph contents to the new module.

Modules used in multiple levels are called global modules, while modules used only in a specific level are called level modules.

The advantages of using modules include:

  • Flow graphs can be used in multiple levels, but exist in a single location

  • Modules can receive unique input values from their callers, allowing them to be robust

  • Modules can return unique output values to their callers, allowing them to be used in different situations

  • Modules can be instanced, so multiple copies of the same module can be active simultaneously, but running with different inputs

To create or delete a module

In Flow Graph Editor, under Flow Graphs do the following:

  1. To create a module, right click FG Modules, then click New Global FG Module or New Level FG Module as applicable. The new module appears under the Global or Local folders respectively.

  2. To delete a module, right-click the module and click Delete Module.

Module Node Ports

Flow Graph Module nodes have a variety of different of input and output node ports.

All inputs passed to the Call node activates the corresponding outputs on the Start node, and similarly inputs to the End node passes back to the Call node when Success or Cancel are activated.

Module Inputs

  • Call - Call to load and start the module. If the module is already started it triggers the update port of the Start node with updated parameters if not instanced. It is named Module:Call_YourModuleName.

  • Instanced - If set to 1 (default), creates a new independent instance of the module whenever you trigger the Call input port.

  • Cancel - Cancels the module. This requires the correct InstanceID if instanced.

  • InstanceID - Identifies a module instance. A value of -1 (default) creates a new instance; otherwise, it updates the given instance if instanced.

Module Outputs

  • OnCalled - Called when module is started. Returns a value of -1 if the module is not instanced.

  • Done - Called when the module returns with a success status.

  • Canceled - Called when the module returns with a failed status.

You can also customize the inputs and outputs for each module to pass extra data back and forth.

To customize module ports

  1. In Flow Graph Editor, select the module, then click Tools, Edit Module.

  2. In the Module Ports dialog box, click Edit Input or Edit Output as needed, then make a Type selection as follows:

    • Bool

    • EntityId

    • Int

    • Float

    • String

    • Vec3

  3. Click OK to update module nodes with the changes.

On this page: