The new SetObjectVisibleDistance() function allows us to overcome that annoying problem with dynamic placeables and doors disappearing beyond 45m or so.
Quite rightly, it comes with dire warnings about performance. However, for SP, I wondered what would happen if I turned it on universally. It’s early days, but so far the results are stunning, with no obvious degradation.
The following code is one-shot OnClientEnter:
const float FOREVER = 1000000000000.0;
// Override dynamic object visibility
// This may degrade performance - if so, apply selectively
void zSetObjectVisibleDistance()
{
object oArea = GetFirstArea();
object oObject;
int nObjectType;
float fVisibilityRange = FOREVER;
while (GetIsObjectValid(oArea))
{
oObject = GetFirstObjectInArea(oArea);
while (GetIsObjectValid(oObject))
{
nObjectType = GetObjectType(oObject);
if ((nObjectType == OBJECT_TYPE_PLACEABLE)
|| (nObjectType == OBJECT_TYPE_DOOR))
SetObjectVisibleDistance(oObject, fVisibilityRange);
oObject = GetNextObjectInArea(oArea);
}
oArea = GetNextArea();
}
}