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 placables illumination state to the oposite of what it allready is
    SetPlaceableIllumination(OBJECT_SELF, !GetPlaceableIllumination());
    // Required for users to see static lighting changes
    RecomputeStaticLighting(GetArea(OBJECT_SELF));
  }
  else if(GetTimeHour()==6)
  {
    // Sets the placables illumination state to the oposite of what it allready is
    SetPlaceableIllumination(OBJECT_SELF, !GetPlaceableIllumination());
    // Required for users to see static lighting changes
    RecomputeStaticLighting(GetArea(OBJECT_SELF));
  }
}

See Also

functions: RecomputeStaticLighting | SetPlaceableIllumination
categories: Effects Functions


 author: Tom Cassiotis, editor: Sarev0k