OsGetSunParam

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''Function Syntax:''' OsGetSunParam(string param);<br>'''Returns:''' double
+
{{osslfunc
 
+
|threat_level=ignored
Example Required&nbsp;!<br>
+
|permissions=true
 
+
|delay=0
<br> '''NOTE'''&nbsp;: This function replaces the deprecated [[OsSunGetParam]] function.  
+
|additional_info=This function was added in 0.7.2-post-fixes
 
+
|function_syntax=float osGetSunParam(string param)
[[Category:OSSL]][[Category:OSSL_functions_without_example]]
+
|ossl_example=<source lang = "lsl">
[[Category:OSSL functions without threat level]]
+
// ----------------------------------------------------------------
 +
// Example / Sample Script to show function use.
 +
//
 +
// Script Title:   osSetSunParam_osGetSunParam.lsl
 +
// Script Author:  WhiteStar Magic
 +
// Threat Level:    None
 +
// Script Source: 
 +
//
 +
// Notes: See Script Source reference for more detailed information
 +
// This sample is full opensource and available to use as you see fit and desire.
 +
// Threat Levels only apply to OSSL & AA Functions
 +
//
 +
// ================================================================
 +
// Inworld Script Line: osSetSunParam(string param, float value);
 +
//
 +
// Example of osSetSunParam
 +
// Params  "year_length" = "number of days to a year"
 +
// Params  "day_length" = "number of seconds to a day"
 +
// Params  "day_night_offset" = "induces a horizon shift"
 +
// Params  "update_interval" = "how often to update the sun's position in frames"
 +
// Params  "day_time_sun_hour_scale" = "scales day light vs nite hours to change day/night ratio"
 +
//
 +
string Params = "day_length";
 +
float Value = 4.0;
 +
integer touched = FALSE;
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        llSay(0,"Touch to see osSetSunParam & osGetSunParam work.");
 +
    }
 +
    touch_end(integer num)
 +
    {
 +
        if(touched)
 +
        {
 +
            touched = FALSE;
 +
            Value = 4.0;
 +
            osSetSunParam(Params, Value);
 +
            //osSunSetParam(Params, Value);  // deprecated version
 +
            llOwnerSay("Sun Params ("+Params+") = ["+(string)osGetSunParam(Params)+"]");
 +
        }
 +
        else
 +
        {
 +
            touched = TRUE;
 +
            Value = 24.0;
 +
            osSetSunParam(Params, Value);
 +
            //osSunSetParam(Params, Value);  // deprecated version
 +
            llOwnerSay("Sun Params ("+Params+") = ["+(string)osGetSunParam(Params)+"]");
 +
        }
 +
    }
 +
}
 +
</source>
 +
|description='''NOTE''' : This function should not be used in 0.9.2.0. It did depend on Sun module, removed on 0.9.2. This function did replace the deprecated [[OsSunGetParam]] function.<br>
 +
Since version 0.9.2.0 parameter "day_length" will return the same as llGetDayLength(), ie, the day length on the prim location. Other parameters return fixed dummy values.
 +
|
 +
}}

Latest revision as of 08:10, 12 September 2020

float osGetSunParam(string param)
NOTE : This function should not be used in 0.9.2.0. It did depend on Sun module, removed on 0.9.2. This function did replace the deprecated OsSunGetParam function.

Since version 0.9.2.0 parameter "day_length" will return the same as llGetDayLength(), ie, the day length on the prim location. Other parameters return fixed dummy values.

Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
// ----------------------------------------------------------------
// Example / Sample Script to show function use.
//
// Script Title:    osSetSunParam_osGetSunParam.lsl
// Script Author:   WhiteStar Magic
// Threat Level:    None
// Script Source:   
//
// Notes: See Script Source reference for more detailed information
// This sample is full opensource and available to use as you see fit and desire.
// Threat Levels only apply to OSSL & AA Functions
// 
// ================================================================
// Inworld Script Line: osSetSunParam(string param, float value); 
//
// Example of osSetSunParam
// Params  "year_length" = "number of days to a year"
// Params  "day_length" = "number of seconds to a day"
// Params  "day_night_offset" = "induces a horizon shift"
// Params  "update_interval" = "how often to update the sun's position in frames"
// Params  "day_time_sun_hour_scale" = "scales day light vs nite hours to change day/night ratio"
//
string Params = "day_length";
float Value = 4.0;
integer touched = FALSE;
default
{
    state_entry()
    {
        llSay(0,"Touch to see osSetSunParam & osGetSunParam work.");
    }
    touch_end(integer num)
    {
        if(touched)
        {
            touched = FALSE;
            Value = 4.0;
            osSetSunParam(Params, Value);
            //osSunSetParam(Params, Value);  // deprecated version
            llOwnerSay("Sun Params ("+Params+") = ["+(string)osGetSunParam(Params)+"]");
        }
        else
        {
            touched = TRUE;
            Value = 24.0;
            osSetSunParam(Params, Value);
            //osSunSetParam(Params, Value);  // deprecated version
            llOwnerSay("Sun Params ("+Params+") = ["+(string)osGetSunParam(Params)+"]");
        }
    }
}
Notes
This function was added in 0.7.2-post-fixes


Personal tools
General
About This Wiki