Difference between revisions of "LlSetAgentEnvironment"

From Second Life Wiki
Jump to navigation Jump to search
Line 24: Line 24:
{{!}}-
{{!}}-
{{!}} ENV_INVALID_RULE {{!!}} -5 {{!!}} There was an issue with one of the rules.
{{!}} ENV_INVALID_RULE {{!!}} -5 {{!!}} There was an issue with one of the rules.
{{!}}-
{{!}} ENV_VALIDATION_FAIL {{!!}} -6 {{!!}} Unable to validate values passed.
{{!}}-
{{!}}-
{{!}} ENV_NO_EXPERIENCE_LAND {{!!}} -7 {{!!}} The experience has not been enabled or can not run on the land.
{{!}} ENV_NO_EXPERIENCE_LAND {{!!}} -7 {{!!}} The experience has not been enabled or can not run on the land.

Revision as of 14:26, 6 February 2019

Summary

Function: llSetAgentEnvironment( key agent_it, float transition, list params );

This function sets environment values for an individual agent in an experience. The changes to the environment persist until the agent moves to a new region or llSetAgentEnvironment is called for an agent with an empty list.

• key agent_it The key for an agent in the region. The agent must be in the region and must be participating in the experience.
• float transition The number of seconds over which to transition to the new settings.
• list params A list of parameters to retrieve from the current environment. See table below for details.

Return Values
Value Constant Description
1 The agent has been instructed to change their environment.
ENV_NOT_EXPERIENCE -1 The script is not running as part of an experience with a valid experience key.
ENV_NO_EXPERIENCE_PERMISSION -2 The agent has not granted permission.
ENV_NO_ENVIRONMENT -3 The environment inventory object could not be found.
ENV_INVALID_AGENT -4 Unable to find specified agent.
ENV_INVALID_RULE -5 There was an issue with one of the rules.
ENV_VALIDATION_FAIL -6 Unable to validate values passed.
ENV_NO_EXPERIENCE_LAND -7 The experience has not been enabled or can not run on the land.
Parameters
Parameter Constant Return values Description
SKY_CLOUDS 2 vector color, float coverage, float scale, float variance, vector scroll, vector density, vector detail Environmental cloud information:
  • color: The color used for the clouds.
  • coverage: The coverage percentage.
  • scale: The scaling applied to the cloud textures.
  • variance: A randomizing factor applied to the main cloud layer.
  • scroll: The scroll speed of the clouds. X is east/west, Y is north/south, and Z is unused.
  • density: The X/Y and D parameter used to generate cloud density.
  • detail: The X/Y and D parameter used to generate cloud details.
SKY_CLOUD_TEXTURE 19 string texture_ident Name of item in inventory or UUID for texture to be used for the clouds.
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.
SKY_GLOW 6 float glow_size, float glow_focus Glow applied to the sun and moon.
  • glow_size: size of glow effect
  • glow_focus: focus of glow effect
SKY_MOON 9 rotation rot, float scale, float brightness Detailed moon information:
  • rot: The current rotation applied to the moon.
  • scale: The current scale applied to the moon's texture.
  • brightness: The moon's brightness.
SKY_MOON_TEXTURE 20 string texture_ident Name of texture in inventory or UUID for texture to be used for the moon.
SKY_STAR_BRIGHTNESS 13 float brightness
SKY_SUN 14 rotation rot, float scale, vector sun_color Detailed sun information:
  • rot: The current rotation applied to the sun.
  • scale: The current scale applied to the sun's texture.
  • sun_color: The sun's color.
SKY_SUN_TEXTURE 21 string texture_ident Name of texture in inventory or UUID for texture to be used for the sun.
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.
WATER_BLUR_MULTIPLIER 100 float multiplier Multiplier applied to blur the scene when under water.
WATER_FOG 101 vector color, float density, fload modulation Fog parameters applied when underwater:
  • color: The color of the underwater fog.
  • density: Density exponent applied to the fog.
  • modulation:
WATER_FRESNEL 102 float offset, float scale Fresnel scattering applied to the surface of the water.
WATER_NORMAL_TEXTURE 107 string texture_ident Name of texture in inventory or UUID of texture to be used for the water normal.
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.
  • large_wave: Large wave speed and direction.
  • small_wave: Small wave speed and direction.

Caveats

The list of valid parameters differs from those available for llGetEnvironment.

Examples

Deep Notes

Signature

function void llSetAgentEnvironment( key agent_it, float transition, list params );