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

Attempting to create a story results in error spam due to null state #34

Open
tlitookilakin opened this issue Aug 22, 2021 · 10 comments
Open
Labels
question Further information is requested

Comments

@tlitookilakin
Copy link

Describe the bug
Attempting to create a new story via Story.new() repeatedly spams the error log with errors until the game is closed. The exact error differs every time but all of them stem from setgets being called while state is null

To Reproduce
Create a new story while running inkgd on godot 3.3 stable

Expected behavior
Creating a new story should work instead of crashing the game.

Ink files
N/A

Environment:

  • OS: Windows 10
  • Godot version: 3.3 stable, standard
  • Inklecate version: 0.9.0
  • inkgd version: 0.2.2
@Antokolos
Copy link

Confirmed, I tried to use inkgd on Godot 3.3.3 stable, standard, and it refuses to work.
In my case the error was in the following line

return self.current_thread.callstack

The reason of error was self.current_thread being null

@blawnode
Copy link

I'm having near-identical issues. Is the inkgd project inactive?

@ephread
Copy link
Owner

ephread commented Oct 26, 2021

Sorry for taking so long to reply folks, yeah, it's a bit inactive. I should probably update the README (and remove the trailing star in the ink library). I haven't had time to work on it in almost a year now.

I'll try to find some time to investigate soon.

@videlanicolas
Copy link
Contributor

videlanicolas commented Nov 12, 2021

Is this happening only in Windows? I'm not seeing this issue in Linux (Debian 11).

Here's my example for reference:
Godot: 3.3.4.stable.flathub
Inkgd: 0.2.1

extends Control

const InkRuntime = preload("res://addons/inkgd/runtime.gd")
const Story = preload("res://addons/inkgd/runtime/story.gd")

var story : Story

func _ready():
	call_deferred("load_story")

func _input(event):
	if event.is_action_pressed("ui_accept"):
		continue_story()

func continue_story():
	while story.can_continue:
		var text = story.continue()
		print(text)
	if story.current_choices.size() > 0:
		print(story.current_choices)

func load_story():
	_add_runtime()
	_load_story("res://test.ink.json")

func _load_story(ink_story_path):
	var ink_story = File.new()
	ink_story.open(ink_story_path, File.READ)
	var content = ink_story.get_as_text()
	ink_story.close()

	self.story = Story.new(content)

func _exit_tree():
	call_deferred("_remove_runtime")

func _add_runtime():
	InkRuntime.init(get_tree().root)

func _remove_runtime():
	InkRuntime.deinit(get_tree().root)

Can you confirm you have runtime.gd as a singleton?

@ephread ephread added the question Further information is requested label Nov 27, 2021
@tlitookilakin
Copy link
Author

sorry for the late response- I do indeed have the singleton set up, and yes it has been occurring on windows. I even tested it with the provided example project and ran into the same issue. I haven't tried it with the latest release, so when I get a chance, I'll do that and let you know if it works.

@Lertsenem
Copy link

I have the same issue using Godot v3.4.2, and I can't figure it out.

It feels like the plugin refuses to create a story (fails happens once InkStory.new(json_story) is called, inside the InkPlayer), because _story (or sometimes _story._state) is null.

InkPlayer nodes created in editor still work, but I can't change their Stories dynamically (or create new InkPlayer node), which is pretty inconvenient. :/

@ephread
Copy link
Owner

ephread commented Apr 11, 2022

@Lertsenem 😕

Which version of inkgd? Which OS? Does it happen after an export or while debugging?

@Lertsenem
Copy link

@ephread
I'm on Linux (Ubuntu 20.04 LTS), I'm using the last inkgd stable version (0.4.5) cloned as a git submodule for my project, configured to use inklecate v1.0.0 (directly bundled with Mono).

It happens while debugging, I did not try to export my project yet.

@Lertsenem
Copy link

I can get the example project to run, and you are loading new Stories in it from code, so there must be something I'm doing wrong. But I can't figure out what.

@Lertsenem
Copy link

I managed to solve my issue !

I was trying a stupid method to create the ink_file like

var my_ink_file = InkResource.new()
my_ink_file.json = "res://my_story.ink"

replacing that with a simpler

var my_ink_file = load("res://my_story.ink")

makes everything works as expected.

Still no idea how this resulted in such a weird error though. :D

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

No branches or pull requests

6 participants