Okay, we have many of our tilesets set up through our -System npc, with the script below. The problem is that every now and then, the levels use an incorrect tileset, and I'm not sure why. My only hunch is that it has something to do with being in levels that use addtiledef and then warping to another level. But as I said, that's just a hunch.
Most recently, it happened when I was in a level named versus_winemaking1.nw and it was using addtiledef to set the tileset in the level to blasphemy_pics2.png
I then warped to an overworld level, and the tileset was set as blasphemy_pics2.png instead of the blasphemy_pics1.png that the NPC tells it to. However, that might not be the problem at all, because I think I've encountered the same problem without warping.
NPC Code:
function onCreated() {
this.keydown[6] = 0;
removeTileDefs();
addtiledef("blasphemy_pics1.png", "illuminati", 0);
addtiledef("blasphemy_pics1.png", "versus", 0);
addtiledef("blasphemy_pics2.png", "complex", 0);
addtiledef("blasphemy_cave-pics2.png", "vermines", 0);
addtiledef("blasphemy_pics1-volcano.png", "volcano_", 0);
addtiledef("blasphemy_cave-pics1.png", "cave1_", 0);
addtiledef("blasphemy_cafe-pics2.png", "cave2_", 0);
addtiledef("blasphemy_cafe-pics3.png", "cave3_", 0);
addtiledef("blasphemy_cafe-pics4.png", "cave4_", 0);
addtiledef("blasphemy_heartquest1-pics1.png", "heartquest1_", 0);
onTimeout();
}