Difference between revisions of "LlRezObject"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> example)
Line 15: Line 15:
*In addition to the normal function delay, there is an additional delay based on the mass and velocity of the object rezzed.
*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]
**<code>rez_delay = mass * llVecMag(velocity) / 10;</code> [http://forums.secondlife.com/showthread.php?t=82659]
*Rot function have 4 number to rotate the rezz object like this one <0.0,0.0,0.0,1.0> on the Z axix , Y axis and X axis. It depend where the number is place on the coordinate parentesis. Negative number is require and no number up to 1. If you have one tin sqare, the first two digits rezz the object up side down your sqare horizontaly.The coordinate <1,1,0,0> rezz the objet up side down but in the same direction of the primitive that rezz the object whit no Z rotation axis. If <1,0,0,0> the object turn 90 degree left. If <1,.5,0,0> the object is rezz 45 degree up side down left side.If <0,0,1,1> the object is the correctly whit no rotation.<0,0,1,.5> the object is rezz 45 degree rotation  on right side on Z axis. Where that become complicated is when the number 1 or 1< is on two seperate place like this one <0,1,0,1>. In this position the coordinate rezz the object on the X axis or if you prefer rotate before you see it on the X axis.  rezz the tin sqare veticaly point on left side and rotate It on the X axis. If you put <1,0,1,0> the tin plate rotate 180 degree on the X axis point on left.So if coordinate is negative <0,-1,0,-1>. The sqare point to the right direction.<-1,0,-1,0> point to the left.
*Silently fails to rez '''inventory''' if '''pos''' is more than 10 meters away.  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.  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.
*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.
*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.|constants
|constants
 
 
|examples=<lsl>default
|examples=<lsl>default
{
{
Line 35: Line 37:
{{LSL DefineRow||[[object_rez]]|triggered when this object rezzes an object from inventory}}
{{LSL DefineRow||[[object_rez]]|triggered when this object rezzes an object from inventory}}
|also_articles
|also_articles
|note_rotation=
|notes
|notes
|permission
|permission

Revision as of 17:21, 31 July 2008

Summary

Function: llRezObject( string inventory, vector pos, vector vel, rotation rot, integer param );
0.1 Forced Delay
200.0 Energy

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]
  • Rot function have 4 number to rotate the rezz object like this one <0.0,0.0,0.0,1.0> on the Z axix , Y axis and X axis. It depend where the number is place on the coordinate parentesis. Negative number is require and no number up to 1. If you have one tin sqare, the first two digits rezz the object up side down your sqare horizontaly.The coordinate <1,1,0,0> rezz the objet up side down but in the same direction of the primitive that rezz the object whit no Z rotation axis. If <1,0,0,0> the object turn 90 degree left. If <1,.5,0,0> the object is rezz 45 degree up side down left side.If <0,0,1,1> the object is the correctly whit no rotation.<0,0,1,.5> the object is rezz 45 degree rotation on right side on Z axis. Where that become complicated is when the number 1 or 1< is on two seperate place like this one <0,1,0,1>. In this position the coordinate rezz the object on the X axis or if you prefer rotate before you see it on the X axis. rezz the tin sqare veticaly point on left side and rotate It on the X axis. If you put <1,0,1,0> the tin plate rotate 180 degree on the X axis point on left.So if coordinate is negative <0,-1,0,-1>. The sqare point to the right direction.<-1,0,-1,0> point to the left.
  • Silently fails to rez inventory if pos is more than 10 meters away. 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.

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

Signature

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