Difference between revisions of "Object rez"

From Second Life Wiki
Jump to navigation Jump to search
m
(15 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Issues/SVC-2926}}{{Issues/SVC-3421}}{{LSL_Event|event_id=28|event_delay|event=object_rez
{{LSL_Event|event_id=28|event_delay|event=object_rez
|inject-2={{Issues/SVC-2926}}{{Issues/SVC-3421}}
|p1_type=key|p1_name=id|p1_desc=[[UUID]] of object rezzed.
|p1_type=key|p1_name=id|p1_desc=[[UUID]] of object rezzed.
|event_desc=Triggered when the object rezzes an object.
|event_desc=Triggered when the object rezzes an object.
|constants
|constants
|spec
|spec
|caveats=*The event is triggered in all implementing scripts within the prim. It is not restricted to the script that called [[llRezObject]] or [[llRezAtRoot]] but it is restricted to the child prim of the object where the call was made.
|caveats=
* Triggers in all running scripts with an [[object_rez]] event, AND in the same '''prim''' as the script calling [[llRezObject]] or [[llRezAtRoot]].
** Does NOT trigger in linked prims.
* A message sent to the rezzed object may arrive before the object has opened a channel and is ready to receive it unless you either (1) include a brief delay ( llSleep(0.2) ) in the object_rez event or (2) provide for a communication handshake between the rezzer and the new object.
|examples=
|examples=
<lsl>
<source lang="lsl2">
//gives inventory to object when it rezzes.
//gives inventory to object when it rezzes.
string inventory;
string inventory;
Line 24: Line 28:
     }
     }
}
}
</lsl>
</source>
|helpers
|helpers
|also_header
|also_header

Revision as of 08:00, 13 July 2015

Description

Event: object_rez( key id ){ ; }

Triggered when the object rezzes an object.

• key id UUID of object rezzed.

Caveats

  • Triggers in all running scripts with an object_rez event, AND in the same prim as the script calling llRezObject or llRezAtRoot.
    • Does NOT trigger in linked prims.
  • A message sent to the rezzed object may arrive before the object has opened a channel and is ready to receive it unless you either (1) include a brief delay ( llSleep(0.2) ) in the object_rez event or (2) provide for a communication handshake between the rezzer and the new object.
All Issues ~ Search JIRA for related Bugs

Examples

//gives inventory to object when it rezzes.
string inventory;
string object;

default
{
    touch_start(integer count)
    {
        object=llGetInventoryName(INVENTORY_OBJECT,0);  //get name of the 1st object in inventory
        llRezObject(object, llGetPos() + <0.0, 0.0, 0.5>, ZERO_VECTOR, ZERO_ROTATION, 0);  //rez the 1st object
    }
    object_rez(key id)
    {
        inventory=llGetInventoryName(INVENTORY_OBJECT,1);  //get name of the 2nd object in inventory
        llGiveInventory(id,inventory);  //give 2nd object to 1st object when rezzed
    }
}

See Also

Events

•  on_rez Triggered when the object the script is in is rezzed

Functions

•  llRezObject Used to rez an object at the center of mass
•  llRezAtRoot Used to rez an object at the root

Deep Notes

Issues

All Issues

~ Search JIRA for related Issues
   object_rez() erroneously triggers on full parcel
   Possible Mono bug with object_rez

Signature

event void object_rez( key id );