Problem with LOVE and Notepad++ [nppexec]

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Suppercut
Prole
Posts: 18
Joined: Sun Aug 05, 2012 4:10 pm

Problem with LOVE and Notepad++ [nppexec]

Post by Suppercut »

If I try to launch a LOVE2D game through nppexec, the game hangs without creating a window. The nppexec console never goes past "Process started >>>" until I go into Task Manager, find love.exe, and shut it down.

Launching it normally using the same exact command line option works just fine.

I have been having this problem since 0.9, and updating to 0.9.1 has not changed the issue at all.

Command:

Code: Select all

"C:\Program Files (x86)\LOVE\love.exe" "$(CURRENT_DIRECTORY)"
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Problem with LOVE and Notepad++ [nppexec]

Post by Ranguna259 »

Try adding love to your PATH variable and instead of using the love directory just type:

Code: Select all

"love" "$(CURRENT_DIRECTORY)" 
I rememmber having this issue back in 0.8.0.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
Suppercut
Prole
Posts: 18
Joined: Sun Aug 05, 2012 4:10 pm

Re: Problem with LOVE and Notepad++ [nppexec]

Post by Suppercut »

Ranguna259 wrote:Try adding love to your PATH variable and instead of using the love directory just type:

Code: Select all

"love" "$(CURRENT_DIRECTORY)" 
I rememmber having this issue back in 0.8.0.
That literally does the exact same thing. I've had LOVE in my path variables for ages, only reason I changed the command was because it was giving me this problem, and still is.

I never had a problem with this in 0.8, in fact using nppexec would print to Notepad's output section. This has to do with the different rendering system. I know that because when I first started having this issue N++ would spam errors about rendering, until 0.9.1 stopped making the errors.
User avatar
CaptainMaelstrom
Party member
Posts: 161
Joined: Sat Jan 05, 2013 10:38 pm

Re: Problem with LOVE and Notepad++ [nppexec]

Post by CaptainMaelstrom »

I have two suggestions, just in case you haven't tried them yet.

1.) Make a .love of your game and open it directly with love.exe. See if there are any weird errors, or if everything works fine.

2.) Re-install Np++ from scratch. Especially if you have been letting it auto-update for a while.

For reference, I've had no issues with NP++ and I've used both 0.9.0 and 0.9.1. Then again, I don't use nppexec much (just for C stuff really). But I have a custom shortcut that runs

"C:\love\love.exe" "C:\work\test"

etc. Pretty similar. Just my 2 cents, hope it helps.
G-Mang
Prole
Posts: 9
Joined: Sun Jun 01, 2014 12:21 am

Re: Problem with LOVE and Notepad++ [nppexec]

Post by G-Mang »

I had the same problem. An old post by Imp1 had a workaround that fixed it for me.

Create a batch file (I went with C:\Program Files\LOVE\loveit.bat) with the following script:

Code: Select all

"C:\Program Files\LOVE\love.exe" %1
In the Execute text box of nppexec, run the following command:

Code: Select all

"C:\Program Files\LOVE\loveit.bat" "$(CURRENT_DIRECTORY)"
I have no idea why this works, but now my Notepad++ execute runs a game window and outputs to console, so I'm not complaining. :)

Hope it works for you!
Srekel
Prole
Posts: 1
Joined: Thu Jun 05, 2014 8:21 pm

Re: Problem with LOVE and Notepad++ [nppexec]

Post by Srekel »

Hi,

Had the same problem.

The batch file didn't quite work for me. Here's what I put in mine:

"C:\Program Files\LOVE\love.exe" .

I then run it like this:

cd $(CURRENT_DIRECTORY)
run.bat

If I didn't cd first it didn't work.
User avatar
Suppercut
Prole
Posts: 18
Joined: Sun Aug 05, 2012 4:10 pm

Re: Problem with LOVE and Notepad++ [nppexec]

Post by Suppercut »

G-Mang wrote:I had the same problem. An old post by Imp1 had a workaround that fixed it for me.

Create a batch file (I went with C:\Program Files\LOVE\loveit.bat) with the following script:

Code: Select all

"C:\Program Files\LOVE\love.exe" %1
In the Execute text box of nppexec, run the following command:

Code: Select all

"C:\Program Files\LOVE\loveit.bat" "$(CURRENT_DIRECTORY)"
I have no idea why this works, but now my Notepad++ execute runs a game window and outputs to console, so I'm not complaining. :)

Hope it works for you!
This worked for me, but the problem I had is that I don't see what's printed to console until after I close the game. :(
Is there any other way to watch the output? nppexec used to be my main man for this...
G-Mang
Prole
Posts: 9
Joined: Sun Jun 01, 2014 12:21 am

Re: Problem with LOVE and Notepad++ [nppexec]

Post by G-Mang »

Suppercut wrote:This worked for me, but the problem I had is that I don't see what's printed to console until after I close the game. :(
Is there any other way to watch the output? nppexec used to be my main man for this...
Did you do one of these at the start of your scripts?

Code: Select all

io.stdout:setvbuf( "no" )
If that doesn't fix it I'm stumped. :?
User avatar
Suppercut
Prole
Posts: 18
Joined: Sun Aug 05, 2012 4:10 pm

Re: Problem with LOVE and Notepad++ [nppexec]

Post by Suppercut »

Oh mess it all, I think running my test .bat files and adding love._openConsole() has worked well enough for me. I'll stick with that for a while...
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Problem with LOVE and Notepad++ [nppexec]

Post by Positive07 »

I got it to work, using all the things listed in this thread:
I use this .bat file

Code: Select all

@echo off
cd D:\Program Files\Love 0.9.1\
:there
	if "%1" neq "" goto here
	call love.exe
	goto end
:here
	call love.exe %1
	goto end
:end
	exit
And I add this line at the beginning of main.lua

Code: Select all

io.stdout:setvbuf( "no" )
I comment this line on conf.lua

Code: Select all

--t.console = true
Then I created a command in Plugins > NppExec > Execute...

Code: Select all

NPP_SAVEALL
"D:\LOVE\run.bat" "$(CURRENT_DIRECTORY)"
I named it Love and saved it

Then in Plugins > NppExec > Advanced Options
In the Menu Item section I added Love to the menu

Then in Configuration > Shortcuts I added a shortcut to this Menu Item (Love) to trigger it with Ctrl + L

I changed the colors to the following:

Code: Select all

TextColorNormal    E0 E2 E4
TextColorError     EC 76 00
TextColorMessage   67 8C B1
BackgroundColor    29 31 34
I have enabled the filters in Plugin > NppExec > Console Output Filters...
And in the highlight tab I used the following filters

Code: Select all

Error: %FILE%:%LINE% *        0xEC 0x76 0x00 B
*[*]:*                        0xEC 0x76 0x00 I
*%FILE%:%LINE% *              0xEC 0x76 0x00 B
stack*traceback:*             0xEC 0x76 0x00 U
When there is an error you can double-click on the line that points you to the error and Notepad++ will take you there
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests