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

ExternalEditor Lost code when changing script name and pressing play #32037

Open
Forknika opened this issue Sep 8, 2019 · 7 comments
Open

ExternalEditor Lost code when changing script name and pressing play #32037

Forknika opened this issue Sep 8, 2019 · 7 comments

Comments

@Forknika
Copy link

Forknika commented Sep 8, 2019

Godot version:

  • 3.1.1 , 3.2 dev. 3.1.1-mono, 3.2 dev-mono.

OS/device including version:

  • GNU/Linux Ubuntu and Kubuntu 18.04.3LTS, Ubuntu and Kubuntu 19.04.

Issue description:

  • When the name of a script is changed, and the play button is pressed, the code written in the script disappears and is replaced by the default template.

  • EDIT: This does not happen when the godot restarts after changing the name of the script, if you create the script from the node or if you create the script from the text editor.

  • External editors: Monodevelop, VisualStudio Code.

Steps to reproduce:

  • Create a new script and write some code, save and close the text editor, then change the name and press the play button, open your script and you will notice that the code you wrote has been replaced by the default template.
@nathanfranke
Copy link
Contributor

nathanfranke commented Sep 8, 2019

Can not Reproduce (YouTube)
Godot 3.1.1 Mono Stable

OS: Ubuntu 18.04 bionic
Kernal: x86_64 Linux 5.0.0-27-generic

EDIT: Still cannot reproduce but I followed the steps incorrectly. Video updated

EDIT 2: Please view the post below

@Forknika
Copy link
Author

Forknika commented Sep 8, 2019

Can not Reproduce (YouTube)
Godot 3.1.1 Mono Stable

OS: Ubuntu 18.04 bionic
Kernal: x86_64 Linux 5.0.0-27-generic

Note: I really hope this bug didn't ruin any of your progress fearful

EDIT: Still cannot reproduce but I followed the steps incorrectly. Video updated

Fortunately, the only serious project I have in Godot is in GDScript, so I was not using the external editor, I lost several lines of code in C # but it was just a port of code that I have in Unity.

Here is a video of my problem, and some additional data(Sorry for the poor quality, I had nothing to record installed.)
youtube video

SO: Kubuntu 18.04.3LTS.
Kernel: 5.0.0-27-Generic.
Shell: bash 4.4.20
CPU Intel 8100
GPU: Nvidia GeForce GTX 1070ti.
Nvidia driver 430.

@nathanfranke
Copy link
Contributor

Still cannot reproduce but I followed the steps incorrectly. Video updated

Fortunately, the only serious project I have in Godot is in GDScript, so I was not using the external editor, I lost several lines of code in C # but it was just a port of code that I have in Unity.

Here is a video of my problem, and some additional data(Sorry for the poor quality, I had nothing to record installed.)
youtube video

Reproduced!!!

You need to create the script through the file manager: It is not reproducible if you create a script from the node.

@Forknika
Copy link
Author

Forknika commented Sep 9, 2019

Still cannot reproduce but I followed the steps incorrectly. Video updated
Fortunately, the only serious project I have in Godot is in GDScript, so I was not using the external editor, I lost several lines of code in C # but it was just a port of code that I have in Unity.
Here is a video of my problem, and some additional data(Sorry for the poor quality, I had nothing to record installed.)
youtube video

Reproduced!!!

You need to create the script through the file manager: It is not reproducible if you create a script from the node.

True, and also if you create the script from the text editor.

@ghost
Copy link

ghost commented Nov 27, 2019

Some more information:

  • The bug always occurs even if changes are made from the external editor, but it takes a little longer to manifest the symptoms

  • The bug is also presented when the scene is saved.

  • This bug is also in the normal version, I think that something is not updated after changing the name of the script, but it does not appear when the internal editor is used maybe because it also saves the code when the scene is saved.

Temporary Solutions:

  • Rename the script with the internal godot text editor.
  • Restart the engine after changing the script name and class.
  • Deactivate the "Save Safe On Backup Then Rename" option

@akien-mga
Copy link
Member

Is this still reproducible in Godot 3.3 or later?

@nathanfranke
Copy link
Contributor

nathanfranke commented Apr 25, 2021

Is this still reproducible in Godot 3.3 or later?

Yes - https://youtu.be/-jSLX_Oh5fo

Clear reproduction steps:

  • Make sure external script editor is enabled (Editor Settings->Text Editor->External)
  • Create script in File System dock
  • Open script in external editor
  • Make a change, save, exit external editor
  • Rename script inside File System dock
  • Play scene
  • Check contents of script

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

4 participants