Cannot print() from lua code to windows 10 powershell
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Cannot print() from lua code to windows 10 powershell
I found this so post about printing to powershell?? LUA console? however I cannot grasp what it is saying.
https://stackoverflow.com/questions/421 ... tom-editor.
Should I download this console?? should I try to sth else? Should the Lua console come built in with love2d?
On ubuntu there was no such problem, everything worked out of the box.
Cheers
leankyr
Re: Cannot print() from lua code to windows 10 powershell
What exactly are you trying to do? PowerShell is just a command line tool - you don't print "to" it. If you just want to see the output of your program in a console window, run lovec.exe instead of love.exe (the former being the console version of LÖVE - in Windows there's a distinction between console programs vs windowed programs, unlike Linux).
And, as the SO post's answer mentions, Lua buffers output by default, so you probably want to put io.stdout:setvbuf("no") to the top of main.lua so you can see any output immediately.
And, as the SO post's answer mentions, Lua buffers output by default, so you probably want to put io.stdout:setvbuf("no") to the top of main.lua so you can see any output immediately.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: Cannot print() from lua code to windows 10 powershell
Thank you sir!! Running lovec instead of love from the powershell worked. I just had not noticed the lovec application in the ProgramFIles/love/.
Small irrelevant note: As I can see you cannot add files to an answer right?
Small irrelevant note: As I can see you cannot add files to an answer right?
Re: Cannot print() from lua code to windows 10 powershell
You have to change your build system in order to do that. Go to Tools > Build System > New Build System... in Sublime Text and paste:
then save and name it way you like. (maybe LOVE2D-Console) Next time when building your project, choose build system as LOVE2D-Console from Tools > Build System.
Also you can do the same thing by creating a conf.lua file and add t.console = true property. Check out config files.
Code: Select all
{
"selector": "source.lua",
"file_regex": "^Error: (?:[^:]+: )?([^: ]+?):(\\d+):() ([^:]*)$",
"windows": {
"cmd": ["lovec", "${folder:${file_path}}"],
"shell": true
},
}
Also you can do the same thing by creating a conf.lua file and add t.console = true property. Check out config files.
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest