1. Texturing
There doesn't appear to be an easy way to remove a texture once it's been applied. Perhaps this is covered in some tutorials online (and if I find them, I'll definitely update with a link to them), but from all appearances, once you've applied a texture to a section of the map, it's there.
2. Height-Mapping
Ugh, the tools for raising and lowering the landscape are TOUCHY!! I basically settled on creating my town as a small, flat area, surrounded on all sides by large rocks (aka placeables). I did do some decent height mapping at the entrance to town, but that's just an experiment to imitate the feeling of walking down into a valley where the town is located.
3. Placeables v. Environment Objects
I played around with some different settings, and at one point accidentally made all my placeables into environment objects. This wasn't really much of a problem (if you dont' mind being able to walk through a building like a ghost), but when I switched them back, all of the doors and related objects to the building placeables were lost, and none of the doors that I tried to attach would "snap" to the doorway. Needless to say, I had to delete all my buildings and start over from scratch.
Along with the basic town layout (which as of this writing only has one NPC, who's a guard standing at the town entrance), I created the interior of an inn. And there encountered the deadly combination that is created by too many placeables and a baked walkmesh. I tried to put a variety of sizes of tables with bottles on them (playing with the X, Y, and Z size attributes of each bottle and table), and wound up somehow overpopulating some tiles -- or at least that's what it seems. If I add a chair to any portion of one tile, baking it destroys the walkmesh for that entire tile. Delete that chair, and it works just fine. So there's one table that looks REALLY weird, with only three chairs at it.
The other fun thing I experimented with was using the walkmesh cutter around some placeables that I'd converted to environment objects. Specifically for the bar and fireplace, there didn't seem to be any good reason to eat up CPU cycles with placeables that didn't really need to be such. Plus, things that are square are really easy to use the walkmesh cutter around.
For today's scripting item, I wanted to make the lamps in the exterior portion of the town turn on or off depending on the time of day. Unfortunately, the on/off state of lights is not a scriptable option (according to all of the forum postings that I could find), so I had to set it up such that the lights could be created/destroyed depending on the time of day. First I created the lampposts, as usual, then created waypoints on the map, at the same height that I wanted the lights to be. Then, I created a blueprint for the light effect that I was looking for. Next, I created the following script, and call it in the OnHeartbeat event for the area:
void main () {
// This script creates the appropriate lights for the lamps in the Marketh town.
int iHour = GetTimeHour();
if (iHour <= 6 || iHour >= 18)
{
if (GetLocalInt(OBJECT_SELF,"iLightsOn") == 0) {
if (GetObjectByTag("mod_lt_lamp1") == OBJECT_INVALID) {
object oLightWP1 = GetObjectByTag("mod_001_wp_light1");
location lLocation1 = GetLocation(oLightWP1);
CreateObject(OBJECT_TYPE_LIGHT,"mod_lt_lamplight",lLocation1,FALSE,"mod_lt_lamp1");
}
if (GetObjectByTag("mod_lt_lamp2") == OBJECT_INVALID) {
object oLightWP2 = GetObjectByTag("mod_001_wp_light2");
location lLocation2 = GetLocation(oLightWP2);
CreateObject(OBJECT_TYPE_LIGHT,"mod_lt_lamplight",lLocation2,FALSE,"mod_lt_lamp2");
}
SetLocalInt(OBJECT_SELF,"iLightsOn",1);
}
}
else
{
if (GetLocalInt(OBJECT_SELF,"iLightsOn") == 1) {
if (GetObjectByTag("mod_lt_lamp1") != OBJECT_INVALID) {
object oLight1 = GetObjectByTag("mod_lt_lamp1");
DestroyObject(oLight1);
}
if (GetObjectByTag("mod_lt_lamp2") != OBJECT_INVALID) {
object oLight2 = GetObjectByTag("mod_lt_lamp2");
DestroyObject(oLight2);
}
SetLocalInt(OBJECT_SELF,"iLightsOn",0);
}
}
}