Anatomy of a Sequence - Kizari/Flagrum GitHub Wiki

Introduction

Let's break down the components that make up a sequence.

We'll be referring to the same sequence that was shown in the previous article:

Sequence Script

If you'd like to follow along, this script can be imported from your exported XML scripts in the following location:

/data/character/nh/nh02/script/nh02_initialize.xml

This sequence is Prompto's initialisation script. It is loaded whenever Prompto spawns in the main game.
 

Nodes

First you have "nodes," which are the boxes on the node graph. These all serve very different purposes depending on the type of node that they are. Below is an example of a node.

A Node

The node has an icon that symbolises the type of node it is, a title that briefly explains its purpose, and a number of "pins" that other nodes can connect to. A node also may contain a number of properties. If you click on a node, you can see these properties in the "inspector" panel inside Lucent.

Node Properties

Clicking on the name of any of these properties will load a description of what the property does in the inspector if one is available. Just be aware that not all of these descriptions have an English translation at this time. You may also change the values of these properties to alter the behaviour of the node, but it is important to only do so if you have a rough idea of what you're doing as this can break the script if you're not careful.
 

Pins

Pins are the shapes inside the nodes that can connect to other nodes. A pin has a label that defines its purpose, a type that is defined by its shape and colour, and may have zero or more connections to other nodes. You can also click on the pin's label to see a description of what that pin does, and the properties associated with it.

Pin

There are two types of pins.

1. Trigger Pins

Trigger pins are the square pins with the ice blue colour. Only other trigger pins may connect to a trigger pin. These connections have an arrow head at the end to help the user visualise the order that nodes will we executed when the script runs. This sequence of events is called "control flow." One sequence can have many different control flows active at any given time, as a script may define many different triggers, all of which will start their own control flow when triggered. A control flow may also branch into multiple parallel sequences.

In our example, there are three nodes that start their own control flow. You can tell this is the case as they only have trigger pins leaving the node, but none entering it. The first is the Start of Sequence node.

Start of Sequence

This is a special node that is triggered the moment the script is loaded. As mentioned earlier, this script is loaded whenever Prompto spawns in the main game—therefore, this control flow will execute when Prompto spawns, which so long as he is with the party at the time, will be whenever the game loads into an area. This control flow will only execute once.

The other two triggers that start control flow are these two Trigger nodes.

Triggers

As you can see by the control flow leaving the RemoteEvent pin, these control flows will execute whenever the matching remote event is triggered. If you look across to the inspector, you'll notice that there's an EventId property with the value NH02_HANDLIGHT_ON. This means that the event that will trigger this control flow is when Prompto needs to turn his light on. The control flow then enters the On trigger pin of the Switch manual player light node, which will turn his light on. Super simple! The other trigger is simply the exact same, except for NH02_HANDLIGHT_OFF and it'll turn the light off as it leads to the Off trigger pin instead.
 

2. Variable Pins

Variable pins are the circle pins. These pins can be more complicated than trigger pins as only certain variable types are compatible with other variable types. A good rule of thumb is that if you're unsure or unwilling to experiment, it's best to only connect pins of the same colour together. The purpose of these pins is to provide values to other nodes in the sequence.

Back to our example, the purple Actor pin is providing a value to Switch manual player light to tell the game whose light to turn off.

Variable Pin

We can see that this value is coming from the ActorObjectVariable node. This node is able to get a reference to certain actors in the currently loaded game scene, the options of which are shown in the dropdown menu in the inspector when the node is selected. We can see for this node that the actor in question is ACTOR_MYSELF. This is a special type of reference as it refers to the owner of the script that the node is placed inside of. In this case, we know this is Prompto's initialisation script, so this is getting a reference to Prompto. As such, we now know that when Switch manual player light is executed, it will specifically turn only Prompto's light on and off.
 

Trays

Trays are the larger nodes with customisable colours. These also have a different icon on the node header so that they're easily distinguished from other nodes. Trays are special in that they can contain entire sequences of nodes within themselves.

Tray

The tray in our example is very simple. It has only one pin, which is the In trigger pin. This pin simply passes control flow to the inside of the tray when the flow reaches that point in the script. You can click the Open in a New Tab button on the tray to see what's inside. The inside of this tray looks as follows:

Inside Tray

Notice the Tray Inputs node at the top-left of this node graph. That In pin matches the In pin your saw outside the tray, so this is where the control flow continues once inside the tray.
 

Portals

Portal nodes are the bright purple nodes and also have a unique icon to differentiate them from other nodes. These nodes exist purely for the purpose of making the node graphs tidier. These are usually used when the control flow needs to go backwards, as they look much nicer than dragging an arrow back across the whole graph.

Portal Node

In this example here, you'll notice that the Delete Actor node at the end has its control flow exit into the portal. Take note that both portals in this graph are part of Group 0. This is how you know that they are connected, as some graphs may have multiple portals. The control flow that enters the In pin of a portal, will leave through the Out pin of its matching portal in the same group, so you can follow it in this manner. In this case, that means after Delete Actor, the control flow will continue at Dummy on the left side of the graph.
 


< Previous: Introduction to Visual Scripting
> Next: Removing Existing Behaviour

⚠️ **GitHub.com Fallback** ⚠️