Page 1 of 1

using t.console on linux [SOLVED]

Posted: Tue Aug 01, 2023 8:44 pm
by CodeRed
Hi, i have been wondering if there is a way to use the t.console on Linux or be able to replicate its function? My love set up is vscode using the love2d support extension to run the love appimage. The Linux Distro I am using is Linux Mint.

Re: using t.console on linux

Posted: Tue Aug 01, 2023 11:14 pm
by zz_zz

Re: using t.console on linux

Posted: Wed Aug 02, 2023 2:37 am
by CodeRed
that solution doesn't work for me because im using the appimage version of love so i can't use the love command.

Re: using t.console on linux

Posted: Wed Aug 02, 2023 10:53 am
by GVovkiv
CodeRed wrote: Wed Aug 02, 2023 2:37 am that solution doesn't work for me because im using the appimage version of love so i can't use the love command.
appimage is still executable, it doesn't work any differently from programs installed in different way. Just make sure that love appimage is runnable and run it in terminal. For example:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage

Re: using t.console on linux

Posted: Wed Aug 02, 2023 2:42 pm
by CodeRed
GVovkiv wrote: Wed Aug 02, 2023 10:53 am
CodeRed wrote: Wed Aug 02, 2023 2:37 am that solution doesn't work for me because im using the appimage version of love so i can't use the love command.
appimage is still executable, it doesn't work any differently from programs installed in different way. Just make sure that love appimage is runnable and run it in terminal. For example:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage
Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.

Re: using t.console on linux

Posted: Wed Aug 02, 2023 3:12 pm
by GVovkiv
CodeRed wrote: Wed Aug 02, 2023 2:42 pm Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.
Pass argument to game path to love appimage, where main.lua is?
Like:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage /path/to/game
And add io.stdout:setvbuf("no") on top of main.lua?

Re: using t.console on linux

Posted: Wed Aug 02, 2023 3:17 pm
by Andlac028
CodeRed wrote: Wed Aug 02, 2023 2:42 pm
GVovkiv wrote: Wed Aug 02, 2023 10:53 am appimage is still executable, it doesn't work any differently from programs installed in different way. Just make sure that love appimage is runnable and run it in terminal. For example:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage
Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.
To run your game through terminal, just add path to folder with main.lua to it:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage path/to/folder/with/main/lua
If you want to read input from terminal, just use io.stdin:read() or just io.read(). But this would pause execution of the program until something is written to terminal, so you may want to run it in another thread (not sure, if it would work…)

Re: using t.console on linux

Posted: Wed Aug 02, 2023 4:04 pm
by CodeRed
GVovkiv wrote: Wed Aug 02, 2023 3:12 pm
CodeRed wrote: Wed Aug 02, 2023 2:42 pm Yeah I can easily run love it self through a terminal just copy the location of love and past it into the terminal and press enter and it will run perfectly fine. I'm asking how to run my love game and be able to write to the console.
Pass argument to game path to love appimage, where main.lua is?
Like:

Code: Select all

/path/to/appimage/love-11.4-x86_64.AppImage /path/to/game
And add io.stdout:setvbuf("no") on top of main.lua?
oh thank didn't know you could just pass an argument to game path to love appimage where main.lua is. That fixed the problem thank you.

Re: using t.console on linux

Posted: Wed Aug 02, 2023 4:24 pm
by GVovkiv
CodeRed wrote: Wed Aug 02, 2023 4:04 pm oh thank didn't know you could just pass an argument to game path to love appimage where main.lua is. That fixed the problem thank you.
As I said, appimage love is just love, packaged as appimage, you can do with it same things, as other love *versions*, as dnf or flatpak distribution.