This article was initially published on the BioWare forums and later added to the NWN Lexicon.
If you played chapter 3 of the official campaign, you probably asked yourself several times “how did they do this, they can't be changing the tilesets on the fly?!”
Without a spoiler, here is a short introduction to Tile Magic™:
The file you want to look at is “x2_inc_toollib.nss”. Two of the functions in this file are dealing with changing tiles in a tileset (or better creating the illusion to do that).
To give you a short idea of what you can do with it, try this example:
#include "x2_inc_toollib"
void main()
{
int nX = 8;
int nY = 8;
TLChangeAreaGroundTiles(GetArea(OBJECT_SELF),X2_TL_GROUNDTILE_WATER,nX,nY,-0.92f);
}
#include "x2_inc_toollib"
void main()
{
int nX = 4;
int nY = 4;
TLChangeAreaGroundTiles(GetArea(OBJECT_SELF),X2_TL_GROUNDTILE_LAVA,nX,nY,0.3f);
}
Of course this is just one of the many things you can do using the technique we used. You've probably seen many other applications in the Hordes of the Underdark official campaign, especially Chapter 2 and 3.