View Full Version : [ModBuddy Extension] Better LUA Editor (Faster + IntelliSense)
CommanderZ
Oct 12, 2010, 03:19 PM
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 (http://visualstudiogallery.msdn.microsoft.com/de-DE/7782dc20-924a-4726-8656-d876cdbb3417) (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 (http://forums.civfanatics.com/showthread.php?t=387617) or this fix (http://forums.civfanatics.com/attachment.php?attachmentid=269039&d=1287313503) (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
http://forums.civfanatics.com/attachment.php?attachmentid=268423&stc=1&d=1286914610
JeBuS27
Oct 12, 2010, 03:54 PM
Awesome. I hoped it was that simple, but not knowing much about extensions, really wasn't sure.
jwallstone
Oct 12, 2010, 04:41 PM
Cool. Will try.
JeBuS27
Oct 13, 2010, 07:14 AM
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.NPLLanguageServiceP ackage, 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?
CommanderZ
Oct 13, 2010, 07:30 AM
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?
JeBuS27
Oct 13, 2010, 07:32 AM
Yeah, I have VS 2010 Ultimate installed currently. But, as my edit said, it works now that I've installed VAB.
CommanderZ
Oct 13, 2010, 08:04 AM
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?
It shouldn't. I will investigate this later.
Valkrionn
Oct 16, 2010, 02:11 AM
I'd just like to say that I'm seeing the same thing JeBuS27 is; Without the Asset Browser, this isn't working.
Even after registering it as an Isolated Shell, this does not work; It is only after the assets browser is fully installed that it works correctly.
Perkus
Oct 16, 2010, 02:39 AM
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.
CommanderZ
Oct 16, 2010, 03:51 AM
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.
Perkus
Oct 16, 2010, 05:07 PM
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...
CommanderZ
Oct 17, 2010, 06:05 AM
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).
Perkus
Oct 17, 2010, 02:24 PM
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.
CommanderZ
Oct 17, 2010, 03:34 PM
Ok, I have updated all the instructions.
Thanks for your cooperation.
Perkus
Oct 20, 2010, 02:47 PM
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.
SamBC
Oct 20, 2010, 03:09 PM
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.
JeBuS27
Oct 20, 2010, 03:16 PM
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.
Perkus
Oct 20, 2010, 03:59 PM
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.
CommanderZ
Oct 21, 2010, 03:45 AM
I will try to look into this. I can't promise anything though.
Disabling: Did you try to delete the NPLLanguageService forlder from <ModBuddy>/Extensions/Application?
alpaca
Nov 28, 2010, 07:58 AM
Bump.
Are you still around CommanderZ?
CommanderZ
Nov 28, 2010, 04:03 PM
I'm around, but currently mostly in the role of observer. Job + university + upcoming mod for another game (Doom :crazyeye:) is keeping me busy. I expect to finish the mod in cca. two weeks, I will try to look into the issues with this extension then.
The elusiveness of the bugs (the extension itself is closed source, so there are very few options for me to fix it) + slight lack of motivation (I'm waiting for the C++ SDK to be released before I can fully dive into Civ V modding, filling the time in between was the reason why I started doing ModBuddy extensions after all) are not making it easy though.
I switched the Outlook task I have created for this issue to high priority, so I will try to do what I can ASAP :)
Thanks for patience :goodjob: