Page 1 of 1

handling ink stories at runtime

Posted: Mon Jul 10, 2023 12:46 pm
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! :)

Re: handling ink stories at runtime

Posted: Mon Jul 10, 2023 4:06 pm
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;