LlGetEnvironment
Looking for the current API? Open the llGetEnvironment reference →
Function notes
If an unknown rule is encountered in the parameter list an error is sent to the debug channel.
Return value notes
Returns a list containing the current environment values for the parcel or region as a list of attributes. Takes a list of attributes to retrieve in params and returns them in the order requested.
Specification
LSL Function/color:
{{LSL_Function/color|color}}Parameters
| parameter | integer value | return values | description |
|---|---|---|---|
| SKY_TRACKS | 15 | float sky2, float sky3, float sky4 | Altitudes for sky transitions in the region. |
| SKY_AMBIENT | 0 | vector ambient_color | The ambient color of the environment. |
| SKY_TEXTURE_DEFAULTS | 1 | integer bloom_is_default, integer halo_is_default, integer rainbow_is_default | Checks if the textures are currently set to use the default. For default values, the returned integer is 1. If the texture uses something other than the default, the returned value is 0. |
| SKY_CLOUDS | 2 | vector color, float coverage, float scale, float variance, vector scroll, vector density, vector detail, integer is_default | Environmental cloud information.
|
| SKY_DOME | 4 | float offset, float radius, float max_altitude | Sky dome information.
|
| SKY_GAMMA | 5 | float gamma | The gamma value applied to the scene. In viewer versions 7.0+, this value has been repurposed into the "HDR Scale" value in the EEP editor. (Thus, this will return the value of the HDR Scale slider). |
| SKY_GLOW | 6 | float glow_size, float glow_focus | Glow applied to the sun and moon.
|
| SKY_MOON | 9 | rotation rot, float scale, float brightness, integer is_default_texture, vector direction, vector ambient_color, vector diffuse_color | Detailed moon information
|
| SKY_STAR_BRIGHTNESS | 13 | float brightness | |
| SKY_SUN | 14 | rotation rot, float scale, vector sun_color, integer is_default_texture, vector direction, vector ambient_color, vector diffuse_color | Detailed sun information
|
| SKY_PLANET | 10 | float planet_radius, float sky_bottom_radius, float sky_top_radius | Planet information used in rendering the sky
|
| SKY_REFRACTION | 11 | float moisture_level, float droplet_radius, float ice_level | Sky refraction parameters for rainbows and optical effects.
|
| SKY_LIGHT | 8 | vector light_direction, vector fade_color, vector total_ambient | Miscellaneous lighting values
|
| SKY_REFLECTION_PROBE_AMBIANCE | 24 | float ambiance | Minimum ambiance value for all reflection probes. range = [0.0, 10.0] Caveat: This parameter will be supported in the upcoming GLTF Materials project. Currently it will only work in supported testing areas with a supported test viewer. |
| WATER_BLUR_MULTIPLIER | 100 | float multiplier | Multiplier applied to blur the scene when under water. |
| WATER_FOG | 101 | vector LSL Function/color: {{LSL_Function/color|color}}, float density, float modulation | Fog parameters applied when underwater
|
| WATER_FRESNEL | 102 | float offset, float scale | Fresnel scattering applied to the surface of the water.
|
| WATER_TEXTURE_DEFAULTS | 103 | integer normal_is_default, integer transparent_is_default | Checks if the textures are currently set to use the default. For default values the returned integer is 1, if the texture uses something other than the default this value is 0. |
| WATER_NORMAL_SCALE | 104 | vector scale | Scaling applied to the water normal map. |
| WATER_REFRACTION | 105 | float scale_above, float scale_below | Refraction factors when looking through the surface of the water.
|
| WATER_WAVE_DIRECTION | 106 | vector large_wave, vector small_wave | Vector for the directions of the waves Y represents north/south and X represents movement east/west.
|
| ENVIRONMENT_DAYINFO | 200 | integer day_length, integer day_offset, float secs_since_midnight | Current time and day information
|
Caveats
- If the script can not run in the requested parcel, this function returns an empty list and issues a warning in the debug channel.
- SKY_LIGHT's param fade_color does not return a clamped value, meaning an unusually bright scene will cause it to return an out-of-bounds color. (This can be fixed by clamping the value manually, but this should really return a clamped value).
Examples
default
{
touch_start(integer total_number)
{
list environment = llGetEnvironment(llGetPos(), [SKY_TRACKS, SKY_AMBIENT, SKY_CLOUDS]);
llOwnerSay(llDumpList2String(environment, ", "));
}
}See also: functions
Shared wiki helpers
The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.
Original shared helper source (conditional wiki logic is not evaluated)
{{#ifeq:{{NAMESPACE}}|Template|{{Multi-lang|<includeonly>category=Jira Issues</includeonly>}}}}<includeonly>{{#if:
The purpose of the following is to swap out the old code and use a new template without breaking the old templates.
{{#if:{{{status|}}}{{{resolution|}}}|
{{#vardefine:last_issue|{{{{{debugging|Issue/Version 1}}}|{{{1}}}|{{{2|}}}
|style={{{style|}}}
|status={{{status|}}}
|resolution={{{resolution|}}}
|priority={{{priority|}}}
|type={{{type|}}}
|dnc={{{dnc|}}}
|fc={{{fc|}}}
}}}}
|
{{#vardefine:last_issue|{{{{{debugging|Issue/Version 1}}}|{{{1}}}|{{{2|}}}
|style={{{style|}}}
|status={{{status|}}}
|resolution={{{resolution|}}}
|priority={{{priority|}}}
|type={{{type|}}}
|dnc={{{dnc|}}}
|fc={{{fc|}}}
}}}}
}}
{{#vardefine:issues{{#var:direction}}|{{#var:issues{{#var:direction}}}}
{{#var:last_issue}}}}
{{#ifexpr:{{#var:count-last-issue|0}} > 0|
{{#vardefine:bugs{{#var:direction}}|{{#var:bugs{{#var:direction}}}}
{{#var:last_issue}}}}
}}
}}{{#if:{{{1|}}}|{{#ifeq:{{NAMESPACE}}|Template|{{IssueTable}}[[Category:Jira Issues{{#var:lang}}|{{#explode:{{{1}}}|-|0}}-{{padleft:{{#explode:{{{1}}}|-|1}}|6|0}}]]}}}}</includeonly><noinclude>
{{documentation}}</noinclude>Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.