CSV

This page describes how to import and export Comma-Separated Values (CSV) format, which can be opened in spreadsheet applications.

How to Export CSV

To export CSV, use the Dialogue Editor. On the Database tab:

  1. Expand the Export Database foldout.
  2. Set the Format to CSV.
  3. Specify what assets (actors, conversations, etc.) you want to export.
  4. Click Export....

How to Import CSV

  1. Select Tools → Pixel Crushers → Dialogue System → Import → CSV.
  2. Set Source File to the name of your CSV file.
  3. Set Output Folder and Database Filename to the path (inside your Assets hierarchy) and name to create the dialogue database.
  4. Set Encoding to the encoding format of the file.
  5. Tick Overwrite if you want to overwrite an existing dialogue database (if one exists).
  6. Tick Sort By ID if you want to sort assets (actors, conversations, etc.) by their internal ID numbers. Otherwise they will be added in the order they appear in the CSV file.
  7. Click Import.

The image below shows settings for converting a CSV file:

CSV File Format

The CSV file must follow the format below.

It can contain one or more sections. Each section is optional. The sections are:

Section Description
Database Database Properties
Actors Actors
Items Items; also used for quests
Locations Locations
Variables Variables
Conversations High level information about each conversation
DialogueEntries Individual dialogue entries in the conversations
OutgoingLinks Links between dialogue entries

The Database section must contain:

Database
Name,Version,Author,Description,Emphasis1,Emphasis2,Emphasis3,Emphasis4
(name),(version),(author),(description),(emphasis setting 1 in format #rrggbbaa biu),(emphasis2),(emphasis3),(emphasis4)
Global User Script
(luacode)

The Actors section must contain:

Actors
ID,Portrait,AltPortraits,SpritePortrait,AltSpritePortraits,Name,Pictures,Description,IsPlayer
Number,Special,Special,Special,SpecialText,Files,Text,Boolean
(id),(texturename),[(texturenames)],(name),[(picturenames)],(description),(isplayer)
...

NOTE: In version 2.2.10, the columns in the Actors section changed. The SpritePortrait and AltSpritePortraits columns were added. If you need to import a pre-2.2.10 CSV file into version 2.2.10+, you must add these columns to the Actors section of your CSV file.

The Items, Locations, Variables, and Conversations section must contain:

(Heading) -- where this is Items, Locations, Variables, or Conversations
ID,(field),(field),(field)...
Number,(fieldtype),(fieldtype),(fieldtype)...
(id),(fieldvalue),(fieldvalue),(fieldvalue)...

The Variables section may contain a final column titled "InitialValueType" that specifies the variable type (Text, Number, or Boolean).

The DialogueEntries section must contain:

DialogueEntries
entrytag,ConvID,ID,Actor,Conversant,MenuText,DialogueText,IsGroup,FalseConditionAction,ConditionPriority,Conditions,Script,Sequence,(field),(field)...,canvasRect
Text,Number,Number,Number,Number,Text,Text,Boolean,Special,Special,Text,Text,Text,(fieldtype),(fieldtype),...,Text
(entrytag),(ConvID),(ID),(ActorID),(ConversantID),(MenuText),(DialogueText),(IsGroup),(FalseConditionAction),(ConditionPriority),(Conditions),(Script),(Sequence),(fieldvalue),(fieldvalue)...,#;#

The DialogueEntries section may contain an optional final field "canvasRect" of the format "x;y" that specifies the dialogue entry's position on the node editor canvas.

The OutgoingLinks section must contain:

OutgoingLinks
OriginConvID,OriginID,DestConvID,DestID,ConditionPriority
Number,Number,Number,Number,Special
#,#,#,#,(priority)

Omitted values in any particular asset should be tagged with {{omit}}.

Example CSV File

This is an excerpt of a dialogue database in CSV format. It's been pared down for brevity, so it won't actually import into the CSV importer, but it shows the format of each section. You can use the Dialogue Editor to export a complete version of the Demo database which you can import using the CSV importer.

   Database
    Name,Version,Author,Description,Emphasis1,Emphasis2,Emphasis3,Emphasis4
    CSV Import,1.5.1.0,John Smith,"This is the description.",#ff0000ff b--,#44b634ff b--,#4688e6ff b--,#ccccccff b--
    Global User Script
    Variable["Alert"] = "Welcome!"

    Actors
    ID,Portrait,AltPortraits,Name,Pictures,Description,IsPlayer
    Number,Special,Special,Text,Files,Text,Boolean
    1,,[],Player,[../../Art/Portraits/Player.png],The player controls a sci-filieutenant.,True
    2,,[],Private Hart,[../../Art/Portraits/Private Hart.png],"The squad's technical expert.",False

    Items
    ID,Name,Description,Success Description,Failure Description,State,Entry Count,Entry 0 State,Entry 0,Entry 1 State,Entry 1,Is Item
    Number,Text,Text,Text,Text,Text,Number,Text,Text,Text,Text,Boolean
    1,Assassinate the Emperor,"Your squad has infiltrated the evil Emperor's star carrier to assassinate him during the launch ceremony.\nYou can liberate your star system by opening the airlock, but scores of innocent attendees will also die.\nWill you follow orders or abandon this opportunity?","With the Emperor jettisoned into space along with scores of innocent families and children, your star system is free from the Empire's tyranny.",You decided that killing so many innocent people would make you no better than the Emperor himself. The rebellion will have to find another way.,unassigned,2,unassigned,You must hack the computer to gain control of the airlock doors.,unassigned,You must decide whether to open the airlock doors or lock them.,{{omit}}

    Locations
    ID,Name
    Number,Text
    1,Star Carrier

    Variables
    ID,Name,Initial Value,Description,InitialValueType
    Number,Text,Text,Text,Text,
    0,Alert,,Show alert messages during gameplay by setting this variable.,Text

    Conversations
    ID,Title,Description,Actor,Conversant
    Number,Text,Text,Actor,Actor
    1,Private Hart,"This conversation occurs between the player and Private Hart, who refuses to open the airlock to kill the evil Emperor because a hundred bystanders would also die. This is the primary conversation in the demo. It demonstrates branching dialogue, the quest system, sequences, and QTEs. ",1,2

    DialogueEntries
    entrytag,ConvID,ID,Actor,Conversant,Title,MenuText,DialogueText,IsGroup,FalseConditionAction,ConditionPriority,Conditions,Script,Sequence,Video File,Importance,FR,Menu Text FR,Sequence FR,Response Menu Sequence
    Text,Number,Number,Number,Number,Text,Text,Text,Boolean,Special,Special,Text,Text,Text,Text,Text,Text,Text,Localization,Text,Text,Text
    Player_1_0,1,0,1,2,START,,,False,Block,Normal,,,None(),,,,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Private_Hart_1_1,1,1,2,1,No Quest Yet,,"Lieutenant! We have a problem, sir!\nA big problem.",False,Block,Normal,Item["Assassinate_the_Emperor"].State == "unassigned",,"LookAt(listener,speaker); LookAt(speaker,listener); Camera(Medium); Camera(Closeup,speaker,1)@0.1; require Camera(Closeup,listener)@2",,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Private_Hart_1_2,1,2,2,1,Quest is Active,,"We can't murder those bystanders, sir. It's not right.",False,Block,Normal,Item["Assassinate_the_Emperor"].State == "active",,"LookAt(listener,speaker); LookAt(speaker,listener); Camera(Closeup); require Camera(Closeup,listener)@2.5",,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Private_Hart_1_4,1,4,2,1,Airlock Relocked,,"You did the right thing, sir.",False,Block,Normal,Item["Assassinate_the_Emperor"].State == "failure",,"LookAt(listener,speaker); LookAt(speaker,listener); Camera(Closeup); require Camera(Closeup,listener)@2",,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Player_1_5,1,5,1,2,,Calm down. What's the problem?,,False,Block,Normal,(Quest["Assassinate_the_Emperor"] == "success") and (Variable["gotBox"] ~= false),Quest["Assassinate_the_Emperor"] = "unassigned",,,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Player_1_6,1,6,1,2,,"Report, private.",,False,Block,Normal,,,,,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Player_1_7,1,7,1,2,,"Stand by, private. I'll be back.",,False,Block,Normal,,,,,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Private_Hart_1_8,1,8,2,1,,,"The Emperor is in the hangar, sir.",False,Block,Normal,,,,,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}
    Player_1_9,1,9,1,2,,Good. Our spies were right.,,False,Block,Normal,,,,,{{omit}},{{omit}},{{omit}},{{omit}},{{omit}}

    OutgoingLinks
    OriginConvID,OriginID,DestConvID,DestID,ConditionPriority
    Number,Number,Number,Number,Special
    1,0,1,1,Normal
    1,0,1,2,Normal
    1,0,1,3,Normal
    1,0,1,4,Normal

<< Import & Export