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

Internal Script Error - opcode #12 accessing enum #45055

Open
jcsato opened this issue Jan 9, 2021 · 2 comments
Open

Internal Script Error - opcode #12 accessing enum #45055

jcsato opened this issue Jan 9, 2021 · 2 comments

Comments

@jcsato
Copy link

jcsato commented Jan 9, 2021

Godot version:
Godot 3.2.3, Windows 64-bit

OS/device including version:
Windows 10 Pro, version 20H2

Issue description:
When attempting to run the project, I get an internal script error when I attempt to compare an int parameter to an enum:

image

image

image

Apologies if I'm just doing something wrong - the error message said to report, though, so I figured I'd do that.

Steps to reproduce:
Run the included project.
The debugger should break on TerrainData.gd:19

Minimal reproduction project:
InternalScriptErrorOpcode12.zip

Can also find the project here, it's very nascent and should hopefully be relatively straightforward to browse through. . .: https://github.com/jcsato/Bunker-Godot (Repo is now private, if anyone looks at this and finds the minimal project is insufficient let me know, but I'm guessing this issue will probably be closed since we're on Godot 3.4 now)

@jcsato
Copy link
Author

jcsato commented Jan 9, 2021

For additional color, I was previously on Godot 3.2.1 and was getting the same error on the same line, but it said opcode #9. Did my due diligence upgrading to 3.2.3 and on that version I get opcode #12 instead.

@jcsato
Copy link
Author

jcsato commented Jan 10, 2021

In debugging, the debugger didn't seem to know what the TERRAIN_TYPES enum was. I changed things up to put TERRAIN_TYPES into its own script (Const) and autloaded it. When I did that and changed the code to e.g.

if type == Const.TERRAIN_TYPES.LIGHT:

it compiled without issues.

Based on that, I think what happened here is that my enum/const wasn't accessible to the Terrain class for some reason, and the compiler broke trying to figure out that error.

. . .Maybe. Either way, hope that's at least somewhat helpful.

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

No branches or pull requests

2 participants