Problem when changing file extensions (SOLVED)


Hello. I started learning the development environment, yesterday. So am expecting this to be a stupid question, but after a day of googling and fiddling with stuff. I’m stumped.

I loaded the example for the Text Printer asset. Started it, and it works.
I wanted to edit the example code, but BBEdit doesn’t recognize the file as Lua. So I changed the file to .lua.
I also changed the path to the printer game object’s script to reflect this.
Didn’t edit the file.

Started the game and it crashes. “0x2d894b5d SpeechSynthesis _sigtramp+29”

I am guessing that the path to the script is declared in other places, but I can’t figure out where.

also weird: I tried to set the game object’s scrip by using the resource browser, but the script did not appear in the list.



So in other words, you changed a .script file to a .lua file, and the game crashed? (with a very unhelpful error message?) Does the game crash after starting, or does it fail to build at all?

It’s quite likely that the editor requires the right file extension, so you just can’t do this. Certainly the resource selector will be filtered by file extension so you can’t set a ‘.collection’ file as a script or anything like that.

1 Like


Defold script files are slightly different from the general .lua files, so generally, code editors don’t recognize them ( I manually set the language to Lua in Npp when I have to edit the script externally).

There’s nothing weird here. The resource browser is looking for .script file, but the file isn’t a .script file anymore, so it didn’t pop up.

Via a text editor ?

1 Like


Okay. Fun thing is, the example code used the extension “.gui_script”

Sounds like the resource browser just wants the file name to end in ‘script’.

Also it has other code files that end in “.lua”
thus my confusion.

Thank you both for quick answers and suggestions!



Defold has three kinds of basic kinds of um… “scripts” -

  1. Scripts - These *.script files generally hold game logic, and are attacked to game objects for performing actions
  2. Gui_Scripts - These *.gui_scripts hold the logic for exclusively controlling guis, and can only be attached to GUI.
  3. Lua modules - These are the *.lua files that hold data that are to be shared between scripts and levels.

Read more about scripts, GUI scripts and lua modules here.



And also the fearsome render scripts! :smiley:



That clears everything up! I’m very glad for your post.

1 Like