You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure what am I doing wrong, but whenever I try to get the tags from the story, I catch the Segmentation Fault error.
For example, if I have this ink-file:
Test #TEST* Option 1
OK #OK** Option 2
->END
…and the quick example from your description with a couple of changes and the tags reference:
frombink.storyimportStory, story_from_file# Story is the entry point of the Blade Ink lib.story=story_from_file("inkfiles/test.ink.json")
# self.assertTrue(story.can_continue()) # CHANGE wouldn't launch with itend=Falsewhilenotend:
whilestory.can_continue():
line=story.cont()
print(line)
tags=story.tags# THE PROBLEM# Obtain and print choiceschoices=story.get_current_choices()
print(f"Num. choices: {len(choices)}\n")
ifchoices:
fori, textinenumerate(choices):
print(f"{i+1}. {text}")
# read_input() is a method that you should implement# to get the choice selected by the user.choice_idx=input() # CHANGE standard input routine# set the option selected by the userstory.choose_choice_index(int(choice_idx)-1) # CHANGE keyboard input handlingelse:
end=Trueprint("Story ended ok.")
…then I get this terminal output:
Test
Num. choices: 1
1. Option 1
1
Option 1
OK
zsh: segmentation fault /opt/homebrew/bin/python3
The text was updated successfully, but these errors were encountered:
Not sure what am I doing wrong, but whenever I try to get the tags from the story, I catch the Segmentation Fault error.
For example, if I have this ink-file:
…and the quick example from your description with a couple of changes and the tags reference:
…then I get this terminal output:
The text was updated successfully, but these errors were encountered: