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

Recompiling Ink changes json syntax to make files unusable in Unity (without tedious edits) #203

Open
sopeculiar opened this issue Jul 8, 2024 · 15 comments

Comments

@sopeculiar
Copy link

Unity requires me to Recompile Ink when I make edits to the ink files. However, this reformats my jsons from version 20 to 21 and alters the syntax, making them unreadable by Unity without manually editing each file.

Here's the json after a recompile:
Screenshot 2024-07-08 at 3 20 50 PM

And the edits I made to fix it:
Screenshot 2024-07-08 at 3 21 42 PM

What can I do to prevent this in the future? It makes editing dialogue in our game a huge pain. TIA.

@tomkail
Copy link
Collaborator

tomkail commented Jul 8, 2024 via email

@sopeculiar
Copy link
Author

sopeculiar commented Jul 11, 2024

Hey, thanks for the response! The repro steps would be:

  • Dialogue is playing just fine in the editor and in builds
  • Find a typo
  • Fix it in the Ink file and save
  • Attempt to build in Unity
  • Get an error that it is necessary to recompile Ink
  • Recompile Ink
  • Play the build: no dialogue plays for any character

The only fix I know of is to edit the json files after recompiling, though I would certainly rather not. :)

@tomkail
Copy link
Collaborator

tomkail commented Jul 11, 2024 via email

@sopeculiar
Copy link
Author

They are in the Unity project. Unity is not compiling automatically. It just gives me an error that it needs to be done before it will build. So I use this option under Assets:
Screenshot 2024-07-11 at 4 41 42 PM

@tomkail
Copy link
Collaborator

tomkail commented Jul 11, 2024 via email

@sopeculiar
Copy link
Author

I was just looking at that. Here's what I've got.
Screenshot 2024-07-11 at 4 44 04 PM

Would it have updated automatically at some point? The previous files in the JSON were version 20, and they changed to 21 after the recompile. It seemed like that was when the problem began. I've been using Ink in this project for almost 2 years, and the problem only began a few months ago.

@sopeculiar
Copy link
Author

I just did a test, and it auto-compiled, but the dialogue isn't being read. It pops up as empty. Here's the beginning of the JSON file after the auto-compile. I think it's not reading the speaker tag correctly?
Screenshot 2024-07-11 at 4 48 53 PM

@tomkail
Copy link
Collaborator

tomkail commented Jul 11, 2024 via email

@sopeculiar
Copy link
Author

I am on the latest version. How do I share the Ink? Add an attachment here?

@tomkail
Copy link
Collaborator

tomkail commented Jul 11, 2024 via email

@tomkail
Copy link
Collaborator

tomkail commented Jul 11, 2024 via email

@sopeculiar
Copy link
Author

sopeculiar commented Jul 11, 2024 via email

@tomkail
Copy link
Collaborator

tomkail commented Jul 12, 2024

Hi! I can't see the file, annoyingly. Can you reupoad it? Before that though -
I've just updated the package - can you possibly try the latest version?

@sopeculiar
Copy link
Author

I updated the package, but the problem persists. :( Trying another method of attaching the files. I can't upload an ink file here, but I copy/pasted the content into a txt. The JSON is also attached.

Charlotte.json
Charlotte.txt

Feel free to email me at chera@sopeculiar.com if you want to talk through anything in detail or screenshare. I'd love to fix this!

@sopeculiar
Copy link
Author

I did a little more testing. I think the problem is how it's parsing the speaker tag. I can move the speaker tag and get the file working again, but it won't read the speaker's name unless I change the JSON.

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

2 participants