How to View print()-ed stuff.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How to View print()-ed stuff.
I have searched the wiki and the forums for how to view the output of the print() function and i cannot figure out how to. I would like to use this for debugging, and would appreciate any help. I am not new to LUA, but have only been using LOVE for 3 days now.
Re: How to View print()-ed stuff.
Create a conf.lua file next to your main.lua file that contains this:
For more info, see Config_Files.
Code: Select all
function love.conf(t)
t.console = true
end
Re: How to View print()-ed stuff.
Thank you very much! Works perfectly.
Re: How to View print()-ed stuff.
In my experience, that is not necessary. I code my LÖVE games in gedit, and when I run the games within gedit through the addon "external commands" (or something like that), the output from print() appears in a box below the code, without having to set t.console = true.
Actually, I noticed now that when I run LÖVE games in the terminal directly, I also get the output without having to do t.console = true. I guess it's a difference between Linux and whatever OS (Windows?) SeaOfTime is using?
Actually, I noticed now that when I run LÖVE games in the terminal directly, I also get the output without having to do t.console = true. I guess it's a difference between Linux and whatever OS (Windows?) SeaOfTime is using?
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How to View print()-ed stuff.
t.console = true is only for Windows, since on Unix there is no distinction between a terminal program and a non-terminal program. On Windows there is a distinction.
When testing, I always run games in the terminal, since I can see the print output then.
When testing, I always run games in the terminal, since I can see the print output then.
Help us help you: attach a .love.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: How to View print()-ed stuff.
On OS X I run my program through the terminal too. But in my current project. I decided to roll my own Debugger to print the messages on the game screen instead so I can leave the Terminal out of it.
Re: How to View print()-ed stuff.
I'm on OS X and I'm not seeing any output when I call print() Is there a particular way that you run your programs through the terminal? I've been using open -n -a love "MyApp" (not sure what the -n and -a are doing...).
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How to View print()-ed stuff.
Have you tried love MyApp? (or love . if you're in the same directory as your game).Bryant wrote:I'm on OS X and I'm not seeing any output when I call print() Is there a particular way that you run your programs through the terminal? I've been using open -n -a love "MyApp" (not sure what the -n and -a are doing...).
Help us help you: attach a .love.
Re: How to View print()-ed stuff.
Hmm, I just tried that, but I got this error message: "-bash: love: command not found." I also tried adding the folder containing the Love application file to my path environmental variable (I added a file with the directory to paths.d), but I still get the same error message...Robin wrote:Have you tried love MyApp? (or love . if you're in the same directory as your game).Bryant wrote:I'm on OS X and I'm not seeing any output when I call print() Is there a particular way that you run your programs through the terminal? I've been using open -n -a love "MyApp" (not sure what the -n and -a are doing...).
Re: How to View print()-ed stuff.
open's not going to help you here. What you want is to call the love executable directly. There's two ways of doing this:
1) Refer to it every time. You'll need to know where you installed LÖVE for this - for instance, if you put love.app in /Applications, the command would be "/Applications/love.app/Contents/MacOS/love MyApp"
2) Make an alias. Create a pointer to that longer path that the Terminal can find, in /usr/local/bin or the like. "ln -s /Applications/love.app/Contents/MacOS/love /usr/local/bin/love" - then you can just type "love MyApp" every time you want to run something from Terminal.
1) Refer to it every time. You'll need to know where you installed LÖVE for this - for instance, if you put love.app in /Applications, the command would be "/Applications/love.app/Contents/MacOS/love MyApp"
2) Make an alias. Create a pointer to that longer path that the Terminal can find, in /usr/local/bin or the like. "ln -s /Applications/love.app/Contents/MacOS/love /usr/local/bin/love" - then you can just type "love MyApp" every time you want to run something from Terminal.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest