I am trying to complete the edX games50 course, and I recently started it again after putting it down for about a month. A month ago, Sublime text 3 worked perfectly, now, for a reason I cannot understand, it won't build. I've tested the files with notepad++ and they run perfectly, but notepad++ hurts my eyes. The error I'm receiving is this:
Error
boot.lua:433: No code to run
Your game might be packaged incorrectly
Make sure main.lua is at the top level of the zip
Traceback
[C]: in function 'error'
[C]: in function 'xpcall'
I don't understand why I'm receiving this message now, since it worked a month ago and nothing has changed. The files also are not packaged in a zip, and main.lua is in the top level of the folder. It's really frustrating me. I did try packaging the files as a love executable and it worked fine then as well. The problem seems to be with Sublime Text 3. How can I get rid of this error?
Sublime Text 3 has stopped building main.lua files
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Sublime Text 3 has stopped building main.lua files
Since it works on Notepad++, the problem probably lies in Sublime. It probably has new running configurations. Did you update it recently?
Re: Sublime Text 3 has stopped building main.lua files
I don't recall an update. I did try reinstalling it and the lua love package, but that was after the problem had already started.
-
- Party member
- Posts: 563
- Joined: Wed Oct 05, 2016 11:53 am
Re: Sublime Text 3 has stopped building main.lua files
Sublime might be pointing to wrong destination folder when you run the build command, so I recommend checking the build system you are using to run löve.
Re: Sublime Text 3 has stopped building main.lua files
I opened up the build system, but I have no idea how to decipher this. Can anyone translate, or suggest what the problem might be based on this?MrFariator wrote: ↑Mon Jul 27, 2020 6:27 pm Sublime might be pointing to wrong destination folder when you run the build command, so I recommend checking the build system you are using to run löve.
This is also just the automatically installed lua love build system; I didn't change it.
Code: Select all
{
"file_regex": "^(?:(?:\t)|(?:.+: ))(.+):([0-9]+): (.*)$",
"selector": "source.lua",
"cmd": ["lua", "$file"],
"variants": [
{ "name": "Run",
"cmd": ["luajit", "$file"]
},
{ "name": "Love2D",
"shell": true,
"cmd": ["love", "${project_path:${folder:${file_path}}}"],
"osx":
{
"cmd": ["love ${project_path:${folder:${file_path}}}"]
}
},
{ "name": "ldoc: File",
"shell": true,
"cmd": ["ldoc -d $project_path/doc/$file_base_name -f markdown -t $file_base_name $file"]
},
{ "name": "ldoc: Project",
"shell": true,
"cmd": ["ldoc -d $project_path/doc -f markdown -t $project_base_name $project_path/src/"]
}
]
}
Re: Sublime Text 3 has stopped building main.lua files
This is assuming you use the "Love2D" variant in that build system... (also, I may be over-explaining things a bit)
The "${project_path:${folder:${file_path}}}" string is the important part when Sublime tries to launch LÖVE. As you may know, to run a LÖVE game you give love.exe (here, simply "love") the path to a .love file, or the path to a folder with main.lua, as its argument. The string here uses "variables" that gets replaced by Sublime when you run the build system. ${project_path:xxx} will get replaced by the path to the folder containing the current project file. If you're not using the project functionality in Sublime then that variable will be empty and you'll get the value of xxx instead (as a fallback value). In this string that value is ${folder:xxx} which is yet another variable (with another fallback) and so on...
Basically, if you're using the project functionality in Sublime then your main.lua should be in same folder as the .sublime-project file. If not, then you'll need the focused tab to be either main.lua or another file in the same folder (indicated by ${file_path} in the string) for the build system to work.
(See the docs for more info)
The "${project_path:${folder:${file_path}}}" string is the important part when Sublime tries to launch LÖVE. As you may know, to run a LÖVE game you give love.exe (here, simply "love") the path to a .love file, or the path to a folder with main.lua, as its argument. The string here uses "variables" that gets replaced by Sublime when you run the build system. ${project_path:xxx} will get replaced by the path to the folder containing the current project file. If you're not using the project functionality in Sublime then that variable will be empty and you'll get the value of xxx instead (as a fallback value). In this string that value is ${folder:xxx} which is yet another variable (with another fallback) and so on...
Basically, if you're using the project functionality in Sublime then your main.lua should be in same folder as the .sublime-project file. If not, then you'll need the focused tab to be either main.lua or another file in the same folder (indicated by ${file_path} in the string) for the build system to work.
(See the docs for more info)
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: Sublime Text 3 has stopped building main.lua files
Thanks for the explanation! Unfortunately, I've already been trying to launch it with the focused tab as the main.lua file. I might try the other method you describe, but I've since installed Atom, and it's been working fine, and unlike notepad++ it doesn't hurt my eyes. If anyone else has an idea, they're free to post them but I don't think it's necessary any longer.ReFreezed wrote: ↑Tue Jul 28, 2020 2:41 pm This is assuming you use the "Love2D" variant in that build system... (also, I may be over-explaining things a bit)
The "${project_path:${folder:${file_path}}}" string is the important part when Sublime tries to launch LÖVE. As you may know, to run a LÖVE game you give love.exe (here, simply "love") the path to a .love file, or the path to a folder with main.lua, as its argument. The string here uses "variables" that gets replaced by Sublime when you run the build system. ${project_path:xxx} will get replaced by the path to the folder containing the current project file. If you're not using the project functionality in Sublime then that variable will be empty and you'll get the value of xxx instead (as a fallback value). In this string that value is ${folder:xxx} which is yet another variable (with another fallback) and so on...
Basically, if you're using the project functionality in Sublime then your main.lua should be in same folder as the .sublime-project file. If not, then you'll need the focused tab to be either main.lua or another file in the same folder (indicated by ${file_path} in the string) for the build system to work.
(See the docs for more info)
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot] and 12 guests