Lua editing

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
Anyone know of a decent way to edit lua files within ModBuddy? Right click -> open with -> notepad++ doesn't work, and the Better Lua Editor extension has those keyboard issues. I've been doing most serious coding by manually opening the files in notepad++ but it's somewhat inconvenient. :undecide:
 
Anyone know of a decent way to edit lua files within ModBuddy? Right click -> open with -> notepad++ doesn't work, and the Better Lua Editor extension has those keyboard issues. I've been doing most serious coding by manually opening the files in notepad++ but it's somewhat inconvenient. :undecide:

I just double-click the lua file and edit it in the IDE. Looks like this:
Spoiler :
9Vi4a.gif


Yours doesn't do that?
 
That doesn't work for large files. For example AssignStartingPlots is over 10k loc, and it has a ~5 second latency for each character typed. A better lua editor is necessary due to these deficiencies in the standard modbuddy one, so I usually use notepad++, but it's somewhat inconvenient for searches across the project or asset files since I have to alt-tab to modbuddy.
 
That doesn't work for large files. For example AssignStartingPlots is over 10k loc, and it has a ~5 second latency for each character typed. A better lua editor is necessary due to these deficiencies in the standard modbuddy one, so I usually use notepad++, but it's somewhat inconvenient for searches across the project or asset files since I have to alt-tab to modbuddy.

Yeah, I see what you mean. :(

This is clearly a bug in the way they coded up their Visual Studio extension. If you load up AssignStartingPlots.lua in a C# project for example, it doesn't have that problem. Or if you change the file extension from lua to something else it doesn't have that problem in ModBuddy. It's like their syntax highlighting script is in the gui thread and just put the whole file into a string and every character modification results in a new string allocation with half the characters being shifted over by one, or something stupid like that.

Anyway, I tried a bunch of stuff to make it faster or turn off whatever is making it slower, but not much luck. Two workarounds I found work semi-OK, but they both still suck.

1) Change the file extension of problematic lua files to sql (if already open, close and reopen), and the slowness goes away (sql because you retain your "--" comment highlighting; You lose the rest of the highlighting). You'll have to switch back to .lua when you build the project.

2) Like you are already doing, use a different text editor. You can set VS to automatically open lua files in Notepad++, but after that, you are alt-tabbing again anyway...

So... not much help really, sorry.

I would definitely report this as a bug to Firaxis. It's beyond dumb.
 
2) Like you are already doing, use a different text editor. You can set VS to automatically open lua files in Notepad++, but after that, you are alt-tabbing again anyway...

Problem is even this doesn't work for me. If I right click the file and instruct it to open with notepad++, nothing happens. :undecide:

I just open stuff manually in notepad++.
 
I use WinMerge for editing AssignStartingPlots, and ModBuddy's internal editor for everything else.

WinMerge doesn't have the latency issue, and it's obviously useful to be able to do a side-by-side comparison between my version and the vanilla one, so I'm not even motivated to go back if/when they DO fix it.
 
Uhm, not sure what you mean, but how I added Notepad++ (had to do it again for every file format, so once for XML, LUA and SQL):
- right click a file with the relevant extension
- "open with..."
- then on the right-hand side click the "Add" button and browse to Notepad++'s location
 
What I'm saying is it's already there, clicking OK does nothing, and I can't edit or remove it. Adding a duplicate with the correct path worked though. I never considered that until now! I do wonder if there's some way to fix the one I can't remove. Ideally I'd rather fix the bugged one... annoying to have a problem like this staring me in the face... but at least this is a decent workaround. :)

notepadr.jpg
 
Back
Top Bottom