Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: mjn.mixael on June 23, 2013, 11:42:23 pm
-
I know many have probably whipped up their own little version. But what they heck. Here's mine. The goal was to make it as dynamic as possible so that it will rarely, if ever need to be updated with new keywords and the like.
Features
- All $Name or +Name entries are set to bold blue to differentiate entry sections
- Table entries are colored based on '$', '+', or '@Laser'. That last one is for those six weapons.tbl entries, but should ignore any entries like @Subach
- Recognizes XSTR("",##) entries differently than any ( "flag" ) entries
- #TABLE HEADERS and #CLOSERS are recognized while, in general, $Name: Disruptor#DEFUNCT will not be altered
- 'YES' and 'TRUE' are highlighted in green while 'NO' and 'FALSE' are highlighted in red
- Scripting tables are essentially ignored by coloring all LUA a single color, use the LUA language for those tables instead
- Works great for Mission (.fs2) and Campaign (.fc2) files as well
I chose colors that I thought were readable. I tried to see about implementing folding of entries.. but since entries across the board can end in so many different ways, I couldn't come up with something reliable inside Notepad++'s limitations.
It won't help you write tables, per say.. but it will help you find table mistakes because the line colors will run over and start looking funky if things are out of place. It's a decent replacement if you don't want to deal with a dedicated TABLE editor.
Also, parsing the original sounds.tbl format sucks, but oh well.. can't be perfect! :)
Pics
(http://i282.photobucket.com/albums/kk264/mjnmixael/Private/FSOLang04_zps751f442a.jpg)
(http://i282.photobucket.com/albums/kk264/mjnmixael/Private/FSOLang03_zps3e7fe69a.jpg)
(http://i282.photobucket.com/albums/kk264/mjnmixael/Private/FSOLang05_zps40661319.jpg)
(http://i282.photobucket.com/albums/kk264/mjnmixael/Private/FSOLang02_zpsbff08aef.jpg)
(http://i282.photobucket.com/albums/kk264/mjnmixael/Private/FSOLang01_zps8bf82670.jpg)
Install
Open Notepad++, go to the Language dropdown -> Define Your Langauge... then import the file.
DOWNLOAD LINK (http://www.mediafire.com/?h90765000d6mcao)
-
Very nice, thanks for contributing.
-
Hey, this is pretty nifty.
-
:yes:
I wonder how hard this would be to adapt to vim :D
-
:yes:
I wonder how hard this would be to adapt to vim :D
Not sure. I looked at the VIM website and documentation... and didn't find anything immediately helpful about how VIM even supports custom languages. My version for Notepad++ makes heavy use of Notepad++'s UDL 2.0 (User Defined Language) system. Based on what I've seen, it wouldn't have even been possible on UDL 1.0... so who knows?
-
Sticky?
-
Install
Open Notepad++, go to the Language dropdown -> Define Your Langauge... then import the file.
Failed to import. :snipe:
What version of Notepad++ did you make this under?
-
6.3.3
-
That's the version I'm using too. :sigh: It doesn't provide any additional details, it just says "Fail [sic] to import".
-
Odd.. Gimme an hour to get the kids fed and then I can figure it out.
EDIT: I've no idea... I imported the file fine every time... :(
-
I tried a number of things (including running as administrator) and nothing worked. Oh well. Hopefully other people are able to load it.
-
Well... if you don't have any of your own User Defined Languages in Notepad++.. put this in Appdata\Roaming\Notepad++ or whatever is the Ancient Windows equivalent.
[attachment deleted by ninja]
-
I had no trouble here either.
-
That looks much better than mine. Thank you very much mister :)
-
Well... if you don't have any of your own User Defined Languages in Notepad++.. put this in Appdata\Roaming\Notepad++ or whatever is the Ancient Windows equivalent.
That worked. Yay!
-
Just wanted to give this a quick bump to make sure new people might see it because things tend to get lost to PCS2 on this board. I've found this to be one of the most useful modding tools in my arsenal. Can't believe I edited tables in plain text for so long...
-
Indeed. It might even be worth stickying.
-
I was thinking about that last night but i can see an issue with the number of stickies we could potentially end up with if we do it for every useful tool.
Stickying a link to a wiki page for listing "small" tools might work though
-
Or just make a parent topic sticky and link to all these tools there. Either way. I'd prefer these tools get their own wiki pages though.
-
yer, I was thinking wiki for ease of maintenance so we dont need a mod who is bothered to add/change/remove a year down the line
-
Yes I'm necroing this thread. Fight me.
So Mixael's syntax highlighting is incredibly useful, but it doesn't play nicely with Notepad++'s dark mode (which may not even have existed when this thread was made).
So here's a version of the FSO table syntax that's been adjusted for dark mode. (https://drive.google.com/file/d/1P2c7V45-svfNqE9vxqBG6d4ibuM6IMcm/view?usp=sharing) It should actually also work pretty well with light mode.