Exemple #1
0
    public static void StartDialogue(string name, string goToKnot = null)
    {
        var file = new File();

        file.Open($"res://Ink/{name}.ink.json", (int)File.ModeFlags.Read);
        string json = file.GetAsText();

        file.Close();

        try
        {
            var story = new Story(json);
            if (!string.IsNullOrEmpty(goToKnot))
            {
                story.ChoosePathString(goToKnot);
            }
            instance?.RunStory(story);
        }
        catch
        {
            GD.Print($"File at path: \"{name}\" could not be parsed as Story!");
        }
    }