Has anyone ever made anything that can essentially function as an in game terminal?
Basically, I hit F1 or whatever key I assign this library to and it pops up with a window where I can directly type in codes of lua. Something like his would make debugging stuff far easier.
In love terminal
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: In love terminal
Add this to your main.lua file, and there you have it!
That will stop the game and you can then write stuff into the terminal that you started the game from. To continue with the game, just run:
Code: Select all
function love.keypressed(key, u)
--Debug
if key == "rctrl" then --set to whatever key you want to use
debug.debug()
end
end
Code: Select all
cont
Re: In love terminal
.................................................FFFFFFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU!!!!!!!!!!!!!!!!!!!
Re: In love terminal
This is an awesome feature! You could do livecoding performances with that!
Re: In love terminal
I Tried, but in windows it needs the "console"
the only ways to activate it are:
1) --console
2) in conf.lua t.console = true
would be nice to open it at runtime
the only ways to activate it are:
1) --console
2) in conf.lua t.console = true
would be nice to open it at runtime
Bartoleo
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: In love terminal
Yeah, but come on, who develops in Windows?bartoleo wrote:I Tried, but in windows it needs the "console"
the only ways to activate it are:
1) --console
2) in conf.lua t.console = true
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: In love terminal
Well, yes it needs that, but I for one always use the terminal to dump my debug messages, so I'll always need a terminal for debugging anyway.
Also, I'd like to note that this is a lua feature and not a LÖVE feature, which is a for my responsibility, but a because.. well, I didn't make such a cool feature..
Also, I'd like to note that this is a lua feature and not a LÖVE feature, which is a for my responsibility, but a because.. well, I didn't make such a cool feature..
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: In love terminal
Holy crap! That works!
I had originally created one that would, when I press Tilde (~) give me a screen where I can type commands like in Quake engines, and when I press Enter it would save the code to a Lua file and run it. But it wouldn't work right so I gave up. THIS is so much better and exactly what I need. Awesome!
Edit: @Bartbes: Me too. I have the console (Terminal) open all the time and run the game from it every time so I can read the debug printouts I put in there for testing. So glad you told us about this.
I had originally created one that would, when I press Tilde (~) give me a screen where I can type commands like in Quake engines, and when I press Enter it would save the code to a Lua file and run it. But it wouldn't work right so I gave up. THIS is so much better and exactly what I need. Awesome!
Edit: @Bartbes: Me too. I have the console (Terminal) open all the time and run the game from it every time so I can read the debug printouts I put in there for testing. So glad you told us about this.
Re: In love terminal
Yea I figured this was a lua one since it wasn't anywhere in the wiki. Every time I've used lua the framework or engine had it's own console do this anyways so I've never known about it. Oh the troubles I could have saved already. At least I didn't try to make my own gui version.bartbes wrote:Also, I'd like to note that this is a lua feature and not a LÖVE feature'
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: In love terminal
Hey! It wasn't that hard to implement. I'm just glad this way is better.Lap wrote:Yea I figured this was a lua one since it wasn't anywhere in the wiki. Every time I've used lua the framework or engine had it's own console do this anyways so I've never known about it. Oh the troubles I could have saved already. At least I didn't try to make my own gui version.bartbes wrote:Also, I'd like to note that this is a lua feature and not a LÖVE feature'
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests