vladXh
vladXh

Reputation: 11

using a batch file to open lua love is giving error

I just started learning love and I've tried opening love with a batch file, while it does open it gives this error

Error

[love "boot.lua"]:321: No code to run
Your game might be packaged incorrectly.
Make sure main.lua is at the top level of the zip.


Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'error'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

however when dragging the whole folder inside of love it works perfectly, does somebody know how can I fix this?

Upvotes: 0

Views: 929

Answers (1)

Aiq0
Aiq0

Reputation: 381

Error message

Error message indicates, that you did not set correct path to your code, so the is no code to run. It should be folder containing main.lua

Simple batch file

Place the following code to file start.bat:

@ECHO OFF

"C:\Program Files\LOVE\love.exe" "C:\path\to\game\folder"

(replace C:\path\to\game\folder with actual path to folder containing main.lua and if you have love.exe elsewhere, also replace it to the correct path)

And then, you can run your code by double-clicking the start.bat file

Some helpful links:

How to run your game
Batch file example

Upvotes: 1

Related Questions