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

Exported GDScript: Parse Error: Class "XXXXXX" hides a global script class #88353

Closed
wpbirney opened this issue Feb 15, 2024 · 1 comment · Fixed by #88365
Closed

Exported GDScript: Parse Error: Class "XXXXXX" hides a global script class #88353

wpbirney opened this issue Feb 15, 2024 · 1 comment · Fixed by #88365

Comments

@wpbirney
Copy link

Tested versions

  • Reproducible in: 4.3-dev [907db8e]

System information

Godot v4.3.dev (907db8e) - Void #1 SMP PREEMPT_DYNAMIC Wed Feb 7 19:24:35 UTC 2024 - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XTX (RADV NAVI31) () - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)

Issue description

When using named classes with:

class_name SmokePickup

Works and runs fine in editor but when i export the pck and try to run that i get:

SCRIPT ERROR: Parse Error: Class "XXXPlayer" hides a global script class.
          at: GDScript::reload (res://PlayerController.gdc:1)
ERROR: Failed to load script "res://PlayerController.gdc" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2817)
SCRIPT ERROR: Parse Error: Class "SmokePickup" hides a global script class.
          at: GDScript::reload (res://pickups/smoke_pickup.gdc:1)

Issue only occurs when running the game with an exported .pck or .zip that has GDScript Export Mode set to Compressed Binary tokens or Binary Tokens. Does not happen when set to Text.

Steps to reproduce

  • Create a empty project
  • Attach a script to a node and give script a class name
  • Set a main scene
  • export a pck and run directly with a binary built using scons target=template_release

Minimal reproduction project (MRP)

N/A

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

Successfully merging a pull request may close this issue.

2 participants