|
ArticyXImporter
ArticyXImporter for Unreal Engine
|
In articy:draft, you can design complex flows to create branching dialogues, menu systems, AI behavior, and more. These flows consist of nodes, connections, and scripts, enabling you to craft dynamic, interactive systems. Once you've created these flows, you can traverse them inside Unreal Engine using the UArticyFlowPlayer component.
Before diving into how the UArticyFlowPlayer works, let’s clarify some key terms:
Flow traversal is the process of moving through nodes, following connections, and executing scripts. In Unreal, the UArticyFlowPlayer automates this process.
You can attach the ArticyFlowPlayer component to an actor programmatically as follows:
1) Add an ArticyFlowPlayer component to an actor by selecting your actor and clicking Add Component in the Details panel. Search for ArticyFlowPlayer and add it to your actor.
2) In the Details panel, you can set the properties for the ArticyFlowPlayer, such as the start node and the types of nodes it should pause on.
Once attached, the ArticyFlowPlayer will traverse the flow based on the nodes, connections, and scripts defined in articy:draft.
You may want the ArticyFlowPlayer to pause on specific node types, such as DialogueFragment, to handle events like dialogues. You can configure this by using the PauseOn property to specify the node types the player should pause on.
You can configure this in code by setting the PauseOn property:
This tells the ArticyFlowPlayer to pause when it encounters DialogueFragment nodes during traversal.
1) Select your actor with the ArticyFlowPlayer component.
2) In the Details panel, look for the PauseOn property and set the types of nodes to pause on, such as DialogueFragment, FlowFragment, etc.
The ArticyFlowPlayer uses delegates to notify you when it pauses at specific nodes or when new branches are available for traversal.
You can bind functions to the OnPlayerPaused and OnBranchesUpdated delegates as follows:
The HandleFlowPaused method will be called when the flow player pauses at a node:
When the flow player pauses, it gathers all the possible branches (i.e., paths) from the current node. You can handle these branches to display options to the player or make decisions in your game.
1) In the Event Graph, use the OnBranchesUpdated event. 2) Add logic to handle branches, such as showing dialogue options or making gameplay choices.
Once you have the branches, you can continue the flow traversal using the selected branch:
After the flow player pauses, it waits for you to call the Play method to continue traversal. You can call Play with the index of the selected branch.
The ArticyFlowPlayer automatically evaluates scripts attached to nodes or pins during traversal. These scripts can modify global variables, call functions, or evaluate conditions. You don’t need to manually execute scripts — the flow player handles this, but you can access global variables and methods if needed.
The ArticyFlowPlayer in Unreal Engine makes it easy to traverse and interact with flows from articy:draft. By pausing at key nodes and using delegates in C++ or events in Blueprints, you can control how your game handles dialogues, choices, and other flow-based interactions. With built-in support for scripting and global variables, the ArticyFlowPlayer simplifies managing complex branching flows and dynamic game narratives.