OsVolumeDetect

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
|threat_level=None
+
|threat_level=ignored
|function_syntax=void osVolumeDetect(integer detect)
+
|permissions=true
|csharp_syntax=void osVolumeDetect(int detect)
+
|delay=0
 +
|function_syntax= osVolumeDetect(integer detect)
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
// Example of osVolumeDetect
 
// Example of osVolumeDetect
Line 10: Line 11:
 
     state_entry()
 
     state_entry()
 
     {
 
     {
         ...
+
         llSay(0, "Script running");
 +
        osVolumeDetect(TRUE);
 
     }
 
     }
 +
    on_rez(integer hh)
 +
    {
 +
        osVolumeDetect(TRUE);
 +
    }
 +
    collision_start(integer uu)
 +
    {
 +
        llOwnerSay("s");
 +
    }
 +
    collision_end(integer uu)
 +
    {
 +
        llOwnerSay("e");
 +
    }   
 
}
 
}
 +
 
</source>
 
</source>
|description=...
+
|description= If script is on root prim, it is like llVolumeDetect(). On child prims, it will turn just that prim a detector.
|
+
|additional_info= This function was added in 0.9.0.1
 +
Since version 0.9.2.0, llDetectedLinkNumber will return the DETECTOR prim link number even on collision events and not 0 as spec. Our llVolumeDetect does the same now<br>
 +
At current time, this is not persistent (so the on_rez on example)<br>
 +
This is also lost on child prims if physics state changes or on link/unlink. Script must set it again after such changes<br>
 +
Note that like with llVolumeDetect, the name Volume is misleading. Detection will only be by volume on some basic shapes like pure spheres or pure boxes. On other shapes it will only be by surface collisions. What prims will do by volume or surface, depends on the physics engine The name of function llDetectedLinkNumber is also misleading, it returns the detector prim link number, not the detected.
 +
 
 
}}
 
}}

Latest revision as of 06:38, 3 February 2020

osVolumeDetect(integer detect)
If script is on root prim, it is like llVolumeDetect(). On child prims, it will turn just that prim a detector.
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 of osVolumeDetect
 
default
{
    state_entry()
    {
        llSay(0, "Script running");
        osVolumeDetect(TRUE);
    }
    on_rez(integer hh)
    {
        osVolumeDetect(TRUE);
    }
    collision_start(integer uu)
    {
        llOwnerSay("s");
    }
    collision_end(integer uu)
    {
        llOwnerSay("e");
    }    
}
Notes
This function was added in 0.9.0.1

Since version 0.9.2.0, llDetectedLinkNumber will return the DETECTOR prim link number even on collision events and not 0 as spec. Our llVolumeDetect does the same now
At current time, this is not persistent (so the on_rez on example)
This is also lost on child prims if physics state changes or on link/unlink. Script must set it again after such changes
Note that like with llVolumeDetect, the name Volume is misleading. Detection will only be by volume on some basic shapes like pure spheres or pure boxes. On other shapes it will only be by surface collisions. What prims will do by volume or surface, depends on the physics engine The name of function llDetectedLinkNumber is also misleading, it returns the detector prim link number, not the detected.


Personal tools
General
About This Wiki