Skip to content

Workflows overview

Anu Vogel edited this page Aug 11, 2020 · 3 revisions

Workflows are the engine to make your creations more dynamic. It's through workflows that you can display text, play sounds, or navigate between quests.

The workflow is a simple list of elements that will be executed sequentially when the workflow is run.

An workflow element can be:

  • An effect (display a text, play a sound, go to a quest step ...)
  • A condition, to interrupt a workflow execution
  • A delay, to hold a workflow execution

An example workflow

Create a workflow

A workflow can be created inside any types of creations, in the workflows tab (Note: for items in Normal mode, the workflows tab is only visible when enabling the "usable" attribute).

From there you can create workflows. Each workflow is bound by an ID of your choice. You can't have two workflows in the same creation using the same ID. The workflow ID should always represent what the workflow does, so avoid naming your workflow "workflow_1". ;)

From the workflows list on the left you can right-click on a line to edit the ID, remove or copy/paste the content of a workflow.

Note that if you are editing an item in Normal mode, you are limited to only one workflow : the one executed when using the item. To support multiple workflows for an item, upgrade it to Expert mode.

Edit your workflow

Once your workflow is created and selected, you can start adding element to it. You can always change the elements order afterward, so don't worry about that when you create them.

The different workflow blocks

Effects

The effects are the dynamic system of workflows, producing plenty of ... well ... effects. :-)

You can select an effect in the the drop list. If the effect is configurable, its editor will appear. You can always edit an effect afterward by selecting it in the workflow.

Any effect element in the workflow can be conditioned individually to prevent it to be played. It won't stop the workflow execution per-say, but will prevent this particular effect to be played. To condition an effect element, right-click on it and select "Edit effect condition" (or alternatively, you can ctrl+click on the element).

An example effect

Conditions

Condition elements are a way to stop the execution of your workflow. As the workflow is executed element by element, from top to bottom, when it reaches a condition element it tests the entire condition configuration. If the condition fails, the workflow execution is stopped and no further elements will be played.

An example condition

You can find more information on conditions in this article.

Delays

Delay elements can hold the execution of a workflow for a number of seconds.

Delays can also be attached to an "interruption" mechanism. For now there is only "interrupt on move". If you select it and that the player moves during the delay, the delay will be interrupted and the workflow execution will be stopped. It's useful to simulate spell casting, among other things.

An example delay

The workflow execution

Now you have a workflow, but how do you run it? A workflow execution can be "triggered" in multiple ways.

The easier and more common way is the "On Use" event for items that is automatically triggered when right-clicking on a usable item in the player's inventory.

But each creation type can trigger workflows in different ways. One common way is to go through the Event link tab. There you will be able to link workflow to events specific to your creation. For instance, items will have their "on use" event but also a "on stack destroy" event. Each event in the Event link tab is well documented when you hover the icon, explaining to you when/how they are triggered and under which conditions.

Object events for an expert item

Campaign, quest and quest step also support Game event link. You can find them too in the Event link tab. Game event links allow you to bound a workflow to an event triggered by the game itself. For instance, the event PLAYER_STARTED_MOVING is triggered every time the player's character start moving. You can attach a condition to any link, allowing you to keep the condition out of the workflow to keep it clean.

You can find the complete list of game events here. Hint to find an event: enter /etrace in the chat, it will prompt the game event tracer. Do the action you would like to link to and see if it triggers an event.

Total RP 3 : Extended also gives access to a couple of custom events for which you can find documentation here.

An example game event

For campaign, quest and quest step, you can also use the Action system (in the Actions tab). When a campaign is active, the player can performs 4 types of actions: Listen, interact, speak and inspect. The Actions tab allow you to attach workflow to these actions. You can attach a condition to any link, allowing you to keep it out of the workflow to keep it clean.

The actions tab

Finally, the documents can trigger workflows with the link text tag. If you have a workflow named "w_doc_link" in your document and place in the document text a tag {linkw_doc_linkClick me!}, the workflow will be executed when the player click on the link in the document. It's a cool way to make interactions with your documents.

A link tag used in a document