[ModBuddy Extension] Better LUA Editor (Faster + IntelliSense)

CommanderZ

Warlord
Joined
Nov 24, 2007
Messages
182
Location
Prague, Czech. Rep.
About Better LUA Editor

The default LUA editor present in ModBuddy is crappy as hell. The time has come time to replace the weakest link!

This extension offers LUA editor which is both faster and more feature rich. It even offers full IntelliSense (code suggestions) support! Just hit CTRL + SPACE!

This extension is slightly modified NPLLanguageService (all the credit goes to the original author).

Installation

The installation is a little different this time (NPLLanguageService is not open-source, so I had to improvise).

1) Install either Vanilla Assets Browser or this fix (follow the installation instructions in the Vanilla Assets Browser thread)
2) Close ModBuddy
3) Go to <ModBuddy directory>/Extensions/Application
4) Delete (or move somewhere outside this directory) file LuaLanguage.dll
5) Download the attached archive and extract into this directory
6) Done

Note that any update to ModBuddy can break this.

Screenshot

 

Attachments

  • npl.png
    npl.png
    18.7 KB · Views: 2,910
  • NPLLanguageService_ModBuddy.rar
    153.6 KB · Views: 1,539
Awesome. I hoped it was that simple, but not knowing much about extensions, really wasn't sure.
 
I tried installing this today, and it didn't work for me. I extracted to Extensions/Application as directed. I receive this error when I open a project with ModBuddy:
The 'ParaEngine.NPLLanguageService.NPLLanguageServicePackage, NPLLanguageService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41ff0186ca09b5f1' package did not load correctly.
The project loads, but when a lua file is opened, it crashes ModBuddy.

Edit:
I then went and installed the Vanilla Asset Browser, to see if that worked, and after installing it, both extensions work fine. Does the NPL extension rely on something that Vanilla does?
 
Hmm.

Try this:
Open the "extension.vsixmanifest" file in the <ModBuddy dir>/extensions/Application, locate the <Content> section and remove the line with LuaLanguage.dll and add a new VSPackage line with path NPLLanguageService/1.0/NPLLanguageService.pkgdef.

I'm at work right now, I will look into this more when I am at home.

BTW, do you have any version of real stand-alone Visual Studio (so ModBuddy doesn't count) installed?
 
Yeah, I have VS 2010 Ultimate installed currently. But, as my edit said, it works now that I've installed VAB.
 
Hi, I tried to use this alternate LUA extension, because the slow typing is driving me nuts. I got the same error & crash as JeBuS27 did. I have Microsoft Visual C# 2010 Express - ENU installed.

I tried your suggested fix of editing the extension.vsixmanifest. It no longer gives me the error message, but it still crashes the same way soon after I open a .lua file. It doesn't let me edit the file, in fact it doesn't even display it.

Any other ideas? I'll check back later, hopefully I won't need to also install this Vanilla Asset Browser.
 
I'm looking into this now. Could any of you (who has the problem) please answer these questions?

1) Do you have NPLLanguageService installed for regular VS?
2) Do you have any other ModBuddy extensions installed?
3) Is the NPLLanguageService listed in the Extension manager (Tools->Extension manager)
4) Does "NPLLanguageServiceToolbar" appear in View->Toolbars
5) Does attached registry file fix the problem?

And for those, for whom the installation of VAB fixed the issue, does the error start happening again once you uninstall the VAB (Tools->Extension manager)? Does it happen when VAB is disabled in Extension manager?

If the error keeps happening, please post the log file.

Thank you for helping me fix this.
 

Attachments

  • npl.rar
    370 bytes · Views: 173
Hi, CommanderZ. Ok, I gave it another shot...

I noted that I also have 4 other version of MS VS installed apparently, not sure where they all came from. Version 8, 9.0, and a blank one. In addition to 10.0. I don't imagine it matters.

To answer your queries:

1) No. Barely ever used it, nothing funky in it. Pretty much vanilla install back in May.
2) No. Vanilla ModBuddy install until this.
3) Yes. Looks correctly installed, appears under Tools, has logo, etc.
4) Yes. Toolbar is there, and appear and seems to work.
5) No, it didn't. I checked the registry, the new entries are there. But it crashes just the same, as soon as I try to open any .lua file.

Before changing the registry, I also tried deleting the line <MefComponent>LuaLanguage.dll</MefComponent> from the extension.vsixmanifest file without adding in the NPLLanguageService.pkgdef line. That didn't help either.

Thanks for digging into this for us...
 
Ok, I have a suspicion on what causes it. Please install the attached extension, it should fix your problem. And don't worry, it has exactly zero executive code, it just registers several small resources NPL might need (which might be otherwise accidentally provided by VAB).
 

Attachments

  • NPLCompatibilityFix.rar
    4.5 KB · Views: 484
Woot, I finally got it to work! And it seems much faster than the old editor. Not without a fair degree of extra trouble, however...

When I first double-clicked the NPLCompatibilityFix.vsix you provided I got this error message from the Visual Studio Extension Installer: "This extension is not installable on any currently installed products."

I thought maybe registering ModBuddy would be necessary, so I followed the directions you posted here: http://forums.civfanatics.com/showthread.php?t=387554. But it didn't work, I didn't see any messages about anything being registered. And I still got the same error running that.vsix file.

Fortunately, I went back and read the rest of that thread. The post from ArgentumStudios,
When I did it, I had to actually double click on the .exe sitting next to the pkgdef file, running it through Steam or any of the shortcuts didn't read it for some reason.

is the key. I did the same, got the "registered" message, exited ModBuddy, ran the .vsix file again, now it worked (listing ModBuddy), so I did that update, and now the editor is no longer crashing!

So anyhow, thanks for all this. I would suggest you update the instructions in this thread to mention you will need to register and add the vsix file up there. And you should also update the other thread to mention you probably have to execute ModBuddy.exe from the Steam directory itself in order for the registration to work... So that others don't have to digest the full content of these thread to get it working.
 
So I've been using this, but I'm having a weird, annoying problem. I'm wondering if it's related to this new .LUA editor? For some reason, my Page Down key doesn't work when I'm editing a .LUA file. Page Up works just fine, and Page Down works as soon as I switch to .xml or .txt. I only noticed this happening shortly after I'd had a ModBuddy crash during the editing of my Mod's ModInfo. I can't be sure if it did or did not work before that point, because I wasn't doing that much editing. I suspect that it did work, and it's only been since the crash that it's broken.

Any ideas on how to fix it? If I go to the Extension Manager in ModBuddy, and select NPLLanguageService, for some reason the "Disable" and Uninstall" buttons are both greyed out and unusable. I tried first disabling then re-enabling the NPLCompatibilityFix. That did not fix the PageDown key. However, I get an error warning when ModBuddy tried to restart after disabling/enabling the fix. Something about "package did not load correctly". It doesn't seem to break anything, though.
 
So I've been using this, but I'm having a weird, annoying problem. I'm wondering if it's related to this new .LUA editor? For some reason, my Page Down key doesn't work when I'm editing a .LUA file. Page Up works just fine, and Page Down works as soon as I switch to .xml or .txt. I only noticed happening this shortly after I'd had a ModBuddy crash during the editing of my Mod's ModInfo. I can't be sure if it did or did not work before that point, because I wasn't doing that much editing. I suspect that it did work, and it's only been since the crash that it's broken.

Any ideas on how to fix it? If I go to the Extension Manager in ModBuddy, and select NPLLanguageService, for some reason the "Disable" and Uninstall" buttons are both greyed out and unusable. I tried first disabling then re-enabling the NPLCompatibilityFix. That did not fix the PageDown key. However, I get an error warning when ModBuddy tried to restart after disabling/enabling the fix. Something about "package did not load correctly". It doesn't seem to break anything, though.
I've had the same PageDown problem, and to my knowledge my ModBuddy hasn't crashed. Never noticed it with the default Lua editor, or in other editors, and only since adding the NPL editor.
 
Yesterday I had an issue where several keys refused to work until I restarted ModBuddy. I believe they were all the keys on the right half of the keyboard.
 
Well at least I know I'm not alone in this. In my case it's not intermittent, it's always that way, and exiting ModBuddy doesn't help. I did a bunch of googling with no luck. I tried to figure out if I might have somehow mapped the PgDn key to do something else, but there's literally a zillion possible key bindings in Tools->Options->Keyboard, it's a pain to search though.
 
Top Bottom