LsGetWindlightScene
From OpenSimulator
(Difference between revisions)
m |
|||
(3 intermediate revisions by one user not shown) | |||
Line 12: | Line 12: | ||
== Examples == | == Examples == | ||
− | |||
<source lang="lsl"> | <source lang="lsl"> | ||
− | + | // | |
− | + | // lsGetWindlightScene Script Exemple | |
+ | // Author: djphil | ||
+ | // | ||
− | + | default | |
− | state_entry() { | + | { |
− | + | // Event handler triggered when the script is initialized | |
− | + | state_entry() | |
+ | { | ||
+ | // Send a message to public channel informing users to touch to see usage | ||
+ | llSay(PUBLIC_CHANNEL, "Touch to see lsGetWindlightScene usage."); | ||
} | } | ||
− | + | ||
+ | // Event handler triggered when the object is touched | ||
+ | touch_start(integer number) | ||
+ | { | ||
+ | // Define a list of rules to retrieve Windlight settings (e.g., water color) | ||
+ | list rules = [WL_WATER_COLOR]; | ||
+ | |||
+ | // Call lsGetWindlightScene function to retrieve Windlight settings based on the rules | ||
+ | list settings = lsGetWindlightScene(rules); | ||
+ | |||
+ | // Extract the water color setting from the retrieved settings list and display it | ||
+ | llSay(PUBLIC_CHANNEL, "The current water color is: " + llList2String(settings, 1)); | ||
+ | } | ||
+ | } | ||
</source> | </source> | ||
− | + | The current water color is: <4.000000, 38.000000, 64.000000> | |
== Notes == | == Notes == | ||
Line 33: | Line 50: | ||
== See Also == | == See Also == | ||
=== Functions === | === Functions === | ||
+ | * [[lsGetWindlightScene]] | ||
* [[lsSetWindlightScene]] | * [[lsSetWindlightScene]] | ||
* [[lsSetWindlightSceneTargeted]] | * [[lsSetWindlightSceneTargeted]] | ||
Line 44: | Line 62: | ||
=== All Issues === | === All Issues === | ||
* http://opensimulator.org/mantis/search.php?project_id=1&search=lsGetWindlightScene&hide_status_id=-2 | * http://opensimulator.org/mantis/search.php?project_id=1&search=lsGetWindlightScene&hide_status_id=-2 | ||
− | |||
[[Category:Scripting]] | [[Category:Scripting]] |
Latest revision as of 01:57, 5 March 2024
Contents |
[edit] lsGetWindlightScene
[edit] Function
list lsGetWindlightScene(list rules);
Get a list of the current Windlight settings in the scene
- list rules - a list of the LightShare Parameters to retrieve
An empty rules list will return an empty result list.
[edit] Caveats
The list returned by this function cannot be passed directly to lsSetWindlightScene without triggering C# exceptions from the Simulator.
[edit] Examples
// // lsGetWindlightScene Script Exemple // Author: djphil // default { // Event handler triggered when the script is initialized state_entry() { // Send a message to public channel informing users to touch to see usage llSay(PUBLIC_CHANNEL, "Touch to see lsGetWindlightScene usage."); } // Event handler triggered when the object is touched touch_start(integer number) { // Define a list of rules to retrieve Windlight settings (e.g., water color) list rules = [WL_WATER_COLOR]; // Call lsGetWindlightScene function to retrieve Windlight settings based on the rules list settings = lsGetWindlightScene(rules); // Extract the water color setting from the retrieved settings list and display it llSay(PUBLIC_CHANNEL, "The current water color is: " + llList2String(settings, 1)); } }
The current water color is: <4.000000, 38.000000, 64.000000>
[edit] Notes
Returned rules contain pairs of data in the form of the parameter requested followed by the current value. In the example above, the request returns [ 0, <4.000000,38.000000,64.000000> ] when used with default LightShare settings in a region.
[edit] See Also
[edit] Functions
- lsGetWindlightScene
- lsSetWindlightScene
- lsSetWindlightSceneTargeted
- lsClearWindlightScene