Page 1 of 1

Print not printing.[Sloved]

Posted: Thu Dec 28, 2023 2:03 pm
by zalander
Sup
Im working on some dumb stuff and print wont print.
This is a file verification code i wrote this is called from the conf.lua file

Code: Select all

local files = {
    -- name of the files
    "main.lua",
    "conf.lua"
    -- other files
}
for i = 1, #files, 1 do
    print("Verifing..."..files[i])
    if not(love.filesystem.getInfo(files[i])) then
        print(files[i].." Not found")
        error("Installation is damaged "..files[i].." not found")
    end
    print("Done verified..."..files[i])
end
And here is the conf.lua

Code: Select all

function love.conf(t)
    t.console = true
    t.version = 11.5
    require("libs/verify") -- called here
end
The print statement wont print to the console.
I use a VS code extention to read the console it is shown in there (Its supposed to show the console output after I have closed LOVE).
Soooo is this a bug ? Or im just stupid.
My brain is not braining any more :(

Re: Print not printing.

Posted: Thu Dec 28, 2023 8:53 pm
by milon
Works for me!
I took the above and made a .love file (attached). I tried both by calling love on the main.lua I created, and from running the .love directly.

The main.lua I created just contains:
print("This concludes the broadcast test. : )")

The total console output I get is:

Code: Select all

Verifing...main.lua
Done verified...main.lua
Verifing...conf.lua
Done verified...conf.lua
This concludes the broadcast test.  :)
EDIT - If it matters, I'm using Geany (IDE) on Linux Mint 21.2.

Re: Print not printing.

Posted: Fri Dec 29, 2023 2:35 am
by zalander
It does not work for me :(
Output:

Code: Select all

This concludes the broadcast test.  :)
It does not print aything from verify.lua.
Edit: I am using Windows 11 with WSL and my ide is VS code and Love 11.5

Re: Print not printing.

Posted: Fri Dec 29, 2023 11:18 am
by zorg
Try doing this at the top of your main.lua, because sometimes writes to console get buffered and it might not print in time or some sillyness like that:

io:setvbuf("no")

Re: Print not printing.

Posted: Fri Dec 29, 2023 12:00 pm
by zalander
Thanks for the help ! It works now :D