handling ink stories at runtime

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
joyan28850
Posts: 2
Joined: Sun Jun 11, 2023 12:45 am

handling ink stories at runtime

Post by joyan28850 »

Hello everyone,

before I add an ink story at runtime, I check if it has already been added. But after I added the Story, it still doesn't seem to be in the stories list. Therefore, clearing the list doesn't help either preventing it to be added again, which throws an error.

Code: Select all


        if (inkIntegration.stories.Contains(story))
        {
            Debug.Log("a story with the same name has already been added");
        }
        else
        {
            Debug.Log("story was added");
            inkIntegration.AddStory(storyName, story.ToJson());
        }

Is there a way I can get access to the stories added at runtime (like clearing them, checking if one has been added etc.)?

Thanks in advance! :)
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: handling ink stories at runtime

Post by Tony Li »

Hi,

It won't be in the stories list, since that's a list of Ink stories that were configured at design time to be loaded when the game starts.

However, you can check if it's in the conversation list:

Code: Select all

bool isAlreadyAdded = DialogueManager.masterDatabase.GetConversation(yourStoryTitle) != null;
Post Reply