{"action":"opened","issue":{"url":"https://api.github.com/repos/bladecoder/blade-ink/issues/2","repository_url":"https://api.github.com/repos/bladecoder/blade-ink","labels_url":"https://api.github.com/repos/bladecoder/blade-ink/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/bladecoder/blade-ink/issues/2/comments","events_url":"https://api.github.com/repos/bladecoder/blade-ink/issues/2/events","html_url":"https://github.com/bladecoder/blade-ink/issues/2","id":177911959,"number":2,"title":"Content '{0}' not found at path: '' when loading state json","user":{"login":"rabidgremlin","id":444906,"avatar_url":"https://avatars.githubusercontent.com/u/444906?v=3","gravatar_id":"","url":"https://api.github.com/users/rabidgremlin","html_url":"https://github.com/rabidgremlin","followers_url":"https://api.github.com/users/rabidgremlin/followers","following_url":"https://api.github.com/users/rabidgremlin/following{/other_user}","gists_url":"https://api.github.com/users/rabidgremlin/gists{/gist_id}","starred_url":"https://api.github.com/users/rabidgremlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabidgremlin/subscriptions","organizations_url":"https://api.github.com/users/rabidgremlin/orgs","repos_url":"https://api.github.com/users/rabidgremlin/repos","events_url":"https://api.github.com/users/rabidgremlin/events{/privacy}","received_events_url":"https://api.github.com/users/rabidgremlin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-19T22:11:10Z","updated_at":"2016-09-19T22:11:10Z","closed_at":null,"body":"Hiya,\r\n\r\nI'm trying to save/restore a game but I'm getting a _Content '{0}' not found at path: ''_ exception when calling the loadJson() on the StoryState object.\r\n\r\nStracktrace:\r\n\r\n```\r\ncom.bladecoder.ink.runtime.StoryException: Content '{0}' not found at path: ''\r\n\tat com.bladecoder.ink.runtime.Container.contentWithPathComponent(Container.java:262)\r\n\tat com.bladecoder.ink.runtime.Container.contentAtPath(Container.java:282)\r\n\tat com.bladecoder.ink.runtime.Container.contentAtPath(Container.java:268)\r\n\tat com.bladecoder.ink.runtime.Story.contentAtPath(Story.java:329)\r\n\tat com.bladecoder.ink.runtime.CallStack$Thread.<init>(CallStack.java:116)\r\n\tat com.bladecoder.ink.runtime.CallStack.setJsonToken(CallStack.java:316)\r\n\tat com.bladecoder.ink.runtime.StoryState.setJsonToken(StoryState.java:501)\r\n\tat com.bladecoder.ink.runtime.StoryState.loadJson(StoryState.java:270)\r\n\tat TestLoadSave.testLoadSave(TestLoadSave.java:116)\r\n```\r\n\r\nTest that is failing looks like:\r\n\r\n```\r\n    @Test\r\n\tpublic void testLoadSave() throws Exception\r\n\t{\r\n\t\tStory story = new Story(inkStoryJson);\r\n\r\n\t\tString storyText = getContinueText(story);\r\n\t\tassertThat(storyText, is(\"We arrived into London at 9.45pm exactly.\\n\"));\r\n\r\n\t\tString choicesText = getChoicesText(story);\r\n\t\tassertThat(choicesText, is(\"0:\\\"There is not a moment to lose!\\\"\\n1:\\\"Monsieur, let us savour this moment!\\\"\\n2:We hurried home\\n\"));\r\n\t\t\r\n\t\t// save the game state\r\n\t\tString saveString = story.getState().toJson();\r\n\r\n\t\t// recreate game and load state\r\n\t\tstory = new Story(inkStoryJson);\t\t\r\n\t\tstory.getState().loadJson(saveString);\r\n\r\n\t\tstory.chooseChoiceIndex(0);\r\n\r\n\t\tstoryText = getContinueText(story);\r\n\t\tassertThat(storyText, is(\"\\\"There is not a moment to lose!\\\" I declared.\\nWe hurried home to Savile Row  as fast as we could.\\n\"));\r\n\r\n\t\t// check that we are at the end\r\n\t\tassertThat(story.canContinue(), is(false));\r\n\t\tassertThat(story.getCurrentChoices().size(), is(0));\r\n\t}\r\n```\r\n\r\nInk source is:\r\n\r\n```\r\n=== back_in_london ===\r\n\r\nWe arrived into London at 9.45pm exactly.\r\n\r\n*   \"There is not a moment to lose!\"[] I declared.\r\n    -> hurry_outside \r\n\r\n*   \"Monsieur, let us savour this moment!\"[] I declared.\r\n    My master clouted me firmly around the head and dragged me out of the door. \r\n    -> dragged_outside \r\n\r\n*   [We hurried home] -> hurry_outside\r\n\r\n\r\n=== hurry_outside ===\r\nWe hurried home to Savile Row -> as_fast_as_we_could\r\n\r\n\r\n=== dragged_outside === \r\nHe insisted that we hurried home to Savile Row \r\n-> as_fast_as_we_could\r\n\r\n\r\n=== as_fast_as_we_could === \r\n<> as fast as we could.\r\n-> END\r\n```\r\n\r\nAny ideas ?\r\n\r\nThanks\r\n\r\nJonathan\r\n\r\nTest project: [testink.zip](https://github.com/bladecoder/blade-ink/files/481236/testink.zip)\r\n\r\n"}}
{"actor":{"display_login":"rabidgremlin"}}