Running Via Command Line - GameGrumpsJointJustice/courtengine GitHub Wiki

Tips for running via command line on MacOS

Make sure your Love2D application is in your /Applications/ folder, and add the following line to your ~/.bash_profile to use the love command in the terminal:

(NOTE: you may have to create ~/.bash_profile yourself, as it may not already exist. For more information see https://love2d.org/wiki/Getting_Started)

alias love="/Applications/love.app/Contents/MacOS/love"

Then, run the following to start the game from the beginning (while terminal is in the directory of the main.lua file):

love .

Tips for running via Command Prompt on Windows

Locate where you installed Love2D (love.exe); it typically defaults to C:\Program Files\LOVE\.

Option 1: The Tedious Way aka "I'm not touching my environment variables"

cd into whichever directory contains the game files.

To run the game from the beginning:

[path to love.exe] .

If there is whitespace in your path, you must wrap it in quotation marks.

For example, if love.exe is in the default directory, the command would be:

"C:\Program Files\Love\love.exe" .

Option 2: Adding Love2D to your Environment Variables

From the start menu, search for environment variables and select the option that says Edit the system environment variables.

A small "System Properties" window will pop up. Click on the button towards the bottom of the window that says Environment Variables.... Another window will pop up.

In the top box labeled User variables for [your username] highlight (by clicking on) the variable named Path, then click the Edit... button directly below the box.

Click the New button and enter the path to the Love2D directory you located earlier (C:\Program Files\LOVE\ by default). Press the enter key then close all the small windows by clicking OK.

Now in Command Prompt, cd into whichever directory contains the game files.

To run the game from the beginning:

love .

Optional Arguments

When running in the command line, there are optional arguments that you can pass in that may be useful for testing the game. Please note that even on Windows, when passing the path to the script file, you must still use forward slashes /. It's also possible to pass in debug as an argument to cause the scroll speed of text to be increased by a factor of 8. e.g. love . debug.

For example, on you can pass in a script file as an argument to test it out directly:

love . script "scripts/[scriptname].script"

You can also run the following to skip a specific number of events:

love . skip [number of events to be skipped]

You can even combine both at the same time, like this:

love . script "scripts/e1s1.script" skip 50