“LlCreateLink”的版本间的差异
|  (创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}   {{函数详情 |函数名 = Function:llCreateLink( key target, integer parent ); |参数= 参数…”) | |||
| 第62行: | 第62行: | ||
| [[changed]]-CHANGED LINK | [[changed]]-CHANGED LINK | ||
| − | |||
| − | |||
| − | |||
| − | |||
| }} | }} | ||
2020年5月17日 (日) 08:10的版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials | 
| 函数名 | 
|---|
| Function:llCreateLink( key target, integer parent ); | 
| 参数: •key target – prim UUID that is in the same region • integer parent – If FALSE, then target becomes the root. If TRUE, then the script's object becomes the root. | 
| 返回值:试图将脚本的对象与目标连接起来 | 
| 注意事项 | 
|---|
| 这个函数使脚本休眠1.0秒。 Permissions 不依赖于权限的自动授予状态。 总是使用运行时权限事件。 如果脚本缺少权限更改链接,脚本将在调试通道上喊出一个错误,操作失败(但脚本继续运行)。 如果权限更改链接是由所有者以外的任何人授予的,那么当函数被调用时,将在调试通道上呼叫一个错误。 一旦权限变更链接权限被授予,除了从脚本内部(例如,新的 llrequestpermission call)或脚本被重置或删除之外,没有其他方法来撤销它。 如果对象或目标不可修改或者拥有不同的所有者,则在调试通道中喊出错误。 如果父对象和目标之间的距离太远,它们将无法进行链接。最大距离在这里进一步解释: 链接性规则如果从附件中的脚本调用,这个函数将无声地失败. | 
| 示例 | 
|---|
| // Rez an object and link it as a child prim.
string ObjectName = "Object Name Here";
// NOTE: must be a name of an object in this object's inventory.
 
default
{
    touch_start(integer count)
    {
        // When the object is touched, make sure we can do this before trying.
        llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
    }
    run_time_permissions(integer perm)
    {
        // Only bother rezzing the object if will be able to link it.
        if (perm & PERMISSION_CHANGE_LINKS)
            llRezObject(ObjectName, llGetPos() + <0,0,0.5>, ZERO_VECTOR, llGetRot(), 0);
        else
            llOwnerSay("Sorry, we can't link.");
    }
    object_rez(key id)
    {
        // NOTE: under some conditions, this could fail to work.
        // This is the parent object.  Create a link to the newly-created child.
        llCreateLink(id, TRUE);
    }
}
 | 
| 相关函数 | 
|---|
| llGetPermissions-获得许可 llGetPermissionsKey-找到授予许可的探员 llRequestPermissions-请求权限 llBreakLink-断开连接 llBreakAllLinks-断开所有连接 | 
| 相关事件 | 
|---|
| run time permissions-允许接收事件 changed-CHANGED LINK | 
