Asset creation notes - gemrb/gemrb Wiki
Adding new strings (text) to the game
Strings are in dialog.tlk, indexed by their reference number (strref, string ref).
It's easiest to do it with NearInfinity or WeiDU (instructions). If you want to do it via NearInfinity:
- Open the demo as a bg2 game
- Main menu: Edit -> String Table
- Input desired text and don't forget to set at least the flag bit "Has text"
- Save and note the strref
Quick dump of all strings
weidu --game demo/ --traify-tlk
This plaintext format can also be converted back to a TLK, see
New animation limitations
Until #1099 is implemented, all frames in any animation share the same 256 colour palette and support a single transparency. If you try to import a rich non-indexed image in NearInfinity to convert it to a BAM, make sure to check the preview, since it will make any palette problems completely obvious.
If you want to use it to explore or modify data, you can open files one by one while having any other game open.
If you want the full experience install Near Infinity v2.2-20210501 or later.
DLTCEP has the most comprehensive capabilities. You can open files one by one to work on them, however, if you want to add polygons or use any previews, you'll have to copy the area file and its TIS file to the host game data folder. You can't add travel regions, traps, infopoints or work on the searchmap otherwise.
Easiest to write in the plaintext D format that all mods use and then converted to DLG via weidu, eg.:
weidu --game demo/ riddler.d mv -v riddler.dlg demo/data
New colors for clown-colored actors
Add new entries to pal16.bmp and use their row index in the creature's CRE file. For pcs, one can do it through python via
GemRB.SetPlayerStat and stats like
The gradients are used together with the area lightmap, so when you're in a shade, a darker color is displayed. Therefore they should be simple, two-color based, with varying luminosity.
Specific image notes
Inventory items. While PNG is supported for them, if you want a larger icon while dragging the item around the inventory, make a BAM. The first frame should be the normal icon, the second frame the bigger dragging one. To make the interaction more natural, make sure to set the center coordinates of the second frame to the image center. That way the image won't jump when you start dragging.
When an actor drops an item to the ground (deliberately or by dying), a loot pile container is created on the map. In the ITM, you can specify what image to use for it. Use a BAM image! The engine uses the shadow color (second color in the palette) to distinguish drawing the pile normally and while hovering over it with the mouse (typically with an outline). So draw the image, add an outline, make sure the image looks good without it, generate the BAM and make sure the outline color is at the shadow color index.
Adding entries to chitin.key
Usually not needed, but helps with area editing in NI to have the ARE/WED/TIS inside. The process is not scripted, I don't know of any tools, so the first time it was done manually with a hex editor. See https://gibberlings3.github.io/iesdp/file_formats/ie_formats/key_v1.htm#keyv1_ResIndices and gemrb/includes/SClassID.h for the resource types.
To fix this it's probably easiest to extend iesh, since it can already read and write KEY files. It just needs a method or two to add new entries: https://github.com/gemrb/iesh/blob/master/infinity/formats/key.py
GemRB demo specific notes
Add any optional big files to the gemrb-assets repo instead, then to
cmake/fetch-demo-data.cmake. They will get
installed into release builds, while if you want to enjoy them locally, build the fetch-demo-data target (eg.
Reduce the sizes of imported pngs significantly with https://tinypng.com/!