portraits.2da defines the game-selectable portraits in the toolset (for creatures, placeables) and for players at character generation. Portraits can be changed (by resref or ID number) later using script commands.

Portrait Files

Portraits are made up of several different files all with the same prefix - po_ - but with different end letters. Generally TGA files are used for these to retain quality but DDS tends to work better because of the way save games generate thumbnails if you are using scaled up resolutions (apparently TGA files being too big corrupts the save games generating the little thumbnails for the load menu, while DDS does not). Additionally DDS loads faster and is lower on disk space usage.

If you use DDS you should also use a blank portraits.txi file since this is loaded for any GUI element showing a portrait, and higher quality DDS files won't mipmap properly.

You can convert files in the engine itself using the command ConvertPortrait filename (if present in the "portraits" folder) but to be honest, you will find it easier to edit files in something like Paint.NET or GIMP to get the required sizes since you can easily crop to retain detail in the smaller sizes.

New Portraits in EE

As of 1.87.8193.35 you can now just have a single portrait and it can be DDS so the best of both worlds. The easiest one to use is just to have the largest possible size as _m and let the game resize it as needed (noting the TXI fix above if you sort the rest of the portraits into DDS).

Note

The creature examine window will not automatically fall back from the _h portrait until the .37 release. This is fixed in .37-5.

If you want portraits to show up in the toolset for creatures, you'll need a TGA version at _m size from the table below. If you're looking for a single file solution that works for both the toolset and in game, then a TGA in _m size is the only solution as this will also resize up to _l for character sheets.

For placeables just _m is fine.

Note for existing game portraits all of the files still need replacing.

Portrait Files and Default Sizes

Portrait SizeLetterMinimum ResolutionEE RecommendationUsage
Hugeh256x512 canvas; upper 256x400 usedn/a - just use the _m size for new portraitsCharacter Creation (not needed for placeables)
Largel128x256 canvas; upper 128x200 usedn/a - just use the _m size for new portraitsCharacter Sheet (not needed for placeables)
Mediumm64x128 canvas; upper 64x100 used

1024 x 2048 - recommended to fit the UI max scaling of x4, game uses it for other slots automatically

Conversations, examine panel
Smalls32x64 canvas; upper 32x50 usedn/a - just use the _m size for new portraitsParty bar, radial menus
Tinyt16x32 canvas, upper 16x25 usedn/a - just use the _m size for new portraitsMouse over name windows, chat window

Custom Portraits

Custom portraits in the "Documents\Neverwinter Nights\portraits" folder are selectable unless the ruleset.2da toggle is altered; CHARGEN_ALLOW_CUSTOM_PORTRAITS.

If off only portraits in portraits.2da can be chosen. It defaults to on (1) and is a client side setting.

If the players want custom ones no one else can select, the portraits.2da file can be altered to allow a certain portrait only for NPCs (the Plot column), then it is set in game using script commands.

Or include it as a portrait file appropriately named, and use SetPortraitResRef to set the text version.

2da Information

The number of rows in this 2da are limited to 65,536 due to the game storing it as a 2 byte integer reference. Beamdog has reserved adding new content at line 15,000 so plenty of room for user additions past the usual ones included in the base game.

Note that none of the categorisations below stops the portrait being selected in the toolset, and certainly has no restrictions in the game using SetPortraitId. It is purely the clientside restrictions of picking a portrait at character generation.

Column NameExampleNotes
BaseResRefdw_f_01_The filename without the "po_" prefix or the corresponding "size" value (h, l, m, s, t) noted above after it. Example file would be po_dw_f_01_h.tga for the "Huge" one.
Sex1

Index into gender.2da, the suggested gender of the portrait. For quick reference these numbers are:

0 - Male

1 - Female

2 - Both

3 - Other

4 - None

PC chargen can only see those for their selected gender, ie 0 or 1, so anything which isn't 0 or 1 will be toolset only. The PC cannot ever see other opposite gender so if there are shared portraits add two entries with just the gender being different.

Race3Index into racialtypes.2da, the suggested race attached to the portrait
InanimateType7Index into placeabletypes.2da, the suggested category of placeable this portrait is related to.
Plot0If 0 it is allowed for players to pick this, if 1 the portrait is considered "plot" and not pickable by players (eg; Aribeths portrait in the OC)
LowGorePLC_M06_If a resref is supplied and "low violence" mode is enabled this is show instead of the original. Same formatting as BaseResRef.
  • No labels