Sublime text love2d build

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
vitail
Prole
Posts: 26
Joined: Thu Apr 09, 2015 8:37 pm

Sublime text love2d build

Post by vitail »

i want to build from sublime text 2 and i get this

Code: Select all

'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.2s with exit code 1]
using this code

Code: Select all

{
    "selector": "source.lua",
    "cmd": ["C:/Program Files/LOVE/love.exe", "${project_path:${file_path}}"],
    "shell": true,
    "file_regex": "^Error: (?:[^:]+: )?([^: ]+?):(\\d+):() ([^:]*)$"
}
and with this code

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"],
			"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/"]
		}
	]
}
if i build with that code i got this

Code: Select all

The system cannot find the file specified
[cmd:  [u'lua', u'C:\\Users\\Alvaro Fernandez\\Downloads\\Enzo the hero\\pong w love2d\\src\\main.lua']]
[dir:  C:\Users\...\Downloads\...\pong w love2d\src]
[path: C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\HaxeToolkit\haxe\;C:\HaxeToolkit\neko]
[Finished]
szensk
Party member
Posts: 155
Joined: Sat Jan 19, 2013 3:57 am

Re: Sublime text love2d build

Post by szensk »

For the later file, the default build is Lua (which evidently isn't on your system path).

On Windows you need to have:
1) Love on your system path.
2) Use the command palette (ctrl+shift+p), type "l2d" and press enter.

That's my regular flow, I didn't want to change it. You can though! It's just text.

For the first one, it should be like so:

Code: Select all

{
    "selector": "source.lua",
    "cmd": ["C:\\Program Files\\LOVE\\love.exe", "${project_path:${file_path}}"],
    "shell": true,
    "file_regex": "^Error: (?:[^:]+: )?([^: ]+?):(\\d+):() ([^:]*)$"
}
User avatar
master both
Party member
Posts: 262
Joined: Tue Nov 08, 2011 12:39 am
Location: Chile

Re: Sublime text love2d build

Post by master both »

I use this for any love game.

Code: Select all

{
    "selector": "source.lua",
    "cmd": ["/Applications/love.app/Contents/MacOS/love", "$file_path"]
}
And this for projects, although the project file has to be in the same folder as the main.lua.

Code: Select all

{
	"selector": "source.lua",
	"cmd": ["/Applications/love.app/Contents/MacOS/love", "$project_path"]
}
I hope it helps :D
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest