Page 6 of 8

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

Posted: Tue Jun 16, 2020 8:17 pm
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.

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

Posted: Fri Jun 19, 2020 11:18 am
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?

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

Posted: Fri Jun 19, 2020 11:26 am
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.

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

Posted: Fri Jun 19, 2020 11:51 am
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!

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

Posted: Fri Jun 19, 2020 12:01 pm
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.

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

Posted: Fri Jun 19, 2020 1:38 pm
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?

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

Posted: Fri Jun 19, 2020 2:02 pm
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.

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

Posted: Fri Jun 19, 2020 9:39 pm
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.

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

Posted: Sat Jun 20, 2020 1:44 pm
by nehvaleem
Awesome! I can confirm that it is now working great! Again, thanks for the incredible support!

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

Posted: Sat Jun 20, 2020 2:21 pm
by Tony Li
Glad to help!