OsSetSpeed

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Correcting the script)
m (Change See Also)
 
(5 intermediate revisions by one user not shown)
Line 4: Line 4:
 
|delay=0
 
|delay=0
 
|function_syntax= osSetSpeed(key ID, float SpeedModifier)
 
|function_syntax= osSetSpeed(key ID, float SpeedModifier)
 +
|description=Implemented December 30, 2009 by Revolution in GIT# 87959464c9db8948bed89909913400bc2eb7524d - Rev 11850
 +
 +
This allows for users to speed themselves up. It multiplies the running, walking, rotating and flying of the avatar.
 +
 +
The default value for '''SpeedModifier''' is 1.0.
 +
 +
To be precise, it affects physical velocity. If you specify too large or too small number for '''SpeedModifier''', the target will be unmovable, showing the following message in the region console:
 +
:''[PHYSICS]: Got a NaN velocity from Scene in a Character''
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
//
 
//
 
// osSetSpeed Script Example
 
// osSetSpeed Script Example
 +
// Author: djphil
 
//
 
//
  
Line 23: Line 32:
 
         {
 
         {
 
             osSetSpeed(llDetectedKey(0), 2.0);
 
             osSetSpeed(llDetectedKey(0), 2.0);
             llSay(PUBLIC_CHANNEL, "Your speed in now set to 2.0");
+
             llSay(PUBLIC_CHANNEL, "Your speed in now multiplied by 2.0");
 
         }
 
         }
 
          
 
          
Line 29: Line 38:
 
         {
 
         {
 
             osSetSpeed(llDetectedKey(0), 1.0);
 
             osSetSpeed(llDetectedKey(0), 1.0);
             llSay(PUBLIC_CHANNEL, "Your speed in now set to the default value (1.0)");
+
             llSay(PUBLIC_CHANNEL, "Your speed in now multiplied by 1.0, the default value.");
 
         }
 
         }
 
     }
 
     }
 
}
 
}
 
</source>
 
</source>
|description=Implemented December 30, 2009 by Revolution in GIT# 87959464c9db8948bed89909913400bc2eb7524d - Rev 11850
+
|additional_info=As of 0.7.1.1, you can't apply float numbers to '''SpeedModifier''' (it will result in script compile error) due to the bug [http://opensimulator.org/mantis/view.php?id=5564 #5564]. On 0.7.2-dev or later, you will able to do so.
 
+
This allows for users to speed themselves up. It multiplies the running, walking, rotating and flying of the avatar.
+
 
+
The default value for '''SpeedModifier''' is 1.0.
+
 
+
To be precise, it affects physical velocity. If you specify too large or too small number for '''SpeedModifier''', the target will be unmovable, showing the following message in the region console:
+
:''[PHYSICS]: Got a NaN velocity from Scene in a Character''
+
 
+
Note: As of 0.7.1.1, you can't apply float numbers to '''SpeedModifier''' (it will result in script compile error) due to the bug [http://opensimulator.org/mantis/view.php?id=5564 #5564]. On 0.7.2-dev or later, you will able to do so.
+
 
|
 
|
 
}}
 
}}
 +
== See Also ==
 +
* [[osSetSpeed]]
 +
* [[osSetOwnerSpeed]]

Latest revision as of 19:49, 5 December 2020

osSetSpeed(key ID, float SpeedModifier)
Implemented December 30, 2009 by Revolution in GIT# 87959464c9db8948bed89909913400bc2eb7524d - Rev 11850

This allows for users to speed themselves up. It multiplies the running, walking, rotating and flying of the avatar.

The default value for SpeedModifier is 1.0.

To be precise, it affects physical velocity. If you specify too large or too small number for SpeedModifier, the target will be unmovable, showing the following message in the region console:

[PHYSICS]: Got a NaN velocity from Scene in a Character
Threat Level Moderate
Permissions ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
//
// osSetSpeed Script Example
// Author: djphil
//
 
integer switch;
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osSetSpeed usage.");
    }
 
    touch_start(integer number) 
    {
        if (switch = !switch)
        {
            osSetSpeed(llDetectedKey(0), 2.0);
            llSay(PUBLIC_CHANNEL, "Your speed in now multiplied by 2.0");
        }
 
        else
        {
            osSetSpeed(llDetectedKey(0), 1.0);
            llSay(PUBLIC_CHANNEL, "Your speed in now multiplied by 1.0, the default value.");
        }
    }
}
Notes
As of 0.7.1.1, you can't apply float numbers to SpeedModifier (it will result in script compile error) due to the bug #5564. On 0.7.2-dev or later, you will able to do so.


[edit] See Also

Personal tools
General
About This Wiki