Difference between revisions of "LlRezObject"

From Second Life Wiki
Jump to: navigation, search
m
m (Undo revision 98883 by Strife Onizuka (Talk))
Line 1: Line 1:
 
{{LSL_Function/inventory|inventory|uuid=false|type=object}}
 
{{LSL_Function/inventory|inventory|uuid=false|type=object}}
 
{{LSL_Function
 
{{LSL_Function
|func_id=104|func_sleep=0.1|func_energy=200.0|func_sleep_note=There is an additional delay based on the mass and velocity of the object rezzed.
+
|func_id=104|func_sleep=0.1|func_energy=200.0
**<code>rez_delay = mass * [[llVecMag|magnitude]](velocity) / 10;</code> [http://forums.secondlife.com/showthread.php?t=82659]
+
 
|func=llRezObject|sort=RezObject
 
|func=llRezObject|sort=RezObject
 
|p1_type=string|p1_name=inventory
 
|p1_type=string|p1_name=inventory
 
|p2_type=vector|p2_name=pos|p2_desc=position (in [[Viewer coordinate frames#Region|region coordinates]])|p2_hover=position (in region coordinates)
 
|p2_type=vector|p2_name=pos|p2_desc=position (in [[Viewer coordinate frames#Region|region coordinates]])|p2_hover=position (in region coordinates)
|p3_type=vector|p3_name=vel|p3_desc=velocity (maximum [[llVecMag|magnitude]] is 250)
+
|p3_type=vector|p3_name=vel|p3_desc=velocity (max [[llVecMag|magnitude]] is 250)
 
|p4_type=rotation|p4_name=rot|p4_desc=rotation
 
|p4_type=rotation|p4_name=rot|p4_desc=rotation
 
|p5_type=integer|p5_name=param|p5_desc=[[on_rez]] event parameter and value returned by [[llGetStartParameter]] in the rezzed object.|p5_hover=on_rez event parameter and value returned by llGetStartParameter in the rezzed object.
 
|p5_type=integer|p5_name=param|p5_desc=[[on_rez]] event parameter and value returned by [[llGetStartParameter]] in the rezzed object.|p5_hover=on_rez event parameter and value returned by llGetStartParameter in the rezzed object.
Line 14: Line 13:
 
|spec
 
|spec
 
|caveats=
 
|caveats=
 +
*In addition to the normal function delay, there is an additional delay based on the mass and velocity of the object rezzed.
 +
**<code>rez_delay = mass * llVecMag(velocity) / 10;</code> [http://forums.secondlife.com/showthread.php?t=82659]
 
*Silently fails to rez '''inventory''' if '''pos''' is more than 10 meters away from the prim trying to rez '''inventory'''.  So if your script is mysteriously failing to rez things, make sure you haven't (say) written "<0,0,1>" for the '''pos''' parameter rather than (say) "llGetPos() + <0,0,1>".
 
*Silently fails to rez '''inventory''' if '''pos''' is more than 10 meters away from the prim trying to rez '''inventory'''.  So if your script is mysteriously failing to rez things, make sure you haven't (say) written "<0,0,1>" for the '''pos''' parameter rather than (say) "llGetPos() + <0,0,1>".
 
* If the owner of the object does not have copy permission  on '''inventory''', the object will no longer be present in inventory after it is rezzed (so another attempt to rez it is likely to fail); if the owner does have copy permission, then a copy is rezzed, and the original '''inventory''' remains in inventory.
 
* If the owner of the object does not have copy permission  on '''inventory''', the object will no longer be present in inventory after it is rezzed (so another attempt to rez it is likely to fail); if the owner does have copy permission, then a copy is rezzed, and the original '''inventory''' remains in inventory.

Revision as of 20:26, 28 October 2008

Summary

Function: llRezObject( string inventory, vector pos, vector vel, rotation rot, integer param );

Instantiate inventory object at pos with velocity vel and rotation rot with start parameter param

• string inventory an object in the inventory of the prim this script is in
• vector pos position (in region coordinates)
• vector vel velocity (max magnitude is 250)
• rotation rot rotation
• integer param on_rez event parameter and value returned by llGetStartParameter in the rezzed object.

The root of inventory is not at pos but the center of inventory is.
To have the root prim at pos use llRezAtRoot instead.

Caveats

  • This function causes the script to sleep for 0.1 seconds.
  • If inventory is missing from the prim's inventory or it is not an object then an error is shouted on DEBUG_CHANNEL.
  • In addition to the normal function delay, there is an additional delay based on the mass and velocity of the object rezzed.
    • rez_delay = mass * llVecMag(velocity) / 10; [1]
  • Silently fails to rez inventory if pos is more than 10 meters away from the prim trying to rez inventory. So if your script is mysteriously failing to rez things, make sure you haven't (say) written "<0,0,1>" for the pos parameter rather than (say) "llGetPos() + <0,0,1>".
  • If the owner of the object does not have copy permission on inventory, the object will no longer be present in inventory after it is rezzed (so another attempt to rez it is likely to fail); if the owner does have copy permission, then a copy is rezzed, and the original inventory remains in inventory.
  • Silently fails if you don't have offline building rights on the land. Which means that you need to either: Own the land yourself. Be in the group that owns it, and the allow group to build parcel flag has to be enabled. Or everyone should be allowed to build. You can also deed the object to the group that owns the land, this will always work.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

    touch_start(integer param)
    {
         llRezObject("Object", llGetPos() + <0.0,0.0,1.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0);
    }
}</lsl>

See Also

Events

•  object_rez triggered when this object rezzes an object from inventory

Functions

•  llRezAtRoot Rezzes the object at the requested position
•  llGetStartParameter
•  llGodLikeRezObject

Deep Notes

Search JIRA for related Issues

Signature

function void llRezObject( string inventory, vector pos, vector vel, rotation rot, integer param );