Page 5 of 8
Re: Ink integration - couple questions (actors etc.)
Posted: Fri Jun 05, 2020 12:20 pm
by Tony Li
Hi,
I'll try to get those implemented next week.
Re: Ink integration - couple questions (actors etc.)
Posted: Sun Jun 14, 2020 5:08 pm
by Tony Li
The
Dialogue System Extras page has an updated Ink integration package. It's inside the "Updated for 2.2.7" foldout, but it should work with any recent version of the Dialogue System.
It adds an
[InkEntrypoint] attribute that you can use in your scripts like this:
This will show the string 's' as a dropdown from which you can choose any stories, knots, or stitches from stories assigned to the scene's DialogueSystemInkIntegration component.
It also adds a utility class named InkEntrypoint. This class has 3 string variables: story, knot, and stitch.
The static method
InkEntrypoint.FromString(string s) returns an InkEntrypoint object (containing 3 strings: story, knot, and stitch) from a string of any of these formats:
- "story"
- "story/knot"
- "story/knot.stitch"
The corresponding
InkEntrypoint.ToString() method returns the string representation of an InkEntrypoint object.
You don't have to use InkEntrypoint, but you might find it handy.
Re: Ink integration - couple questions (actors etc.)
Posted: Mon Jun 15, 2020 10:52 am
by nehvaleem
Thanks, Tony!
But let me ask you a question
Is it compatible with `SetConversationStartingPoint`? Because I don't think that it will work with the output from this picker (I mean with the story name prepended)
Re: Ink integration - couple questions (actors etc.)
Posted: Mon Jun 15, 2020 11:38 am
by Tony Li
Use an InkEntrypoint object to split the "story/knot.stitch" into its component parts: "story", "knot", and "stitch". Then pass the knot and stitch to SetConversationStartingPoint:
Code: Select all
[InkEntrypoint]public s;
...
InkEntrypoint entrypoint = InkEntrypoint.FromString(s);
DialogueSystemIntegration.SetConversationStartingPoint(entryPoint.knot + "." + entryPoint.stitch);
DialogueManager.StartConversation(entryPoint.story);
If the stitch is an empty string (i.e., no stitch selected), then just use entryPoint.knot.
Re: Ink integration - couple questions (actors etc.)
Posted: Mon Jun 15, 2020 11:45 am
by nehvaleem
Ah, right! That is indeed the way
One more thing - the conversation popup doesn't always list Ink stories. I am attaching an example screenshot from my project.
Re: Ink integration - couple questions (actors etc.)
Posted: Mon Jun 15, 2020 12:00 pm
by Tony Li
Are those stories assigned to the Dialogue System Ink Integration's "Ink JSON Assets"?
If so, please try navigating away from the Dialogue Trigger inspector and then back to it. This should refresh the internal cache of stories, knots, and stitches that the custom popup has recorded.
Re: Ink integration - couple questions (actors etc.)
Posted: Tue Jun 16, 2020 4:25 am
by nehvaleem
yes, the story is assigned to the Dialogue System Ink Integration as it is displayed on the left side of the screen (inside the second inspector). Unfortunately, I cannot find a way to refresh the cached data. I am unable to make it to do a refresh and show ink stories in the conversation popup
Re: Ink integration - couple questions (actors etc.)
Posted: Tue Jun 16, 2020 9:39 am
by Tony Li
It looks like one .ink file is assigned to the DialogueSystemInkIntegration script. The popup is only finding 2 stories/knots/stitches in the .ink file. Can you PM me the file or email it to tony (at) pixelcrushers.com? It's possible that the others are in a format that the popup drawer currently can't identify. I may need to update the way it identifies them.
Re: Ink integration - couple questions (actors etc.)
Posted: Tue Jun 16, 2020 9:45 am
by nehvaleem
no, I am working with my database that exists way before I've added ink integration. So those 2 entries in a popup are from the regular Dialogue System database. The weird thing is that the story from ink file shows up in the popup sometimes, but it isn't for most of the time.
let me know If that leads you onto the issue or if you need my source ink file
Re: Ink integration - couple questions (actors etc.)
Posted: Tue Jun 16, 2020 9:58 am
by Tony Li
Ah, got it. That makes more sense. I'll check why it's not consistently picking up the stories. I added an optimization that caches the stories, and it may not be refreshing the cache when it should.