Lighting is bugged in NWN, and has been since day one. It appears that it can't be fixed. The bug is that, even turning of a placeable's illumination will still cause a glow around it when the PC is nearby.
Someone have fixed it?
Lighting is bugged in NWN, and has been since day one. It appears that it can't be fixed. The bug is that, even turning of a placeable's illumination will still cause a glow around it when the PC is nearby.
Someone have fixed it?
You seem to be assuming that placeables are dynamic light sources. They are not. Their light gets burned into the tiles and this information is distributed to all the clients.
If you change the lighting state of a placeable you need to RecomputeStaticLighting after the light change of light state on teh placeable is completed. Given the delay of animations and such I usually delay my call of RecomputeStaticLighting by up to 3 seconds. Its fiddly to get the delay just right, and so you'll need to experiment.
And with that comment, I am back to work on another 16 hour day - only 10 hours to go. Woot! Thankfully I don't have to work for the man this weekend.
henesua,
I do use RecomputeStaticLighting. What botherded me most about the ZEP lighting was that each lamppost had it's own HB script.
My current build contains a city. Lots of lights. To avoid so many HBs, I use one placeable HB to controll all the lighting in an area.
This is the HB script on a barrel in one area.
void main()
{
object oPC = GetFirstPC();
object oArea = GetObjectByTag("AirimoreDocksNorth");
object oBarrel = OBJECT_SELF;
object oObject = GetFirstObjectInArea();
// if(GetArea(oPC) == oArea)
// {
if(GetIsDawn())
{
while(GetIsObjectValid(oObject))
{
if(GetTag(oObject) == "LampNDockOn")
{
SetLocked(oObject,FALSE);
}
oObject = GetNextObjectInArea();
}
}
else
{
if(GetIsDay())
{
while(GetIsObjectValid(oObject))
{
if(GetTag(oObject) == "LampNDockOn")
{
SetLocked(oObject,FALSE);
}
oObject = GetNextObjectInArea();
}
}
else
{
if(GetIsDusk())
{
while(GetIsObjectValid(oObject))
{
if(GetTag(oObject) == "LampNDockOff")
{
SetLocked(oObject,FALSE);
}
oObject = GetNextObjectInArea();
}
}
else
{
if(GetIsNight())
{
while(GetIsObjectValid(oObject))
{
if(GetTag(oObject) == "LampNDockOff")
{
SetLocked(oObject,FALSE);
}
oObject = GetNextObjectInArea();
}
}
}
}
}
//}
DelayCommand(2.0,RecomputeStaticLighting(oArea));
}
And this is the on unlocked script for a lamp that's on in the area.
void main()
{
object oLamp = OBJECT_SELF;
string sLamp = "lamp_n_dock_off";
int nType = OBJECT_TYPE_PLACEABLE;
location lLoc = GetLocation(oLamp);
CreateObject(nType,sLamp,lLoc,FALSE);
DestroyObject(oLamp,0.01f);
}
I had to uncoment the check for the PC on the first script. for some reason it would only kill the lights in the area of the PC.
I have made 2 areas so far, with about 30 lights, and have not noticed any lag.
Ed.