Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Error when Dropping Multiple Ink files with INCLUDEs Into Unity #5

Closed
Horatio-Blackwood opened this issue May 4, 2016 · 8 comments
Assignees

Comments

@Horatio-Blackwood
Copy link
Contributor

OS - Windows 7 64bit
ink-unity-integration version: 0.33

If I drop these three files into an ink/unity project by copying and pasting them from another directory compilation completes but the ink script fails to run in the ink player.

* Steps to reproduce*

  1. Make sure any output Copy and paste the three .ink files into the ink directory in the assets dir of a ink/unity project.
  2. Observe that the compilation cmd windows pop up and go away - no crashes. No errors appear in the Console output.
  3. Observe that two .json files are generated: main.json and state.json.
  4. Select the main.ink file and click the play button in the unity inspector window.
  5. Observe the following error appears in the console.

When I select 'main' and try to run the ink script, I get this error in the console:
NullReferenceException: Object reference not set to an instance of an object
Ink.UnityIntegration.InkPlayerWindow.Play (UnityEngine.TextAsset storyJSONTextAsset) (at Assets/Plugins/Ink/Editor/Player Window/InkPlayerWindow.cs:87)
Ink.UnityIntegration.InkPlayerWindow.LoadAndPlay (UnityEngine.TextAsset storyJSONTextAsset) (at Assets/Plugins/Ink/Editor/Player Window/InkPlayerWindow.cs:70)
Ink.UnityIntegration.InkInspector.OnInspectorGUI () (at Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector/InkInspector.cs:106)
Ink.UnityIntegration.ObjectEditor.OnInspectorGUI () (at Assets/Plugins/Ink/Editor/Ink Inspector/Ink Inspector/ObjectEditor.cs:31)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1231)
UnityEditor.DockArea:OnGUI()

state.txt
main.txt
some_ink_file.txt

@tomkail
Copy link
Collaborator

tomkail commented May 9, 2016

Let me know if you're still getting this!

@joethephish
Copy link
Member

(Hotfix package available here: https://github.com/inkle/ink/releases/download/0.3.4/UnityInkIntegration0.3.4_Hotfix_2.unitypackage - hopefully fixes both of your issues!)

@Horatio-Blackwood
Copy link
Contributor Author

Tom / Joe,

I'll check this out as soon as I've got a spare moment. Thanks for taking a look. Obviously, you think you have a fix for these issues if you've issued a hotfix.

I see a couple of change sets indicating some more / vs \ nonsense, shakes fist towards Microsoft HQ were those the potential source of the problem? Or is there more than that involved?

Thanks!

  • HB

@tomkail
Copy link
Collaborator

tomkail commented May 9, 2016

It's possible! We're mac people, so it's a bit hard to tell - I think that's the last of those bugs, we've not had any more reports this evening.
Let us know how you get on!

@Horatio-Blackwood
Copy link
Contributor Author

I'll certainly let you all know. I'm wondering if InkFile.cs should just have a 'sanitizeSlashes(string path)' method that it calls when any of its paths are modified or set so that callers of that class could just use whatever paths they have been given and InkFile.cs would take care of the rest.

It seems like we're sprinkling that string replace line EVERYWHERE, and honestly, it only needs to be in a single place to protect the internal state of that object. If we did that, I think we could kill the \ replace usage in InkLibrary, as it would always return properly formatted paths.

Anyways, just a few musings. Thanks, I'll let you know what I find out.

@tomkail
Copy link
Collaborator

tomkail commented May 9, 2016

Yeah, that's a really good idea - it's starting to get a bit messy. Because I can't easily test it I'm a little wary to do this myself right now, but if you fancy it, free to create pull request and I'll bring it in for the next release!

@Horatio-Blackwood
Copy link
Contributor Author

Yeah, without a windows test station you're probably not as able to verify that its working here or there. Once I re-familiarize myself with the latest changes, I may take a crack at it. Thanks Tom!

@Horatio-Blackwood
Copy link
Contributor Author

Closing as this issue is resolved by ink-unity-integration v0.3.4, Hotfix 2.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants