Page 1 of 1

Can't start the simple script

Posted: Sun Jun 16, 2019 3:42 am
by SammyWest
I've tried the command line, and inserting the basic hello world into the start up file. Would the block be due to it being in a folder that has required admin privelages? the error is boot.lua:481:

Do i need some sort of shebang line? do i need to include a specific library? I mean the sample on the website is far from intuitive.

Re: Can't start the simple script

Posted: Sun Dec 15, 2019 10:28 pm
by bobbymcbobface
The best way I can think of solving this is giving you the steps so here you are:

1. Find a location that can be accessed by anyone (so no admin restrictions)
2. Create a folder with a file in it called "main.lua"
3. Type in:

Code: Select all

function love.load()
    print("hi")
end
4. Run the command the close the window and then you should have hi printed in your console

Also if you want a window to open up and print in live time look into conf files on the wiki

Hope this helps :)

Re: Can't start the simple script

Posted: Sun Dec 15, 2019 10:36 pm
by zorg
What do you mean by block?
Why didn't you actually include the error text and just the line number where it occurred?
What sample on the website?

Too little info to actually help you, since tons could be going wrong, or alternatively, you might be doing something wrong as well.

For one, you'll always need at least a main.lua file in a folder;
if you don't have a conf.lua explicitly allowing a console window, you'll only get console output if you run lovec.exe instead of love.exe (even if you started it from an already existing cmd window, assuming windows)
if trying to do this from an IDE, it might indeed buffer console output, so you would need to put io:setvbuf('no') at the top of main.lua
if you're talking about the very first example on the homepage, then that uses love.graphics.print, which will print to the graphical window, not to the console.

Re: Can't start the simple script

Posted: Mon Dec 16, 2019 12:34 pm
by pgimeno
My suspicion is that LÖVE is being started passing the full path of the Lua file, instead of the folder where main.lua is as it should.