Jump to content

BG1 Platform-Abstraction Layer


Recommended Posts

This is something I (basically) wrote a long time ago, as part of Item Randomiser. I then cleaned it up and put it in library form, so I could use it in my other projects and now I'm dramatically unveiling it in the event it could be useful to someone else.


The BG1 Platform-Abstraction Layer (BG1PAL) is a resource-name abstraction library for the different versions of Baldur's Gate. In short, it works by taking a canonical set of resource names and converting them at install-time into platform-specific form. The canonical set is taken to be that of BG1, but BG: EE is almost a drop-in replacement [1]. Consequently, you do not need to keep track of which files are called what on the different BG1 platforms, nor all the exceptions and special cases.


Example usage:

LAF fl#bg1pal STR_VAR file = ar0125.are RET file END // Tutu: fw0125.are; BGT: ar7225.are; BG:EE: no conversion

LPF fl#bg1pal STR_VAR resource = slng03 type = itm RET resource END // Tutu: _slng03; BGT: slng05; BG: EE: no conversion



1. BG: EE differs in having WBM instead of MVE for movies. BG1PAL covers this, provided you give the type/file extension as MVE.

Link to comment

Thanks for the link and my curiosity I've found out about the weidu M editing mode for Emacs. Thank you for that one! On the other hand I prefer my ugly concatenated strings hack for area portability (with a substring function call to cut it for BGT and everything!).

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...