Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Overview

If you've ever been frustrated with limitations of prefabs and wanted to use complex logic with a single instance of a prefab without extracting all and losing the benefits of prefabs, then this document is for you!

In flowgraph, you can now communicate directly to and from a prefab instance just like an entity by using prefab events. All you need to do is create an event inside a prefab, give it a name and then reference the prefab instance as you normally do an entity.

Steps to use prefab events

...

  1. Inside any prefab flowgraph, add Prefab:EventSource nodes for each event you want (

...

  1. note:

...

  1. you must be inside a prefab's flowgraph otherwise will get

...

  1. errors)
    Image Modified

...

  1. Assign a name to the event
    Image Modified

...

  1. Outside the prefab's flowgraph, in any entity's flowgraph, select a prefab instance you want to send/receive events from and click "Add Selected Entity":
    Image Modified

...

  1. Connect logic to the prefab instance events
    Image Modified

Important notes

...

  • Whenever deleting Prefab:EventSource nodes, this will remove the event but won't remove flownode port connections to that event. As a rule of thumb, always remove all uses of that event before removing.
  • Always make sure to communicate with other level designers when removing prefab events as you might have removed the event which is referenced in other levels.