Godot: Loss of export variable when a script does not compile and then compiles again

Created on 11 Dec 2018  路  4Comments  路  Source: godotengine/godot

Godot version:
b7320bc02ff6753cab

OS/device including version:
4.19.4-arch1-1-ARCH

Issue description:

When editing a script with export variables, failure in compilation leads to export variables to be lost

Conditions:

  • Script has export variables
  • Scene that uses the script is open and "focused" (current selected tab)
  • Script compiles

Steps to reproduce:

  1. Open the reproduction project
  2. Open the scene "main"
  3. Open the script "Node2D.gd"
  4. Uncomment the broken line
  5. Save (SCRIPT ONLY)
  6. Comment the broken line again, so that the script compiles
    -> Export variable becomes null

Minimal reproduction project:
LoseExport.zip

bug confirmed high priority editor

Most helpful comment

Now that it's mentioned, I have noticed recently that my scenes are losing their exported values at regular intervals. I can confirm that this is happening.

All 4 comments

Now that it's mentioned, I have noticed recently that my scenes are losing their exported values at regular intervals. I can confirm that this is happening.

I've seen this too a lot on a project I use to try to reproduce bug reports, where script compilation failure often end up in my main scene losing its PackedScene export var (thus breaking the game).

I think this might be the actual cause of #23418

I think that this was introduced in #23639 (via bisecting + fixing); I've put up a potential PR in #24707 that seems to fix the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zylann picture Zylann  路  3Comments

n-pigeon picture n-pigeon  路  3Comments

timoschwarzer picture timoschwarzer  路  3Comments

blurymind picture blurymind  路  3Comments

mefihl picture mefihl  路  3Comments