GetPlaceableIllumination
From NWN Lexicon
Jump to navigationJump to search
GetPlaceableIllumination(object)
Retrieves the current state of a placeables illumination.
int GetPlaceableIllumination(
object oPlaceable = OBJECT_SELF
);
Parameters
oPlaceable
(Default: OBJECT_SELF)
Description
Returns TRUE if oPlaceable's illumination is on and returns FALSE if otherwise.
Version
1.22
Example
// Demonstrates how to turn on and off a placeable's illumination based on the time of day.
// Designed to be used in the OnHeartbeat event of the placeable object.
void main()
{
if(GetTimeHour()==20)
{
// Sets the placeables illumination state to the opposite of what it already is
SetPlaceableIllumination(OBJECT_SELF, !GetPlaceableIllumination());
// Required for users to see static lighting changes
RecomputeStaticLighting(GetArea(OBJECT_SELF));
}
else if(GetTimeHour()==6)
{
// Sets the placeables illumination state to the opposite of what it already is
SetPlaceableIllumination(OBJECT_SELF, !GetPlaceableIllumination());
// Required for users to see static lighting changes
RecomputeStaticLighting(GetArea(OBJECT_SELF));
}
}
See Also
| functions: |
author: Tom Cassiotis, editor: Sarev0k