Print not printing.[Sloved]

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
User avatar
zalander
Citizen
Posts: 72
Joined: Mon Jan 09, 2023 5:58 am
Location: India

Print not printing.[Sloved]

Post 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 :(
Last edited by zalander on Sun Dec 31, 2023 5:48 am, edited 1 time in total.
Using LOVE to make everything except games :crazy:

Code: Select all

astring = "pog"
print(astring)
--pog
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: Print not printing.

Post 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.
Attachments
console.love
(885 Bytes) Downloaded 33 times
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
User avatar
zalander
Citizen
Posts: 72
Joined: Mon Jan 09, 2023 5:58 am
Location: India

Re: Print not printing.

Post 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
Attachments
Untitled.png
Untitled.png (10.67 KiB) Viewed 20026 times
Using LOVE to make everything except games :crazy:

Code: Select all

astring = "pog"
print(astring)
--pog
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Print not printing.

Post 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")
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
zalander
Citizen
Posts: 72
Joined: Mon Jan 09, 2023 5:58 am
Location: India

Re: Print not printing.

Post by zalander »

Thanks for the help ! It works now :D
Using LOVE to make everything except games :crazy:

Code: Select all

astring = "pog"
print(astring)
--pog
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 62 guests