Page 1 of 1

Sublime Text isn't working with Love

Posted: Fri Oct 31, 2014 1:14 am
by Juice_Box
I know this question has been asked about a million times, but I can't find a fix (at all) for this. I'm trying to make a build system in Sublime Text 2 for love but I keep on getting the same error,

Code: Select all

'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.1s with exit code 1]
The code that i have entered is the default build system listed at the site http://love2d.org/wiki/Sublime_Text_2
[Note that my OS is Windows 7]

I hope that I'm not posting this in the wrong section at all, but if I am, then sorry. This is my first post on the forum :|

Re: Sublime Text isn't working with Love

Posted: Fri Oct 31, 2014 1:58 am
by s-ol
Juice_Box wrote:I know this question has been asked about a million times, but I can't find a fix (at all) for this. I'm trying to make a build system in Sublime Text 2 for love but I keep on getting the same error,

Code: Select all

'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.1s with exit code 1]
The code that i have entered is the default build system listed at the site http://love2d.org/wiki/Sublime_Text_2
[Note that my OS is Windows 7]

I hope that I'm not posting this in the wrong section at all, but if I am, then sorry. This is my first post on the forum :|
The problem is that there's a space in the path. Add your love install location to the PATH environment variable (google it), then set this as the build system:

Code: Select all

{
    "selector": "source.lua",
    "cmd": ["love", "${project_path:${file_path}}"],
    "shell": true,
    "file_regex": "^Error: (?:[^:]+: )?([^: ]+?):(\\d+):() ([^:]*)$"
}
or even better, install the "LuaLove" package and modify the build system (C:\Users\....\AppData\Roaming\Sublime Text 2\Packages\Lua Love\LuaLove.sublime-build) to look like this:

Code: Select all

{
	"file_regex": "^(?:(?:\t)|(?:.+: ))(.+):([0-9]+): (.*)$",
	"selector": "source.lua",
	"shell": true,
	"cmd": ["love", "${project_path:${file_path:.}}"],

	"variants": [
		{
			"name": "Love2D",
			"shell": true,
			"cmd": ["love", "${project_path:.}"],
			"osx":
			{
				"cmd": ["love $project_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/"]
		}
	]
}
I also updated the wiki with this information.

Re: Sublime Text isn't working with Love

Posted: Sat Nov 01, 2014 1:31 am
by Juice_Box
S0lll0s wrote:
Juice_Box wrote:I know this question has been asked about a million times, but I can't find a fix (at all) for this. I'm trying to make a build system in Sublime Text 2 for love but I keep on getting the same error,

Code: Select all

'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.1s with exit code 1]
The code that i have entered is the default build system listed at the site http://love2d.org/wiki/Sublime_Text_2
[Note that my OS is Windows 7]

I hope that I'm not posting this in the wrong section at all, but if I am, then sorry. This is my first post on the forum :|
The problem is that there's a space in the path. Add your love install location to the PATH environment variable (google it), then set this as the build system:

Code: Select all

{
    "selector": "source.lua",
    "cmd": ["love", "${project_path:${file_path}}"],
    "shell": true,
    "file_regex": "^Error: (?:[^:]+: )?([^: ]+?):(\\d+):() ([^:]*)$"
}
or even better, install the "LuaLove" package and modify the build system (C:\Users\....\AppData\Roaming\Sublime Text 2\Packages\Lua Love\LuaLove.sublime-build) to look like this:

Code: Select all

{
	"file_regex": "^(?:(?:\t)|(?:.+: ))(.+):([0-9]+): (.*)$",
	"selector": "source.lua",
	"shell": true,
	"cmd": ["love", "${project_path:${file_path:.}}"],

	"variants": [
		{
			"name": "Love2D",
			"shell": true,
			"cmd": ["love", "${project_path:.}"],
			"osx":
			{
				"cmd": ["love $project_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/"]
		}
	]
}
I also updated the wiki with this information.
I did the LuaLove thing, and set up everything(I didn't set up the environment variable,) I changed the environment var. part to

Code: Select all

"cmd": ["C:\"Program Files (x86)\"LOVE\"love.exe", "${project_path:${file_path:.}}"],
I don't know if i did something wrong, but when i build (even when i build a project with the "hello world" code in it) it just opens up love with no game.. At least it actually opens love now.

Re: Sublime Text isn't working with Love

Posted: Sat Nov 01, 2014 2:05 am
by s-ol
Make sure the file is called main.lua. Also that cmd string looks really weird, but if it works go ahead and keep it.

Re: Sublime Text isn't working with Love

Posted: Sat Nov 01, 2014 2:23 am
by Juice_Box
S0lll0s wrote:Make sure the file is called main.lua. Also that cmd string looks really weird, but if it works go ahead and keep it.
the file is infact called main.lua. and is in its own folder

Re: Sublime Text isn't working with Love

Posted: Sat Nov 01, 2014 6:10 pm
by s-ol
Juice_Box wrote:
S0lll0s wrote:Make sure the file is called main.lua. Also that cmd string looks really weird, but if it works go ahead and keep it.
the file is infact called main.lua. and is in its own folder