WeiDU Highlighters

Note: This package has not been updated in several years. For more recent highlighters, we recommend checking out Argent77's excellent WeiDU highlighters for Notepad++ at Spellhold Studios.

This package contains highlighters for three text editors: ConTEXT Programmers Editor, Crimson Editor, and TextPad. Highlighters assist modders by highlighting commands and improving the legibility of code. The highlighter cover code for tp2s (including libraries such as .tpa and .tph) as well as scripts (.baf) and dialogue (.d).

Based on IESDP updates and DLTCEP-created reference files, with Idobek's tp2 highlighter serving as inspiration/baseline.

Installing and Using the Highlighters with the ConTEXT Programmers Editor

Install the ConTEXT Programmers Editor, available from the ConTEXT home page at www.context.cx. By default, it will install to C:\Program Files\ConTEXT\.

After installing ConTEXT, browse to its installation directory, and then into the Highlighters directory.

Copy the following files from the ConTEXT folder in this package into the ConTEXT Highlighters folder. If you the highlighters previously installed, you will be prompted to overwrite the files; choose yes.

  • WeiDU_BAF.chl
  • WeiDU_BAFstring.chl
  • WeiDU_TP2.chl
  • WeiDU_TP2string.chl
  • WeiDU_DTRA.chl
  • WeiDU_DTRAstring.chl

Copy the files from this package in the context folder into the Highlighters directory.

C:\Program Files\ConTEXT\Highlighters\

  • C:\Program Files\Crimson Editor\link\extension.tp2
  • C:\Program Files\Crimson Editor\link\extension.tp2
  • C:\Program Files\Crimson Editor\link\extension.baf
  • C:\Program Files\Crimson Editor\link\extension.tph
  • C:\Program Files\Crimson Editor\link\extension.d

Open ConTEXT, and open your file to be edited. By default, the "no strings" version has all of the associations (.d, .tra, .tp2, .baf) and should immediately read your file.

To view the file with strings enabled, have the file you want to view open. Go to the top bar and under TOOLS, follow SET HIGHLIGHTER to toggle other highlighters.

Each of the WeiDU highlighters comes in pairs with strings, no strings as options. Under these instructions, the default loading behavior of these files should be the "no strings" versions, to see what is happening within strings. To see if strings are working correctly/terminated properly, just switch highlighter to the "string" version.

Performance Notes

ConTEXT is a free editor, and does not integrate into Windows. This means that loading multiple large files using the DTRA highlighters may cause ConTEXT to load slowly or hang. Crimson Editor integrates with Windows, bypassing this problem, but has no simple way of doing a line-by-line file compare.

Installing and Using the Highlighters with Crimson Editor

Install the Crimson Editor. Available from www.crimsoneditor.com or, alternatively, from its Wikipedia page. Follow the instructions given at the download site. By default, it will install to C:\Program Files\Crimson Editor\.

After installing Crimson Editor, browse to its installation directory.

Copy the files from this package in crimson/link into the matching subdirectory in the Crimson program folder so that you have

  • C:\Program Files\Crimson Editor\link\extension.tp2
  • C:\Program Files\Crimson Editor\link\extension.tp2
  • C:\Program Files\Crimson Editor\link\extension.baf
  • C:\Program Files\Crimson Editor\link\extension.tph
  • C:\Program Files\Crimson Editor\link\extension.d

NOTE: There is already a programming language using the extension ".D" - replace this older file with the one in this package.

Copy the file in the folder crimson/schemes into the matching subdirectory in the Crimson program folder so that you have

  • C:\Program Files\Crimson Editor\schemes\WeiDU.clr

Copy the files from this package in crimson/spec into the matching subdirectory in the Crimson program folder so that you have

  • C:\Program Files\Crimson Editor\spec\WeiDU_TP2.key
  • C:\Program Files\Crimson Editor\spec\WeiDU_TP2.spc
  • C:\Program Files\Crimson Editor\spec\WeiDU_TP2string.spc

Next, set up the highlighters. Open up Crimson Editor and Browse to TOOLS > PREFERENCES; under CATEGORIES, choose COLORS. Under "Load Color Scheme", choose "Saved Color Schemes", and hit "Load". Click on WeiDU.clr, and hit "Open", then hit "Apply".

This is as far as you need to go, unless you want to be able to toggle string behavior, or view the TP2 contents with a D or TRA highglighter to catch errors. To completely identify the installed materials, open Crimson Editor, and find TOOLS, center top bar. Select TOOLS, PREFERENCES, FILE, FILTERS. In the box at the right side, scroll down and select an empty entry and define WeiDU_BAF (*.baf in second box, baf in third box), and hit APPLY. Repeat this process for WeiDU_DTRA (*.d;*.tra in second box, blank in third box) and WeiDU_TP2 (*.tp2;*.tph in second box, blank in third box).

Move to TOOLS, PREFERENCES, FILE, SYNTAX TYPE. In the box at the right side, scroll down and select an empty entry and define:

  • Decription WeiDU_BAF
  • Lang Spec WEIDU_BAF.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_BAF.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY

Repeat this process with:

  • Decription WeiDU_BAFstring
  • Lang Spec WEIDU_BAFstring.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_BAF.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY
  • Decription WeiDU_DTRA
  • Lang Spec WEIDU_DTRA.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_DTRA.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY
  • Decription WeiDU_DTRAstring
  • Lang Spec WEIDU_DTRAstring.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_DTRA.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY
  • Decription WeiDU_TP2
  • Lang Spec WEIDU_TP2.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_TP2.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY
  • Decription WeiDU_TP2string
  • Lang Spec WEIDU_TP2string.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_TP2.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY
  • Decription WeiDU_TPH
  • Lang Spec WEIDU_TP2.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_TP2.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY
  • Decription WeiDU_TPHstring
  • Lang Spec WEIDU_TP2string.SPC (this can be browsed for by hitting the button marked "...")
  • Keywords WEIDU_TP2.KEY (this can be browsed for by hitting the button marked "...") and hit APPLY

Usage

To use the highlighters, load the file you want to edit. Under DOCUMENT, SYNTAX TYPE will be the available highlighters. Under these instructions, the default loading behavior of these files should be the "no strings" versions, to see what is happening within strings. To see if strings are working correctly/terminated properly, just switch highlighter to the "string" version.

The highlighters are case sensitive, so if something doesn't highlight check the associated .key file and see what the usage is. You can change it right there, too - be careful, though, as some keywords used in WeiDU are case sensitive and others are not.

Default behavior is to load .D, .TRA, .BAF, .tp2, and .tph files with the appropriate highlighters. If you use the Project functions, you can instantly load your entire mod and all related files from wherever they are on your harddrive or network with the appropriate highlighting automatically applied. That, combined with robust Find functions, allows you the best opportunity to take advantage of highlighting.

Performance Notes

Crimson Editor integrates with Windows, meaning you can load massive numbers of files using multiple highlighters with no problem. It is less "beginner friendly" than ConTEXT, and has no simple way of doing a line-by-line file compare, but has support for 9 categorizations, personalized toggles colors, easier viweing of multiline strings, and a number of other much more powerful editing/searching/organizing tools.

Hope this helps you folks mod away with easier syntax checking and visualization. Cheers!