Skip to content
lsl.devlsl.devLSL Dev

Environments

Environments, from the Environmental Enhancement Project (EEP), define the sky, water and day cycle. Regions and parcels have an environment, and each avatar can see an override on top of it.

Scripts can read the sun and moon positions, change a parcel’s or region’s environment where the owner allows it, and give a single avatar a temporary environment through an experience. Wind, water height and ground shape are separate region properties, not part of the environment.

Concepts

Functions and events

listllGetEnvironment(vector pos, list params)
vectorllGetSunDirection()
vectorllGetMoonDirection()
floatllGetTimeOfDay()
integerllReplaceEnvironment(vector position, string environment, integer track_no, integer day_length, integer day_offset)
integerllSetEnvironment(vector position, list params)
integerllReplaceAgentEnvironment(key agent_id, float transition, string environment)
integerllSetAgentEnvironment(key agent_id, float transition, list params)

llSetEnvironment parameters

The SKY_* and WATER_* settings that scripts can read and set. See the constant groups below.

Scripting Details

listllGetEnvironment(vector pos, list params)
Returns a list containing the current environment parameters for the parcel or region at pos, retrieved in the order specified by params.
vectorllGetSunDirection()
Returns a normalized vector representing the current direction of the parcel's sun, taking altitude into account. Falls back to the region's sun direction if no custom parcel environment is set.
rotationllGetSunRotation()
Returns a rotation representing the orientation applied to the sun on the current parcel and altitude track. Falls back to the region's sun rotation if no custom parcel environment is set.
vectorllGetMoonDirection()
Returns a normalized vector representing the current direction of the parcel's moon, taking altitude into account. Falls back to the region's moon direction if no custom parcel environment is set.
rotationllGetMoonRotation()
Returns a rotation representing the orientation applied to the moon on the current parcel and altitude track. Falls back to the region's moon rotation if no custom parcel environment is set.
vectorllGetRegionSunDirection()
Returns a normalized vector representing the current direction of the region's sun, taking altitude into account.
rotationllGetRegionSunRotation()
Returns a rotation representing the orientation applied to the sun at the region level, taking altitude track into account.
vectorllGetRegionMoonDirection()
Returns a normalized vector representing the current direction of the region's moon, taking altitude into account.
rotationllGetRegionMoonRotation()
Returns a rotation representing the orientation applied to the moon at the region level, taking altitude track into account.
integerllGetDayLength()
Returns an integer representing the number of seconds in the environmental day cycle applied to the current parcel.
integerllGetDayOffset()
Returns an integer representing the offset duration (in seconds) added to calculate the current environmental time on this parcel.
integerllGetRegionDayLength()
Returns an integer representing the total number of seconds in the region-wide day cycle.
integerllGetRegionDayOffset()
Returns an integer representing the offset duration (in seconds) added to calculate the current environmental time for the region.
floatllGetTimeOfDay()
Returns a float with subsecond precision representing the elapsed seconds since parcel environmental midnight or region uptime (whichever is smaller). If the parcel's sun position is fixed, returns region uptime.
floatllGetRegionTimeOfDay()
Returns a float with subsecond precision representing the elapsed seconds since region environmental midnight or region uptime (whichever is smaller). If the region's sun position is fixed, returns region uptime.
integerllReplaceEnvironment(vector position, string environment, integer track_no, integer day_length, integer day_offset)
Replaces the environment on the parcel containing position (or the entire region if position is <-1.0, -1.0, -1.0>) for the specified track_no. Modifies day_length and day_offset if specified. Requires edit permissions on the parcel or estate management rights.
integerllSetEnvironment(vector position, list params)
Overrides the environmental settings at position for a parcel (or region if position is <-1.0, -1.0, z>) using the parameters in params. Passing an empty params list removes previous overrides.
integerllReplaceAgentEnvironment(key agent_id, float transition, string environment)
Replaces the region and parcel environment seen by the specified agent_id as part of an experience, transitioning the settings over transition seconds. Passing NULL_KEY or an empty string for environment restores defaults.
integerllSetAgentEnvironment(key agent_id, float transition, list params)
Sets an individual agent's environmental settings using the attributes in params over a duration of transition seconds. Must be used as part of an experience; passing an empty list removes overrides.

Additional

Constant groups EnvironmentParamReadOnly 28EnvironmentParam 23EnvironmentError 10

See also Category Parcel AppearanceSL Wiki llSetEnvironment parametersPlanned Guide: changing and replacing an environment

See also Feature ExperienceCategory Region AppearanceFeature Parcels & Regions