LlTriggerSoundLimited

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
Function: llTriggerSoundLimited( string sound, float volume, vector top_north_east, vector bottom_south_west );
参数:以音量播放声音,以对象为中心但不附着在对象上,仅限于矢量top_north_east和bottom_south_west定义的框

•字符串声音–此脚本所在的prim目录中的声音或声音的UUID

•浮子音量–介于0.0(无声)和1.0(响亮)之间(0.0<=音量<=1.0)

•vector top峎northïeast–区域坐标中的位置

•矢量底部南ė西–区域坐标位置

如果物体移动,声音就不会随之移动。 使用llPlaySound播放附加到对象的声音。

返回值:无
注意事项
如果prim的清单中缺少声音,并且它不是UUID或者不是声音,那么在DEBUG峈CHANNEL上会发出一个错误。

如果sound是一个UUID,那么对象没有新的资产权限后果。 生成的对象不会产生新的使用限制,如果资产被放在prims库存中,可能会出现这种情况。 如果脚本已附加,并且包裹的头像声音关闭,则调试频道上会出现一个错误:“声音触发器太多。”

示例
示例1
/*
    Single Prim llTriggerSoundLimited Helper by Daemonika Nightfire.
 
    Just use this script in a single prim and make the prim as big as your room.
    If you then click on the prim, the sound will only be triggered inside and you will get a message with a finished LSL code.
    You can simply copy this code to the clipboard and use it in your actual script.
 
    Important:
    You cannot rotate the prim, the code needs global coordinates.
*/
 
string sound = "c704dbd8-53b1-246d-e197-b486e92da45b"; // use here your own sound uuid
 
////////// nothing to do below this line \\\\\\\\\\
default
{
    state_entry()
    {
        llSetStatus(STATUS_PHANTOM, TRUE);
        llSetRot(ZERO_ROTATION);
    }
 
    touch_start(integer total_number)
    {
        llSetRot(ZERO_ROTATION);
        vector my_pos = llGetPos();
        vector my_scale = llGetScale();
 
        float _X = my_scale.x/2;
        float _Y = my_scale.y/2;
        float _Z = my_scale.z/2;
 
        vector bottom_south_west = <my_pos.x - _X, my_pos.y - _Y, my_pos.z - _Z>;
        vector top_north_east    = <my_pos.x + _X, my_pos.y + _Y, my_pos.z + _Z>;
 
        llTriggerSoundLimited(sound, 1.0, top_north_east, bottom_south_west);
 
        llOwnerSay("\nllTriggerSoundLimited(\"" + sound + "\", 1.0, " + (string)top_north_east + ", " + (string)bottom_south_west + ");");
    }
 
    on_rez(integer Dae)
    {
        llResetScript();
    }
}

相关函数
llPlaySound

llTriggerSound

相关事件