OsCollisionSound

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created page with "{{osslfunc |threat_level=None |delay=1 |function_syntax=void osCollisionSound(string impact_sound, double impact_volume) |ossl_example=<source lang="lsl"> </source> |descripti...")
 
m
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
|threat_level=None
+
|threat_level=ignored
|delay=1
+
|permissions=true
|function_syntax=void osCollisionSound(string impact_sound, double impact_volume)
+
|delay=0
 +
|function_syntax= osCollisionSound(string impact_sound, float impact_volume)
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 +
//
 +
// osCollisionSound Script Example
 +
//
 +
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        string impact_sound = llGetInventoryName(INVENTORY_SOUND, 0);
 +
 +
        if (impact_sound == "")
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Inventory sound missing ...");
 +
        }
 +
 +
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Collide this object to hear osCollisionSound running.");
 +
            osCollisionSound(impact_sound, 1.0);
 +
        }
 +
    }
 +
}
 
</source>
 
</source>
|description=Set collision sound to impact_sound with specified volume.
+
'''And with uuid:'''
|
+
<source lang="lsl">
}}
+
//
 +
// osCollisionSound Script Example
 +
//
 +
 
 +
// Can be sound's name in object's inventory or the sound uuid
 +
string impact_sound = "ed124764-705d-d497-167a-182cd9fa2e6c";
 +
 
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        if (osIsUUID(impact_sound))
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Collide this object to hear osCollisionSound running.");
 +
            osCollisionSound(impact_sound, 1.0);
 +
        }
 +
 +
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Invalid uuid detected ...");
 +
        }
 +
    }
 +
}
 +
</source>
 +
|description=Sets collision sound to impact_sound with specified volume.
 +
|additional_info=This function was added in 0.9.0.1}}

Latest revision as of 13:36, 27 November 2020

osCollisionSound(string impact_sound, float impact_volume)
Sets collision sound to impact_sound with specified volume.
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)
//
// osCollisionSound Script Example
//
 
default
{
    state_entry()
    {
        string impact_sound = llGetInventoryName(INVENTORY_SOUND, 0);
 
        if (impact_sound == "")
        {
            llSay(PUBLIC_CHANNEL, "Inventory sound missing ...");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Collide this object to hear osCollisionSound running.");
            osCollisionSound(impact_sound, 1.0);
        }
    }
}

And with uuid:

//
// osCollisionSound Script Example
//
 
// Can be sound's name in object's inventory or the sound uuid
string impact_sound = "ed124764-705d-d497-167a-182cd9fa2e6c";
 
default
{
    state_entry()
    {
        if (osIsUUID(impact_sound))
        {
            llSay(PUBLIC_CHANNEL, "Collide this object to hear osCollisionSound running.");
            osCollisionSound(impact_sound, 1.0);
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Invalid uuid detected ...");
        }
    }
}
Notes
This function was added in 0.9.0.1


Personal tools
General
About This Wiki