Renamed scripts directory and now Godot... oh god, no! LOL?

Godot Version

4.2.1.stable

Question

Did some housecleaning and thought it was the right time to rename directories properly to my liking. So, I renamed “scripts” to “Scripts”, but now I get the following error:

Parser Error: Class "PlayerEquipment" hides a global script class.

Just to make sure it wasn’t my fault, somehow, I “undid” the renaming by manually renaming it back to “scripts” and oh boy…

Now res:// includes BOTH versions. Scripts and scripts with all the files included.

I’m making a backup of my physical files and removing the entries in res://, but this should be fixed.

Troubleshooting as I write this… Well, deleting the scripts directory removed both scripts and Scripts. Not optimal.

Restarting the engine didn’t fix anything.

Thanks for backups. Things are back to normal, but with the res:// being “scripts,” which, I think I’ll keep for now…

Maybe someone could check this on their side?

1 Like

Just to add that when I deleted the “scripts” directory in res://, both the files in “scripts” and “Scripts” INSIDE res:// AND on the physical SSD got deleted.

Creating a new folder “Script” and then moving all the old scripts to the new one might help
Make sure to pray to the Godot file manager

I don’t think there will be a next time. :rofl:

You didn’t say if this is Windows, Mac or Linux. Windows is case insensitive, Mac can be either, and Linux is case sensitive. I seem to recall some rename bugs in older versions

Shows as fixed, but this could be something new.

Hmmm… It could be it, but I don’t think so. The reason I say this is because I renamed pretty must 90% of all the res:// directories. And when I say that, I do mean the folders via the editor, in the res:// structure. Not directly on the SSD. (Just making sure we understand each others.)

Also, Windows will properly display cases, it’s just iffy in some circomstances where case sensibility matters. It should be avoided to use the same name for anything with only cases as difference.

Finally, I CAN rename folders/directories. Something will definitely change. Just try to avoid doing so with scripts, I guess? :rofl:

I sometimes get the same parse error after renaming or moving script files. It feels like it doesn’t happen that often anymore in 4.2.2 but whenever it happens, I fix it like this:

  1. Change class_name to some temporary class_name (“MyClass” → “MyClass1”)
  2. Save the script
  3. Change class_name back to the original name (“MyClass1” → “MyClass”)
  4. Save the script
  5. Restart Godot