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

Included Ink files doesn't cause the Ink Story to be recompiled correctly #68

Closed
klootas opened this issue Sep 20, 2023 · 2 comments · Fixed by #72
Closed

Included Ink files doesn't cause the Ink Story to be recompiled correctly #68

klootas opened this issue Sep 20, 2023 · 2 comments · Fixed by #72
Labels
bug Something isn't working

Comments

@klootas
Copy link

klootas commented Sep 20, 2023

Describe the bug
Changing the content of an Ink file that is included in an Ink story does not cause the story to be recompiled correctly the next time the game is executed.

To Reproduce
Here's a repro of the problem:
https://github.com/klootas/GodotRepro.git

  1. Open repro project in the Godot editor
  2. Run the project using F5 and notice that the first Ink choice is called "Choice A1"
  3. Open Ink/Test.ink (a file that is "included" by Ink/Story.ink), in an external editor
  4. Change the first choice text to "Choice A2"
  5. Switch back to the Godot editor
  6. Press F5 and notice that the running game still says "Choice A1" (instead of the expected "Choice A2")

Environment

  • OS: Windows 11
  • Godot version: 4.1.1
  • godot-ink version: 1.1.0
  • ink version: 1.1

** Additional context **

My ink_cache.json in the user folder:
{"res://Ink/Story.ink":["res://Ink/Test.ink\r"]}

@klootas klootas added the bug Something isn't working label Sep 20, 2023
@paulloz
Copy link
Owner

paulloz commented Sep 20, 2023

That \r is most certainly the issue. It's due to Windows' EOL characters. I'll make a patch for that as soon as I have time.

@klootas
Copy link
Author

klootas commented Sep 21, 2023

You're right, this fixes it:

File: InkStoryImporter.cs:105

Current:
.Select(match => sourceFile.GetBaseDir().PathJoin(match.Groups["Path"].Value))

New:
.Select(match => sourceFile.GetBaseDir().PathJoin(match.Groups["Path"].Value.Trim()))

Good call 👍

paulloz added a commit that referenced this issue Sep 30, 2023
paulloz added a commit that referenced this issue Sep 30, 2023
Fixes #68

[CHANGELOG]
Using Windows EOL (`\r\n`) doesn't break include detection any more.
@paulloz paulloz added the waiting for the next release This issue is resolved but waiting to be released label Sep 30, 2023
@paulloz paulloz removed the waiting for the next release This issue is resolved but waiting to be released label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants