OsSetWindParam: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>Fritigern
No edit summary
No edit summary
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
----
{{osslfunc
*'''NOTE :''' This function replaces the deprecated [[osWindParamSet]] function.
|threat_level=VeryLow
----
|permissions=${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
|delay=0
|additional_info=This function was added in 0.7.2-post-fixes and replaces the deprecated osWindParamSet function.
|function_syntax= osSetWindParam(string plugin, string param, float value)
|ossl_example=Sets all available parameters of current active wind plugin module:
<source lang="lsl">
// osSetWindParam() sample
// Touch this object to change the current wind parameters
// Run osGetWindParam() sample to check if these values are applied


float newStrength = 30.0;
float newAvgStrength = 15.0;
float newAvgDirection = 10.0;
float newVarStrength = 7.0;
float newVarDirection = -30.0;
float newRateChange = 8.0;


{|  width="100%" style="border: thin solid black"
default
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
{
|- valign="top"
    touch_start(integer number)
|'''Threat Level''' || <Threat Level goes here>
    {
 
        string activePluginName = osWindActiveModelPluginName();
|- valign="top"
        if(activePluginName == "SimpleRandomWind")
|'''Function Syntax''' || <source lang="lsl">
        {
osSetWindParam(string plugin, string param, float value);
            llSay(0, "[SimpleRandomWind]");
            osSetWindParam("SimpleRandomWind", "strength", newStrength);
            llSay(0, "wind strength(strength) is changed to " + (string)newStrength);
        }
        else if(activePluginName == "ConfigurableWind")
        {
            llSay(0, "[ConfigurableWind]");
            osSetWindParam("ConfigurableWind", "avgStrength", newAvgStrength);
            llSay(0, "average wind strength(avg_strength) is changed to " + (string)newAvgStrength);
            osSetWindParam("ConfigurableWind", "avgDirection", newAvgDirection);
            llSay(0, "average wind direction in degrees(avg_direction) is changed to " + (string)newAvgDirection);
            osSetWindParam("ConfigurableWind", "varStrength", newVarStrength);
            llSay(0, "allowable variance in wind strength(var_strength) is changed to " + (string)newVarStrength);
            osSetWindParam("ConfigurableWind", "varDirection", newVarDirection);
            llSay(0, "allowable variance in wind direction in +/- degrees(var_direction) is changed to " + (string)newVarDirection);
            osSetWindParam("ConfigurableWind", "rateChange", newRateChange);
            llSay(0, "rate of change(rate_change) is changed to " + (string)newRateChange);
        }           
    }
}
</source>
</source>
|- valign="top"
|description=Sets '''value''' of '''param''' property for '''plugin''' module.
|'''Example(s)||
 
|}
 
*'''NOTE :''' as of July.29.2010 This Function is incomplete and non-functional.  


[[Category:OSSL Functions]]
Available parameters:
[[Category:OSSL_functions_without_example]]
{{{!}}border="1" cellspacing="0" width="100%"
[[Category:OSSL functions without threat level]]
!'''plugin'''{{!}}{{!}}'''param'''{{!}}{{!}}description{{!}}{{!}}default{{!}}{{!}}OpenSim.inisetting
{{!}}-
{{!}}SimpleRandomWind{{!}}{{!}}strength{{!}}{{!}}wind strength{{!}}{{!}}1.0f{{!}}{{!}}strength
{{!}}-
{{!}}rowspan="5"{{!}}ConfigurableWind{{!}}{{!}}avgStrength{{!}}{{!}}average wind strength in m/s{{!}}{{!}}5.0f{{!}}{{!}}avg_strength
{{!}}-
{{!}}avgDirection{{!}}{{!}}average wind direction in degrees{{!}}{{!}}0.0f{{!}}{{!}}avg_direction
{{!}}-
{{!}}varStrength{{!}}{{!}}allowable variance in wind strength in m/s{{!}}{{!}}5.0f{{!}}{{!}}var_strength
{{!}}-
{{!}}varDirection{{!}}{{!}}allowable variance in wind direction in +/- degrees{{!}}{{!}}30.0f{{!}}{{!}}var_direction
{{!}}-
{{!}}rateChange{{!}}{{!}}rate of change in seconds{{!}}{{!}}1.0f{{!}}{{!}}rate_change
{{!}}}
|
}}

Latest revision as of 22:35, 13 October 2023

osSetWindParam(string plugin, string param, float value)
Sets value of param property for plugin module.

Available parameters:

plugin param description default OpenSim.inisetting
SimpleRandomWind strength wind strength 1.0f strength
ConfigurableWind avgStrength average wind strength in m/s 5.0f avg_strength
avgDirection average wind direction in degrees 0.0f avg_direction
varStrength allowable variance in wind strength in m/s 5.0f var_strength
varDirection allowable variance in wind direction in +/- degrees 30.0f var_direction
rateChange rate of change in seconds 1.0f rate_change
Threat Level VeryLow
Permissions ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
Sets all available parameters of current active wind plugin module:
// osSetWindParam() sample
// Touch this object to change the current wind parameters
// Run osGetWindParam() sample to check if these values are applied

float newStrength = 30.0;
float newAvgStrength = 15.0;
float newAvgDirection = 10.0;
float newVarStrength = 7.0;
float newVarDirection = -30.0;
float newRateChange = 8.0;

default
{
    touch_start(integer number)
    {
        string activePluginName = osWindActiveModelPluginName();
        if(activePluginName == "SimpleRandomWind")
        {
            llSay(0, "[SimpleRandomWind]");
            osSetWindParam("SimpleRandomWind", "strength", newStrength);
            llSay(0, "wind strength(strength) is changed to " + (string)newStrength);
        }
        else if(activePluginName == "ConfigurableWind")
        {
            llSay(0, "[ConfigurableWind]");
            osSetWindParam("ConfigurableWind", "avgStrength", newAvgStrength);
            llSay(0, "average wind strength(avg_strength) is changed to " + (string)newAvgStrength);
            osSetWindParam("ConfigurableWind", "avgDirection", newAvgDirection);
            llSay(0, "average wind direction in degrees(avg_direction) is changed to " + (string)newAvgDirection);
            osSetWindParam("ConfigurableWind", "varStrength", newVarStrength);
            llSay(0, "allowable variance in wind strength(var_strength) is changed to " + (string)newVarStrength);
            osSetWindParam("ConfigurableWind", "varDirection", newVarDirection);
            llSay(0, "allowable variance in wind direction in +/- degrees(var_direction) is changed to " + (string)newVarDirection);
            osSetWindParam("ConfigurableWind", "rateChange", newRateChange);
            llSay(0, "rate of change(rate_change) is changed to " + (string)newRateChange);
        }            
    }
}
Notes
This function was added in 0.7.2-post-fixes and replaces the deprecated osWindParamSet function.