articy:draft

(Click Here For Importer Video Tutorial)

The Dialogue System can import Nevigo's articy:draft 1, 2, & 3 at design time in the Unity editor and at runtime.

To minimize build sizes and compile times for developers who don't use articy:draft, support for articy:draft must be separately enabled. To enable support, select Tools → Pixel Crushers → Dialogue System → Import → articy:draft. If support has not been enabled yet, this will ask if you want to enable support.

The Dialogue System does not use articy:draft 3's Unity exporter. You do not need to import articy's special unitypackage plugin for its Unity exporter. We may introduce support for articy's Unity exporter in the future, but for now it's not necessary.

articy:draft Projects

The Dialogue System includes a starter project in Templates ► Articy Draft Template Project ► articy_template.zip. The template is made in articy:draft 2.4 for compatibility with 2.4 and 3.x users. This project is configured with all of the custom fields described below.

The Dialogue System's imports data from XML exports. It imports the following data:

General Data Notes

Each imported element will have a field named Articy Id containing the articy:draft Id (e.g., 0x01000001000011FB) and a field named Technical Name containing the technical name (e.g., "Loc_Corridor").

The Name field will contain the element's default Display Name.

All imported elements will also be given all the fields defined in the dialogue database template, which you can edit using the Templates tab before importing the articy:draft project. If you define new fields in articy draft, replace blank spaces in their technical names with underscores (e.g., "Alternate_Name").

Your player entity should have a Boolean property named IsPlayer set to True.

articy:draft Variables

Variable sets and variables are imported as elements in the Dialogue System's Variable[] Lua table, where the name of the variable is VariableSet.VariableName. For example:

  • articy:draft:
    • Variable set: GameState
    • Variable: therapist_down
  • Dialogue System: Variable["GameState.therapist_down"]

At runtime, the Dialogue System will create the variables are listed in Special Variables if they don't exist. You can define them ahead of time in articy so you can use them in your content and test them in articy's presentation mode.

articy:draft Entities

In the Dialogue System, articy:draft entities can be any of the following:

  • Players
  • NPCs
  • Items
  • Quests

You can distinguish between Players, NPCs, Items, and Quests by adding any of these Boolean properties to the entity's feature template:

  • IsPlayer
  • IsNPC
  • IsItem
  • IsQuest

The property's Technical Name must use the exact capitalization as above with no space characters. If any of these properties exists, they will override the pop-up menu setting in the articy:draft Import Window.

Note: Your player entity should have a Boolean property named IsPlayer set to True. The IsPlayer property distinguishes to the Dialogue System which dialogue fragments are shown as subtitles and which ones are shown in player response menus (IsPlayer fragments).

Item and Quest Entities

Item and Quest entities are imported as elements in the Dialogue System's Item[] table. This table is also used for quests, and in Lua has an alias as Quest[]. In your Lua code, you can use Item[] or Quest[] interchangeably.

If you want to use the Dialogue System's Quest Tracker HUD, add these Boolean properties:

  • Trackable: If true, the player is allowed to toggle quest tracking for this quest.
  • Track: If true, show the quest in the quest tracker HUD. (Trackable must also be true.)
  • Abandonable: If true, the player can abandon the quest using the quest log window.

You can also add these optional properties to quests:

  • Success_Description: Shown when the quest is in the success state.
  • Failure_Description: Shown when the quest is in the failure state.
  • State: The starting state of the quest. This can be set two ways:
    1. A string set to "unassigned", "active", "success", "failure", or "abandoned", or
    2. A dropdown using the values in the table below.
  • Entry_Count
  • Entry_#: The text for a quest entry (starting from Entry_1, ...)
  • Entry_#_State: The starting state for a quest entry (starting from Entry_1_State). Uses the value types as the quest's main State property.

Quest State Dropdown Values

Value State
1 unassigned
2 active
3 success
4 failure
5 abandoned

The dropdown values must be exactly the numbers shown above (1, 2, 3, etc.).

NOTE: A bug in articy:draft 2.4.3 - 2.4.5 causes dropdown values to be offset by one. To resolve this, upgrade to 2.4.6+.

Actor Entities

Player and NPC Actor entities are imported as elements in the Dialogue System's Actor[] table. Portrait images (if specified) will be imported from the location specified in the articy:draft project, as long as that location is inside the Unity project's Assets folder. If not, you can manually assign them after import.

To assign additional, alternate portrait images, add a Strip whose technical name is exactly AlternatePortraits (exact capitalization, no space) to your entity template, and assign images to it.

The Dialogue System will try to match the characters' GameObject names with their entity Display Names in articy:draft. It's simplest to keep these the same.

At a minimum, you should define at least two Actors (usually the Player and an NPC).

articy:draft Locations

Locations are imported as elements in the Dialogue System's Location[] table. The Dialogue System doesn't use locations for anything specific. You can store whatever information you want in them.

articy:draft Flow Fragments

Flow fragments can be handled three different ways. You can specify which way with a popup menu:

  • Conversation Groups: Flow fragments are prepended to conversation titles. This allows you to use flow fragments to organize conversations in groups.
  • Quests: Flow fragments are treated as quests. They're imported as elements in the Dialogue System's Item[] table as quests.
  • Ignore: Flow fragments are ignored.

Flow fragments inside conversations will be imported as pass-through dialogue entries. However, in the importer you can also choose to have them invoke a Lua function. The dialogue entry will pass the name of the flow fragment to the Lua function. You can register a custom Lua function and use this feature to invoke your own C# code when the conversation passes through a flow fragment.

articy:draft Dialogues

Dialogues are imported as defined in articy:draft, into the Dialogue System's Conversation[] table, with the following notes:

  • Dialogue Fragments, Hubs, Jumps, and Connections within the Dialogue are imported normally.
  • Jumps that go outside the Dialogue are imported in Dialogue System 1.5.8+. In earlier versions of the Dialogue System, these jumps are not imported.
  • Dialogue Fragments that are only connected from Jumps or other links originating outside the dialogue will be imported, but they will show up as "Orphaned". You can link them manually after import if desired.
  • Condition nodes will be converted into two dialogue entries in the Dialogue System's dialogue database: one for the true state, one for the false state.
  • Instructions will be converted into a group dialogue entry that acts as a passthrough to run the instruction node's expression.
  • In articy:draft 2.4+, the Dialogue System will import the correct order of response nodes as indicated by the vertical position of the nodes on articy's canvas. Earlier versions of articy:draft (pre-2.4) do not export this information, so it's not possible to import it into the Dialogue System; instead, nodes will generally be ordered in the order they were created in articy.
  • All localization will be imported. (If you're using articy:draft's Unity exporter to export an Excel spreadsheet for localization, please read Localization in articy:draft)
  • In your dialogue text, you can use several Markup Tags.
  • If you're using Unity UI, you can use bold, italic, and color rich text codes, as well as some special timing codes described in the Typewriter Effect section.
  • Assign the main actor and conversant to the Dialogue. You don't have to include all of the actors if your dialogue has more than two actors; you only need to specify the main actor and conversant. For example, this Dialogue includes the actors "Player" and "Private Hart":
  • If you use conditionsSimStatus: If you cross conversations (for example, using a Jump node), add a dialogue fragment with no SimStatus condition just after the jump: conversation A -> jump to dialogue fragment (with no condition) in conversation B -> dialogue fragment (with SimStatus condition) in conversation B. This is because the Dialog[] table (which holds the current conversation's SimStatus values) is not updated until after the Dialogue System has switched to the new conversation, but the Conditions on the cross-conversation destination node must be checked before crossing into the new conversation. By jumping to a node without a SimStatus condition, you allow the Dialogue System to cross into the new conversation and update the Dialog[] table before nodes in the new conversation check the table.

ConversantEntity Property

In a Dialogue Fragment, the entity spoken to is called the conversant. Normally the conversant is the non-speaking actor (for this fragment) among the two actors assigned to the Dialogue. However, if you want to assign a different actor as the conversant, add a custom slot property named "ConversantEntity" to your dialogue fragment template. The Technical Name must be "ConversantEntity" with exact capitalization and no blank spaces. For the property's "Allowed object types", tick only "Entities". Make sure to tick "Add to XML-export".

Sequence Property

You can define Cutscene Sequences in the Stage Directions field or, if you want to use the Stage Directions field for something else, add a custom text property named Sequence to your dialogue fragment template. In this case, the Technical Name must be "Sequence". If you leave this field blank for any dialogue fragments, the Dialogue System will use the default sequence defined in the Dialogue Manager's display settings.

To specify a sequence for a conversation's <START> entry, add a custom text property named Sequence to your dialogue template.

Conditions & Scripts

You can specify conditional logic and code exeuction using regular articy:draft input and output pins, Condition nodes, and Instruction nodes. However, you can also define custom properties "Conditions" and "Script" which will import into the Dialogue System as dialogue entry Conditions and Script fields.

Conversation Override Properties

You can define any of these properties in a Dialogue to override the conversation's behavior in the Dialogue System:

Technical Name Purpose
ShowNPCSubtitlesDuringLine (Boolean) Show NPC subtitles during NPC lines
ShowNPCSubtitlesWithResponses (Boolean) Show NPC subtitles when response menu is visible
ShowPCSubtitlesDuringLine (Boolean) Show PC subtitles during PC lines
SkipPCSubtitleAfterResponseMenu (Boolean) Skip PC subtitle if it was chosen in a response menu
SubtitleCharsPerSecond (Number) Subtitle chars per second value used to compute {{end}}
MinSubtitleSeconds (Number) Min subtitle seconds value used to compute {{end}}
ContinueButton (String) Any of the values listed in PixelCrushers.DialogueSystem.DisplaySettings.SubtitleSettings.ContinueButtonMode
DefaultSequence (String) Override Dialogue Manager's Default Sequence
DefaultPlayerSequence (String) Override Dialogue Manager's Default Player Sequence
DefaultResponseMenuSequence (String) Override Dialogue Manager's Default Response Menu Sequence
AlwaysForceResponseMenu (Boolean) Always force response menu; if false, auto-selects when there is only one response
IncludeInvalidEntries (Boolean) Show responses whose Conditions are false, in a disabled state
ResponseTimeout (Number) Set timeout value of response menu; zero for no timeout

articy:draft Expressions

articy:draft 1 input and output pins will be imported as-is, assumed to be written in Lua.

articy:draft 2 & 3 input and output pins that contain articy:expresso code will be imported, and the Dialogue System will attempt to translate the expressions to Lua. If the expressions already appear to be written in Lua, they'll be imported as-is.

Note about comments:

  • Comments of the form // (two slashes) will be imported as , indicating a Lua comment.
  • Comments of the form /// (three slashes) will remove the three slashes and handle the rest as Lua code. This way you can write pure Lua code, preceded by ///, without articy:draft complaining about articy:expresso syntax errors.

To use getObj(), getProp(), setProp(), and speaker as detailed in https://www.articy.com/articy-importer/unity/html/howto_script.htm#propertyAccess add an Articy Lua Functions component to your Dialogue Manager (Component → Dialogue System → Third Party → articy:draft → Articy Lua Functions).

Note that articy:draft treats Articy Ids such as "0x0100000000000731" as a hex number (e.g., equivalent to 72057594037929777 decimal). The Dialogue System, however, treats Articy Ids are strings. To ensure proper matching, please use hex for Articy Ids and/or just treat them as strings.

Link Priorities

In the Dialogue System, links (equivalent to articy:draft connections) have priority values. The default priority value is Normal.

When the Dialogue System evaluates a level of the conversation tree, it first considers all dialogue entries at the highest priority level. If there are any dialogue entries with true conditions at this level, it stops evaluating, and it only uses those dialogue entries. If no dialogue entries are true at the highest priority level, it considers the next priority level, and so on. This allows authors to write a line that always takes precedence over lower-priority lines as long as its condition is true.

To specify priority levels in articy:draft, the Dialogue System uses colors. To set a priority level in articy:draft, select a connection and then change the color to one of the colors on the bottom row of the color picker, starting from the second button on the left. Any color other than the ones below is treated as Normal priority.

Color Priority Level
#FF0000 High
#FFC000 Above Normal
(any other) Normal
#FFFF00 Below Normal
#92D050 Low

Note: articy:draft versions 3.1.11 and older have a bug with colors (https://www.articy.com/help/Changes_3_1.html#3_1_12) You must update to 3.1.12 or higher. If you are using the multi-user server version of articy, you must also upgrade the server to 2.1.12 or higher.

articy:draft Templates, Features, and Properties

In articy:draft 2+, you can define templates to apply to elements such as Entities and Dialogues. These templates can contain properties and features (groups of properties). All features and properties are converted to dialogue database fields, with these notes:

  • Booleans, numbers, strings, and localizable text are imported.
  • For localizable text properties, all localized strings are imported.
  • Enums can be imported as their string values or index numbers, where 0 is the first enum value, 1 is the second enum value, etc.
  • Slots are imported as strings containing the DisplayName of the referenced object.
  • Strips are imported as special text fields that can expand into Lua subtables at runtime.
  • Since articy:draft Technical Names can't have spaces, use underscores instead where needed, for example if you're defining quest properties like Success_Description, Entry_Count, etc.
  • Make sure you've ticked "Include in XML Export" when defining your property.

As mentioned in the articy:draft Entities section above, if you add an "IsPlayer" Boolean property to actor entities. Set it to true for player characters, false for NPCs.

Strips Are Lua Subtables

Strips are imported as text fields with the text "SUBTABLE__" added to the front of the field title. The content of the text field is a semicolon-separate list of Articy Ids, such as:

0x0100000000000260;0x0100000000000264;0x0100000000000B6D

At runtime, you can import all such fields into Lua subtables by calling the method below. The subtable field's title will not have the "SUBTABLE__" prefix.

PixelCrushers.DialogueSystem.Articy.ArticyTools.InitializeLuaSubtables();
Definition ArticyConverterWindowDisabled.cs:8
Definition DemoInputRegistration.cs:4
Definition MessageEventsEditor.cs:7

To get the values of the subtable, which will in turn be elements in the Actor[] or Item[] table, use DialogueLua.GetActorField or DialogueLua.GetItemField:

var ensnareSpellEffects = DialogueLua.GetItemField("Ensnare", "Effects").AsTable;

articy:draft Documents

The Dialogue System supports dialogues inside documents. Dialogue fragments must be located inside dialogues. The importer will ignore loose dialogue fragments that are in documents but not in dialogues within those documents.

Emphasis Settings

The Dialogue System supports four Emphasis ([em#]) Markup Tags. You can define variables in your articy project to specify the values of the emphasis tags. For each emphasis tag, you can define four variables for color (a string using #rrggbbaa format), bold, italic, and underline (Booleans).

You can then specify these variables in the articy:draft importer window's Review → Emphasis Settings section.

Voice-Over Plugin

articy:draft 3 has a voice-over plugin. For instructions on using this plugin with the Dialogue System, see articy:draft Voice-Over Plugin Instructions.

Localization Plugin

articy:draft 3 has a localization plugin. For instructions on using this plugin with the Dialogue System, see Localization in articy:draft.

articy:draft Import Window

To import your articy:draft project into the Dialogue System:

  1. In articy:draft, export the project to an XML file. Make sure "Export XML Namespace" is ticked. (Note: In version 2.0.1+, you can export markup tags. The importer will convert them into rich text codes.)
  2. Select Tools → Pixel Crushers → Dialogue System → Import → articy:draft to open the articy import window.
  1. articy:draft Project: Select your XML file.
  2. Encoding: (Optional) Specify the XML file's character encoding type. If importing special characters (such as umlaut), change Encoding to UTF8.
  3. Stage Directions are: (Optional) If you used the Stage Directions field for sequencer commands, select Sequences. If you created a new template field named "Sequence", select Not Sequences.
  4. Dropdowns as: (Optional) Specify how to you want to import dropdowns (enums) – as their technical names, display names, or their index values. (NOTE: A bug in articy:draft 2.4.3 - 2.4.5 causes dropdown values to be offset by one. To resolve this, upgrade to 2.4.6+.) You can also specify types for individual dropdowns in the Dropdown foldout further down the window.
  5. Slots as: (Optional) Specify how to you want to import slots – as their display names or their articy internal IDs.
  6. FlowFragments are: (Optional) Specify how you want to handle flow fragments.
    • Nested Conversation Groups: Prepend flow fragment's name to titles of subconversations, and create links into subconversations.
    • Conversation Groups: Prepend flow fragment's name to titles of subconversations.
    • Quests: Create quests out of flow fragments.
    • Ignore: Ignore flow fragments.
  7. FlowFragment Script: (Optional) Enter the name of a Lua function to run it when a flow fragment occurs inside a dialogue.
  8. Use Technical Names: Name dialogue database elements by their articy technical names instead of their display names.
  9. Set Display Name: Sets actor and quest Display Name fields to the articy entity's default name. Otherwise only the Name fields will be set.
  10. Custom DisplayName: Sets actor and quest Display Name fields to the value of a custom articy property whose technical name is "DisplayName" (no space).
  11. Conv. Links To Entry 1: When a link points to a conversation's START, point it to the first entry instead.
  12. Documents Submenu: When converting documents to conversations, group them under this submenu heading. Leave blank for no submenu.
  13. TextTable Document: (Optional) If specified, put the contents of this document in a Text Table (see Text Tables).
  14. VoiceOverFile Property: (Optional) If you use the articy:draft Voice-Over Plugin Instructions, specify the name of your voice-over file property. Don't enter the entire path including the feature name; only enter the property name.
  15. Portrait Folder: (Optional) Specify the folder containing the the actor portrait images defined in articy:draft. If you didn't specify actor portrait images, or if you don't want to display character portraits beside subtitles, you can leave this blank.
  16. Save To: Select the folder where you want the dialogue database to be created.
  17. Overwrite: Tick if you want to overwrite an existing dialogue database (if one exists).
  18. Click Review. This will load the articy:draft XML data for you to review. Open each foldout as shown in the screenshot below.
  1. Tick the items you want to import, and untick the items you want to skip. In Entities, change the player's pop-up from "NPC" to "Player" so the importer knows which entity to treat as the player. If you've defined an "IsPlayer" template property for characters, the template property value will override this pop-up. articy:draft 1.x doesn't provide a good way to automatically distinguish actors from items, so you'll also have to select the appropriate categories using the pop-ups.
  2. The importer will remember your settings the next time you open the window. In the future, you can skip the Review button unless you want to change your settings or reload changes from the XML file. (To clear the settings and start over, click the Clear button.)
  3. Click Import to create the dialogue database. After importing, if you change your articy:draft project and re-export it, click Review before Import to refresh the version of the XML file that's cached in the importer's memory.

Runtime Conversion

You can also import articy:draft XML files into dialogue databases at runtime. To do this, call this static function:

ArticyConverter.ConvertXMLToDatabase(string xmlFilename, ConverterPrefs prefs = null, Template template = null)

For example, to import D:\Data\MyArticy.xml:

var xmlData = System.IO.File.ReadAllText("D:\\Data\\MyArticy.xml");
var database = ArticyConverter.ConvertXmlDataToDatabase(xmlData);

The prefs and template parameters are optional.

The prefs object lets you specify which articy:draft content to import and how to import it. Since the runtime project doesn't have access to the Unity editor environment, it won't use any prefs you've already set in the articy:draft Import Window. If you omit prefs, all supported content will be imported.

The template specifies the templates for the various types of assets in the dialogue database. Since the runtime project doesn't have access to the Unity editor environment, it won't use the template you've set in the Dialogue Editor. If you omit template, it will use a default template.

If portrait images are associated with actors in the XML file, the importer will search all Resources folders and loaded asset bundles.

If conversion fails, the method will return null instead of a dialogue database object.

Full Code Example

The code below contains a complete example of importing an articy:draft XML at runtime:

using PixelCrushers.DialogueSystem;
using PixelCrushers.DialogueSystem.Articy;
...
var xmlData = System.IO.File.ReadAllText("D:\\Data\\MyArticy.xml");
var database = ArticyConverter.ConvertXmlDataToDatabase(xmlData);
A static class that provides a simplified interface to the Dialogue System's core functions.
Definition DialogueManager.cs:14
static void AddDatabase(DialogueDatabase database)
Adds a dialogue database to memory.
Definition DialogueManager.cs:312
static void SendUpdateTracker()
Sends an "UpdateTracker" message to the Dialogue Manager, which may have a quest tracker component th...
Definition DialogueManager.cs:1157

The code above creates a DialogueDatabase from an articy:draft file, adds it to the Dialogue Manager, and updates the quest tracker HUD in case the articy:draft file contains active, trackable quests.

Converting Expressions

The importer converts pins from articy expresso to Lua. If you want to convert additional fields, call ArticyConverter.ConvertExpression. You must have previously imported an articy XML file. The importer will cache the variable names from the XML file conversion to use when converting other expresso code.

var luaCode = ArticyConverter.ConvertExpression(expressoCode)

Localization in articy:draft

This page covers articy:draft 3's localization plugin. For the main articy:draft import instructions, see articy:draft.

articy:draft 3's localization plugin creates Excel spreadsheets for localization. For instructions on localization within articy:draft itself, see: https://www.articy.com/articy-importer/unity/html/howto_localization.htm

To generate the initial spreadsheet file, export your articy:draft project to Unity format. Tick Enable localization support and create MS Excel file(s) before exporting. This will create a starter Excel (.xlsx) file. Create copies of this Excel file for each language. You can discard the generated unitypackage.

Note: articy:draft exports files that not all Excel-compatible readers can read. You may need to open and save the file using Excel or a similar program such as Libre Calc or OpenOffice in order for the Dialogue System's Excel reader (which uses the open source Unity-QuickSheet library) to be able to read it.

The Dialogue System provides a separate window to import these localization spreadsheets into Unity. To make the window available, follow these steps:

  1. Download Unity-QuickSheet: https://github.com/kimsama/Unity-QuickSheet
  • To download, open that URL. Click the green Code button and click the Download button.
  • After downloading, unzip the ZIP file.
  • Then put the "Quick Sheet" folder and "Quick Sheet.meta" files somewhere in your project's Assets folder, such as in Assets / Dialogue System Extras / Articy Localization Importer. You can ignore the other files and folders found in the ZIP file if you like. Do not put Unity-QuickSheet inside the Plugins folder.
  1. Import the Articy Localization Importer package found in the Third Party Support folder.
  2. Select menu item Tools → Pixel Crushers → Dialogue System → Import → articy:draft Localization.

Specify the XML file, the base Excel file that the localization plugin created, and the dialogue database you previously created using the articy:draft Import Window. Then click Import Excel Files.


articy:draft Voice-Over Plugin Instructions

This page covers articy:draft 3's voice-over plugin. For the main articy:draft import instructions, see articy:draft.

Voice-Over Plugin Overview

If you use articy's voice-over plugin, you can specify the voice-over property in the Dialogue System's articy:draft Import Window. This will create a custom field named VoiceOverFile in your dialogue database that contains the name of the dialogue entry's voice-over audio clip. Put these clips in a Resources folder or asset bundle.

If you set the Dialogue Manager's Camera & Cutscene Settings → Entrytag Format to VoiceOverFile, the value of the entrytag sequencer keyword will be set to the VoiceOverFile's value. For more info about entrytags, see Entrytags.

Step-By-Step Instructions

Download the Voice Over Helper plugin from Nevigo's plugins site: https://www.articy.com/en/downloads/#plugins

Add a slot property named "VoiceOverFile" to your dialogue fragment template. Tick Add to XML-export.

Add this property to your dialogue fragments, as shown in the example below. You don't have to assign a voice-over file right now. You can use the plugin to create stand-in files to test the process first.

From the plugins menu on the top bar of articy:draft, select Voice-over Helper → Configuration. Make sure the template property for voice-over files matches your property, as shown below.

Select Voice-over Helper → Create/Update VO-Files to generate stand-in audio files.

Export your project to XML.

In the generated Excel file, you should see that the filenames match their settings in articy:draft:

In the articy import window:

  • Make sure Slots as is set to Display Name.
  • Specify the full property in the VoiceOverFile Property field.
  • Import the XML file to a dialogue database.

After conversion, verify that your dialogue entries have VoiceOverFile fields, as shown below.

To automatically play the voice-over files:

  • Put them in a Resources folder or asset bundle.
  • Set the Dialogue Manager's Camera Settings → Entrytag Format to Voice Over File.
  • Set the Default Sequence to AudioWait(entrytag) as shown below, or something similar.

<< Import & Export