...
The 2da format is relatively simple, and can be read about in the Bioware documentation. It looks like this:
| Code Block |
|---|
2DA V2.0
Column1 Column2 Column3
0 Entry1 "Entry2" **** |
- The top line must be 2DA V2.0
- You can optionally include a "DEFAULT:" definition for the string that will be put in place of the blank fields (ie those with ****). No Bioware 2da does this (and likely shouldn't) but may be useful for custom 2da files.
- There may be one or more blank lines before the first line that contains characters, which is considered the header line
- The first column header must be blank, and that column is ignored (is usually a human readable number)
- The first column number IDs can be wrong - the game just reads each new line as a new entry (incremented from 0)
- The second and onwards columns must have the header match the in-game reference loaded, the order of columns doesn't matter. Label columns are generally ignored.
- The first column header must be blank, and that column is ignored (is usually a human readable number)
- Further lines are data rows:
- Column data - but not the header name - can be in double quotes - "text here" - to include spaces. The maximum amount of text in quotes can be 256 characters. Whether or not the game understands that one being in quotes very much depends
- see individual 2da notes.
- Column data is separated by one or more whitespace characters (tabs, spaces)
- Blank data is classified with 4 stars: ****
- You can quote the stars ("****") or have a blank quoted field which, of course, is blank ("") but any other combination of stars (less, more, or in single quotes) will be returns literally.
- Column data - but not the header name - can be in double quotes - "text here" - to include spaces. The maximum amount of text in quotes can be 256 characters. Whether or not the game understands that one being in quotes very much depends
...
There is different behaviour for certain columns where the column is missing entirely (eg; using a old 1.69 version of a 2da) versus the column being present but blanked (****). A notable example is the additional columns in racialtypes.2da which defaults to the 1.69 implementations if the columns are not present to maintain comatibilitycompatibility, and where **** can actually be counted as "Empty value" instead of "Missing value" meaning different behaviour.
...
- swearfilter.2da cannot be rearranged
- The first column of the spell preference 2da files
- itemprops.2da appears to be hardcoded due to the PropColumn in baseitems.2da (although not sure if you can add more columns to it).
It is recommended not to reorder columns on any game 2DA just in case.
Adding Columns
Most game read 2da files (if not all) can have custom columns added but these are only useful for Get2DAString (and it's a much better idea to create a custom 2DA file for additional metadata to not hit NWSync 15MB file size limits).
In one instance in NWN:EE this has a valid use case the engine recognises: Additional "Spellbook" columns in spells.2da, which are now referenced by column name in classes.2da.
...