blackears / cyclopsLevelBuilder

A Godot plugin to let you block in levels inside the Godot editor.
MIT License
1.04k stars 43 forks source link

Error: "Can't take value from empty array." #158

Open FatherOfSnails opened 5 months ago

FatherOfSnails commented 5 months ago

Error message "Can't take value from empty array." after deleting a block. Occurs when deleting blocks through the "Delete Selected Blocks" function in the drop-down menu and when deleting the block node (and its children) in Godot's node tree. Error persists when changing scenes and restarting the project.

Thanks in advance blackears! The addon is perfect so far for what I want to build and I appreciate the work you've put into it. If you need more information I'd be happy to provide what I can.

blackears commented 5 months ago

Do you have the full error message printed to the console? That could help me track it down.

FatherOfSnails commented 5 months ago

Unfortunately I'm not really sure how to make Godot tell me more information about the error, what I've typed is literally all it's given me lol I've provided an attached screenshot cropped to show the error as it appears in the "Output" tab at the bottom of the UI. Multiple instances of the error are shown because Godot creates a new error message every time I change scenes.

editor_screenshot_2024-04-08T133627

It doesn't appear to be breaking anything, my game still works as intended and the level geometry still functions correctly, it's just throwing an error message. My theory is that it's trying to call data about a block that no longer exists, but I looked under the hood at the block and global code and it's...sorcery to me lmao. I'm honestly half-tempted to just collapse the error messages and ignore them

blackears commented 5 months ago

It's hard to tell what's causing this. The error message doesn't help much. It seems to be related to calling queue_free() on the block being deleted. I've put some posts on the Godot forum, but it might be best to ignore this for now since it doesn't seem to be causing an issue.

FatherOfSnails commented 5 months ago

Alright! I appreciate you looking into the issue for me, I'll let you know if there are any changes or if I manage to find a fix.

darkhog commented 5 months ago

Perhaps add some additional debug logging around all the parts that MIGHT cause this error (before and after operation that might cause this error to show up) and when the log is checked and you find the error sandwiched between those debug messages informing what was being done at the time, you'd have a winner.