Modding, Mission Design, and Coding > FS2 Open Tools

Notepad++ TBL/TBM Syntax

(1/5) > >>

mjn.mixael:
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










Install
Open Notepad++, go to the Language dropdown -> Define Your Langauge... then import the file.

DOWNLOAD LINK

Echelon9:
Very nice, thanks for contributing.

Goober5000:
Hey, this is pretty nifty.

niffiwan:
 :yes:

I wonder how hard this would be to adapt to vim  :D

mjn.mixael:

--- Quote from: niffiwan on June 24, 2013, 06:43:39 pm --- :yes:

I wonder how hard this would be to adapt to vim  :D

--- End quote ---

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?

Navigation

[0] Message Index

[#] Next page

Go to full version