LsSetWindlightSceneTargeted

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
m (Small changes in the script)
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
 
= lsSetWindlightSceneTargeted =
 
= lsSetWindlightSceneTargeted =
 +
 +
<div style="background-color:#FFA0A0; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">
 +
'''Caution !''' This function is temporary not supported ...
 +
</div>
 +
 
== Function ==
 
== Function ==
 
'''integer''' lsSetWindlightSceneTargeted('''list''' rules,'''key''' who);
 
'''integer''' lsSetWindlightSceneTargeted('''list''' rules,'''key''' who);
Line 18: Line 23:
 
<source lang="lsl">
 
<source lang="lsl">
 
//
 
//
// lsSetWindlightScene Script Exemple
+
// lsSetWindlightSceneTargeted Script Exemple
 
// Author: djphil
 
// Author: djphil
 
//
 
//
Line 28: Line 33:
 
     state_entry()
 
     state_entry()
 
     {
 
     {
         llSay(PUBLIC_CHANNEL, "Touch to see lsSetWindlightScene usage.");
+
         llSay(PUBLIC_CHANNEL, "Touch to see lsSetWindlightSceneTargeted usage.");
 
     }
 
     }
  
Line 41: Line 46:
  
 
         list settings = [WL_WATER_COLOR, color];
 
         list settings = [WL_WATER_COLOR, color];
         integer result = lsSetWindlightScene(settings);
+
         integer result = lsSetWindlightSceneTargeted(settings, llDetectedKey(0));
  
 
         if (result == TRUE)
 
         if (result == TRUE)
 
         {
 
         {
             llSay(PUBLIC_CHANNEL, "The Windlight Scene was changed with success.");
+
             llSay(PUBLIC_CHANNEL, "The Windlight Scene Targeted was changed with success.");
 
             llSay(PUBLIC_CHANNEL, "The current water color is: " + (string)color);
 
             llSay(PUBLIC_CHANNEL, "The current water color is: " + (string)color);
 
         }
 
         }
Line 51: Line 56:
 
         else
 
         else
 
         {
 
         {
             llSay(PUBLIC_CHANNEL, "The Windlight Scene was changed without success.");
+
             llSay(PUBLIC_CHANNEL, "The Windlight Scene Targeted was changed without success.");
 
         }
 
         }
 
     }
 
     }
Line 70: Line 75:
 
* [[lsGetWindlightScene]]
 
* [[lsGetWindlightScene]]
 
* [[lsSetWindlightScene]]
 
* [[lsSetWindlightScene]]
 +
* [[lsSetWindlightSceneTargeted]]
 
* [[lsClearWindlightScene]]
 
* [[lsClearWindlightScene]]
  

Revision as of 02:33, 19 December 2020

Contents

lsSetWindlightSceneTargeted

Caution ! This function is temporary not supported ...

Function

integer lsSetWindlightSceneTargeted(list rules,key who);

Set a list of Windlight settings in the scene to new values for a specific targeted user.

  • list rules - a list containing pairs of LightShare Parameters and values to set
  • key who - the UUID of the person to change Windlight settings for

Caveats

The list used by this function cannot be passed directly from lsGetWindlightScene without triggering C# exceptions from the Simulator.

LightShare must be enabled in the Simulator.

This script function is restricted to the region owner only, who may use it to set Windlight settings for others in the region.

Examples

//
// lsSetWindlightSceneTargeted Script Exemple
// Author: djphil
//
 
integer switch;
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see lsSetWindlightSceneTargeted usage.");
    }
 
    touch_start(integer number)
    {
        vector color = <4.0, 38.0, 64.0>;
 
        if (switch = !switch)
        {
            color = <llFrand(255.0), llFrand(255.0), llFrand(255.0)>;
        }
 
        list settings = [WL_WATER_COLOR, color];
        integer result = lsSetWindlightSceneTargeted(settings, llDetectedKey(0));
 
        if (result == TRUE)
        {
            llSay(PUBLIC_CHANNEL, "The Windlight Scene Targeted was changed with success.");
            llSay(PUBLIC_CHANNEL, "The current water color is: " + (string)color);
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "The Windlight Scene Targeted was changed without success.");
        }
    }
}

Notes

Rules contain pairs of data in the form of the parameter followed by the value to set.

Setting new parameters with lsSetWindlightScene commits the new changes to the regionwindlight database table immediately.

Excessive use of this function can cause unnecessary database requests.

Use this function if you wish to avoid database loading with lsSetWindlightScene.

See Also

Functions

Articles

Deep Notes

All Issues

Personal tools
General
About This Wiki