Importing articy draft strips

Announcements, support questions, and discussion for the Dialogue System.
diviocity
Posts: 22
Joined: Sun Feb 25, 2018 12:50 am

Importing articy draft strips

Post by diviocity »

Hi there,

Are there any plans to enable converting strip properties from articy draft into Dialogue System? Our current data infrastructure heavily relies on their use in our project.

Thanks!
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Importing articy draft strips

Post by Tony Li »

Hi,

I can look into that. How are you using strip properties right now? If you can provide any screenshots to accompany text descriptions, that would be helpful, too.
diviocity
Posts: 22
Joined: Sun Feb 25, 2018 12:50 am

Re: Importing articy draft strips

Post by diviocity »

Hi Tony,

We have strips in several places and they are a vital part of our game’s data currently. Here is just one example to give you an idea.

Combat actions are attacks/skills in battle. Each action may apply or remove several different status effects such as “Poison”, “Mute”, etc. So, our Action feature has a strip of “status processing” entities, which are separate objects that contain 1) the status effect to apply/remove, 2) is this apply or remove? 3) percent chance that it will work. Each action must have the flexibility of referring to any # of these, hence a strip is the best logical choice. We had discussed making just 10 or so slots to work around it, like StatusProc1, StatusProc2, StatusProc3, … but this is VERY ugly and I’d really not like to code this way.

There are other strips we use but this one should show you our rationale for using them. Here are some screenshots to visualize this better:

Image
Image

If you have any workarounds or ideas to achieve getting this kind of data into Dialogue System somehow, I’m all ears. Thanks!
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Importing articy draft strips

Post by Tony Li »

How would you like the strips to be represented in Unity? Elements in the dialogue database's Item table, perhaps? Or something else?
diviocity
Posts: 22
Joined: Sun Feb 25, 2018 12:50 am

Re: Importing articy draft strips

Post by diviocity »

Hi Tony,

How are you handling slots currently? (I haven’t actually looked extensively into that) I would think it should be as easy as making a nested lua table (a table within the table) to represent a “list” of slots, or whatever the slot items turn into in the table. As far as how to render this in Unity’s GUI when importing Articy data, I am not entirely sure but you are already rendering lists and sublists, so hopefully not too bad.
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Importing articy draft strips

Post by Tony Li »

Hi,

Slots are converted as strings. You can specify whether the string is the slot content's DisplayName or internal articy ID.

Thanks for the info. I'll give some thought to this. Lua is only used at runtime. At design time, the data is in a dialogue database asset, which doesn't support arbitrarily-nested tables. (The format is borrowed from Chat Mapper, which is another product similar to articy.) I think the solution may be to store each strip as a string in the dialogue database that gets expanded to a nested table in Lua at runtime.
diviocity
Posts: 22
Joined: Sun Feb 25, 2018 12:50 am

Re: Importing articy draft strips

Post by diviocity »

Thanks for the quick response!

That sounds like a great solution. Can we expect this feature to show up in a future version of the plugin?

Thanks again, really appreciate it! :D
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Importing articy draft strips

Post by Tony Li »

Yes. I'll try to get it into the next patch version so you can test it out and request any changes before the full release.
diviocity
Posts: 22
Joined: Sun Feb 25, 2018 12:50 am

Re: Importing articy draft strips

Post by diviocity »

That's terrific! Thank you for the quick intake - it's greatly appreciated.

I'll look forward to testing the next patch. This feature will greatly extend how we plan to utilize Dialogue System in our project and simplify how we import and use our data.
User avatar
Tony Li
Posts: 21055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Importing articy draft strips

Post by Tony Li »

Hi,

The customer download page now has a beta version that converts articy strips. They're converted 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:

Code: Select all

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

Code: Select all

PixelCrushers.DialogueSystem.Articy.ArticyTools.InitializeLuaSubtables();
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:

Code: Select all

var purifyingSnaresProcessing = DialogueLua.GetItemField("Purifying Snares", "StatusProcessing").AsTable;
Here's a test script that I used:

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;
using PixelCrushers.DialogueSystem.Articy;

public class ArticySubtableTest : MonoBehaviour
{
    void Start()
    {
        // Turn items' subtable text fields into actual subtables:
        ArticyTools.InitializeLuaSubtables();

        // Text the StatusProcessing subtable:
        var statusProcessing = DialogueLua.GetItemField("Purifying Snares", "StatusProcessing").AsTable;
        foreach (var stripElement in statusProcessing.Values)
        {
            var effect = stripElement as LuaTableWrapper;
            Debug.Log(effect["Name"] + ": %chance=" + effect["PercentChance"] + " apply=" + effect["StatusEffectToApply"]);
        }
    }
}
Post Reply