Difference between revisions of "LlReplaceAgentEnvironment"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{LSL_Function |func=llReplaceAgentEnvironment |func_desc=The llReplaceAgentEnvironment function overrides the current region and parcel environment seen by an agent. The new...")
 
Line 23: Line 23:
{{!}}-
{{!}}-
{{!}} ENV_INVALID_AGENT {{!!}} -4 {{!!}} Unable to find specified agent.
{{!}} ENV_INVALID_AGENT {{!!}} -4 {{!!}} Unable to find specified agent.
{{!}}-
{{!}} ENV_NO_EXPERIENCE_LAND {{!!}} -7 {{!!}} The experience has not been enabled or can not run on the land.
{{!}}}
{{!}}}
|caveats=
|caveats=

Revision as of 15:19, 6 February 2019

Summary

Function: Integer llReplaceAgentEnvironment( key agent_id, float transition, string environment );

The llReplaceAgentEnvironment function overrides the current region and parcel environment seen by an agent. The new environment persists until the agent crosses to a new region or this function is called with the NULL_KEY or empty string for the particular agent. This function must be executed as part of an experience.
Returns an Integer

• key agent_id 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.
• string environment The name of an environmental setting in the object's inventory or the asset ID for an environment.

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_NO_EXPERIENCE_LAND -7 The experience has not been enabled or can not run on the land.

Caveats

  • The agent's viewer may choose to ignore this command.
  • An environment set locally on the viewer will override any environment set from this function.
  • If a UUID is passed as the environment parameter and that UUID does not specify an environment setting, the viewer quietly ignores the instruction.
All Issues ~ Search JIRA for related Bugs

Examples

Deep Notes

Search JIRA for related Issues

Signature

function Integer llReplaceAgentEnvironment( key agent_id, float transition, string environment );