Difference between revisions of "LlRezAtRoot"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{Issues/SVC-3145}}{{LSL_Function/inventory|inventory|uuid=false|type=object}}
{{LSL_Function
{{LSL_Function
|inject-2={{Issues/SVC-3145}}{{LSL_Function/inventory|inventory|uuid=false|type=object}}
|func=llRezAtRoot|func_id=286|func_sleep=0.1|func_energy=200.0
|func=llRezAtRoot|func_id=286|func_sleep=0.1|func_energy=200.0
|p1_type=string|p1_name=inventory
|p1_type=string|p1_name=inventory
Line 7: Line 7:
|p4_type=rotation|p4_name=rot|p4_desc=initial rotation
|p4_type=rotation|p4_name=rot|p4_desc=initial rotation
|p5_type=integer|p5_name=param|p5_desc=[[on_rez]] event parameter and value returned by [[llGetStartParameter]] in the rezzed object (or by each of the items in a coalesced 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 (or by each of the items in a coalesced object).|p5_hover=on_rez event parameter and value returned by llGetStartParameter in the rezzed object.
|func_desc=Instantiate '''inventory''' object rotated to '''rot''' with its root at '''position''', moving at '''velocity''', using '''param''' as the start parameter
|func_desc=Instantiate {{LSLP|inventory}} object rotated to {{LSLP|rot}} with its root at {{LSLP|position}}, moving at {{LSLP|velocity}}, using {{LSLP|param}} as the start parameter
|func_footnote=To rez an object so its [[llGetGeometricCenter|center]] is at '''pos''' (instead of the root) use [[llRezObject]] instead.
|func_footnote=To rez an object so its [[llGetGeometricCenter|center]] is at {{LSLP|position}} (instead of the root) use [[llRezObject]] instead.
|constants
|constants
|spec
|spec
|caveats=
|caveats=
*Silently fails to rez '''inventory''' if '''pos''' is more than 10 meters away from the prim trying to rez '''inventory'''.
*Silently fails to rez {{LSLP|inventory}} if {{LSLP|position}} is more than 10 meters away from the prim trying to rez {{LSLP|inventory}}.
*Silently fails if you don't have offline building rights on the land. To have the right, you need to ''either'':  
*Silently fails if you don't have offline building rights on the land. To have the right, you need to ''either'':  
** Own the land yourself.
** Own the land yourself.

Revision as of 10:33, 7 June 2012

Summary

Function: llRezAtRoot( string inventory, vector position, vector velocity, rotation rot, integer param );
0.1 Forced Delay
200.0 Energy

Instantiate inventory object rotated to rot with its root at position, moving at velocity, using param as the start parameter

• string inventory an object in the inventory of the prim this script is in
• vector position initial position (in region coordinates)
• vector velocity initial velocity
• rotation rot initial rotation
• integer param on_rez event parameter and value returned by llGetStartParameter in the rezzed object (or by each of the items in a coalesced object).

To rez an object so its center is at position (instead of the root) use llRezObject 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.
  • Silently fails to rez inventory if position is more than 10 meters away from the prim trying to rez inventory.
  • Silently fails if you don't have offline building rights on the land. To have the right, you need to either:
    • Own the land yourself.
    • Be in the group that owns it, enable the allow group to build parcel flag, and set the object to group own.
    • Allow everyone to build.
    • Deed the object to the group that owns the land, that will always work.
  • The group role "Always allow 'Create Objects'" will only work to override this when you are online, in the region, or have a child agent in the region. See the issues under Deep Notes for more information.

Examples

<lsl>//Rez an object on touch string object = "Object";//Object in inventory integer start_param = 10; rotation rot;

default {

   state_entry()
   {
       rot = llEuler2Rot(< 0, 90, 90> * DEG_TO_RAD);
   }
   touch_start(integer a)
   {
       vector vec = llGetPos() + < 0.0, 0.0, 5.0>; // 5 meter above this
       vector speed = llGetVel();
       llRezAtRoot(object, vec, speed, rot, start_param);
   }

}</lsl> <lsl>//Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system. string object = "Object"; // Name of object in inventory vector relativePosOffset = <2.0, 0.0, 1.0>; // "Forward" and a little "above" this prim vector relativeVel = <1.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s rotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this prim integer startParam = 10;

default {

   touch_start(integer a)
   {
       vector myPos = llGetPos();
       rotation myRot = llGetRot();
       vector rezPos = myPos+relativePosOffset*myRot;
       vector rezVel = relativeVel*myRot;
       rotation rezRot = relativeRot*myRot;
       llRezAtRoot(object, rezPos, rezVel, rezRot, startParam);
   }
}</lsl>

See Also

Constants

•  PRIM_TEMP_ON_REZ

Events

•  object_rez triggered when this object rezzes an object from inventory

Functions

•  llRezObject
•  llGetStartParameter
•  llGodLikeRezObject

Deep Notes

Signature

function void llRezAtRoot( string inventory, vector position, vector velocity, rotation rot, integer param );