1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

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

Discussion in 'Civ5 - Utility Programs' started by CommanderZ, Oct 12, 2010.

  1. CommanderZ

    CommanderZ Chieftain

    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

     

    Attached Files:

  2. JeBuS27

    JeBuS27 Heretic

    Joined:
    Sep 21, 2005
    Messages:
    321
    Awesome. I hoped it was that simple, but not knowing much about extensions, really wasn't sure.
     
  3. jwallstone

    jwallstone Chieftain

    Joined:
    Oct 4, 2010
    Messages:
    59
    Cool. Will try.
     
  4. JeBuS27

    JeBuS27 Heretic

    Joined:
    Sep 21, 2005
    Messages:
    321
    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 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?
     
  5. CommanderZ

    CommanderZ Chieftain

    Joined:
    Nov 24, 2007
    Messages:
    182
    Location:
    Prague, Czech. Rep.
    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?
     
  6. JeBuS27

    JeBuS27 Heretic

    Joined:
    Sep 21, 2005
    Messages:
    321
    Yeah, I have VS 2010 Ultimate installed currently. But, as my edit said, it works now that I've installed VAB.
     
  7. CommanderZ

    CommanderZ Chieftain

    Joined:
    Nov 24, 2007
    Messages:
    182
    Location:
    Prague, Czech. Rep.
    It shouldn't. I will investigate this later.
     
  8. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    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.
     
  9. Perkus

    Perkus Chieftain

    Joined:
    Oct 16, 2010
    Messages:
    316
    Location:
    Ontario, Canada
    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.
     
  10. CommanderZ

    CommanderZ Chieftain

    Joined:
    Nov 24, 2007
    Messages:
    182
    Location:
    Prague, Czech. Rep.
    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.
     

    Attached Files:

    • npl.rar
      File size:
      370 bytes
      Views:
      41
  11. Perkus

    Perkus Chieftain

    Joined:
    Oct 16, 2010
    Messages:
    316
    Location:
    Ontario, Canada
    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...
     
  12. CommanderZ

    CommanderZ Chieftain

    Joined:
    Nov 24, 2007
    Messages:
    182
    Location:
    Prague, Czech. Rep.
    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).
     

    Attached Files:

  13. Perkus

    Perkus Chieftain

    Joined:
    Oct 16, 2010
    Messages:
    316
    Location:
    Ontario, Canada
    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,
    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.
     
  14. CommanderZ

    CommanderZ Chieftain

    Joined:
    Nov 24, 2007
    Messages:
    182
    Location:
    Prague, Czech. Rep.
    Ok, I have updated all the instructions.

    Thanks for your cooperation.
     
  15. Perkus

    Perkus Chieftain

    Joined:
    Oct 16, 2010
    Messages:
    316
    Location:
    Ontario, Canada
    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.
     
  16. SamBC

    SamBC Chieftain

    Joined:
    Feb 2, 2010
    Messages:
    1,052
    Location:
    Lancaster
    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.
     
  17. JeBuS27

    JeBuS27 Heretic

    Joined:
    Sep 21, 2005
    Messages:
    321
    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.
     
  18. Perkus

    Perkus Chieftain

    Joined:
    Oct 16, 2010
    Messages:
    316
    Location:
    Ontario, Canada
    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.
     
  19. CommanderZ

    CommanderZ Chieftain

    Joined:
    Nov 24, 2007
    Messages:
    182
    Location:
    Prague, Czech. Rep.
    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?
     
  20. alpaca

    alpaca King of Ungulates

    Joined:
    Aug 3, 2006
    Messages:
    2,322
    Bump.

    Are you still around CommanderZ?
     

Share This Page