Page 2 of 2

Re: How to run both love2d and lua

Posted: Thu Aug 25, 2022 4:51 am
by togFox
print(text)
or
print('e')

And use lovec.exe so you can see the console.

Re: How to run both love2d and lua

Posted: Thu Aug 25, 2022 9:49 am
by GVovkiv
itsatomf wrote: Thu Aug 25, 2022 1:42 am
GVovkiv wrote: Wed Aug 24, 2022 10:59 am love is just lua (luajit to be specific) interprier with bundled ontop sdl2, audio coding/decoding, and more functionality, so i'm not sure what you mean.
I mean like, I can't run both lua and love2d function, like I can love.graphics.print("e") to the screen, but I can't print("e") (<- is a builtin function btw not love.graphics.print(), just print()) to the terminal.
You can. You can use print() anywhere, even in love.draw(), love.update(), etc. What exactly you mean by @i can't use built-in lua functions with love"? You can't see output of "print()"? If that's the problem, then it's not "how to use built-in lua functions in love". Make sure that your ide or whatever you use was configured to output something.
Or, maybe, just maybe, you talking about output buffering, which will not send anything to terminal until game is closed?
try call io.stdout:setvbuf("no") (http://www.lua.org/manual/5.2/manual.ht ... %3asetvbuf) at start of your main.lua. After that love will send anything with "print()" immediately in terminal.

Re: How to run both love2d and lua

Posted: Fri Aug 26, 2022 10:10 am
by itsatomf
BrotSagtMist wrote: Thu Aug 25, 2022 2:11 am You where trying it without quotation marks the whole time i must assume.
print('e') will absolutely work. print(e) will not...
oops um that's a typo but I swear I tried it with the quotation mark and it didn't work either :cry:

Re: How to run both love2d and lua

Posted: Fri Aug 26, 2022 11:12 am
by Andlac028
Maybe you have problem with output buffering? Try adding

Code: Select all

io.stdout:setvbuf("no")
to the top of main.lua