Ink integration - couple questions (actors etc.)

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink integration - couple questions (actors etc.)

Post by Tony Li »

I think I misunderstood you earlier.

The [ConversationPopup] attribute will not include Ink stories. If it shows a single Ink story in the popup, that's because the string is already set to that story name.

Instead, in your Dialogue Trigger use the [InkEntrypoint] attribute. This will let you pick Ink stories and, optionally, entrypoints in those stories. You can use the code I posted above to split the story name from the knot and stitch.
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

Re: Ink integration - couple questions (actors etc.)

Post by nehvaleem »

Oh my, of course. Sorry for bothering you, that makes perfect sense.

One more question tho - is it possible to set ink variable value via dialogue manager? The context is I want to restore state of the conversation (variables, etc) after loading a save in my game. What is the correct way of doing this?
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink integration - couple questions (actors etc.)

Post by Tony Li »

Yup, use the Ink Lua functions.

For example, you can set a Dialogue System Trigger to OnTriggerEnter, and select Add Action > Run Lua Code. Then set the Lua Code field to:

Code: Select all

SetInkBool("enteredHouse", true)
This will set the Ink variable "enteredHouse" to true.

Conversely, in an Ink story you can use the integration's external functions to get and set Dialogue System variables.
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

Re: Ink integration - couple questions (actors etc.)

Post by nehvaleem »

Great! Thanks for the explanation and sorry about missing the well-documented feature.

It seems that (again) I am set for now. In the meantime, I've checked that PersistentDataManager also handles Ink integration! Awesome!
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

Re: Ink integration - couple questions (actors etc.)

Post by nehvaleem »

ah I've might write this a little bit too soon :)

Since I don't know the correct way to "see" the state of ink story I am using:

Code: Select all

PersistentDataManager.GetSaveData()
to preview it. When I play my game it outputs correct values for my variables. Then I save it manually and after that, I'm calling

Code: Select all

PersistentDataManager.ApplySaveData(savedData.storyState)
After that, I am calling GetSaveData() once more and I see that the values of my variables didn't change.

Also - is it possible to set ink LIST value from the Dialogue System? I cannot find a way to do so.
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink integration - couple questions (actors etc.)

Post by Tony Li »

I'll check saving & loading and reply back here by the end of the day.

Currently there's no way to set an Ink List value from the Dialogue System. I can add that to the to-do list. Add/remove/change individual list elements?
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

Re: Ink integration - couple questions (actors etc.)

Post by nehvaleem »

My top priority is to be able to store and restore ink story state completely. If saving/loading work correctly (from my tests I thing there is something off, but my Ink story have a LIST variable. Maybe this is connected somehow) that I should be fine.

But apart from that I think that being able to modify LIST variable would be really handy. I imagine that it would be awesome to cast it to & from array - this way we will be able to do all sorts of modifications.
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink integration - couple questions (actors etc.)

Post by Tony Li »

Hi,

Make sure the Dialogue System Ink Integration's Reset State On Conversation Start checkbox is UNticked.

Here's an example:

DS_InkSaveLoadExample_2020-06-19.unitypackage

It has 3 buttons: BBB, CCC, and ShowVar. The Ink story has a variable that defaults to "AAA". If you click BBB, it will set the variable to "BBB". If you click CCC, it will set the variable to "CCC". If you click ShowVar, it will show the current value of the variable. You can press Esc to access a save/load menu.

Here's an updated integration package:

DS_InkSupport_2020-06-19.unitypackage

It just has one small change: The GetInkString() Lua function needed a bug fix.
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

Re: Ink integration - couple questions (actors etc.)

Post by nehvaleem »

Awesome! I can confirm that it is now working great! Again, thanks for the incredible support!
User avatar
Tony Li
Posts: 22101
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink integration - couple questions (actors etc.)

Post by Tony Li »

Glad to help!
Post Reply