Difference between revisions of "LlRezAtRoot"

From Second Life Wiki
Jump to navigation Jump to search
m
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=llRezAtRoot|sort=RezAtRoot
|func=llRezAtRoot|func_id=286|func_sleep=0.1|func_energy=200.0
|func_id=286|func_sleep=0.1|func_energy=200.0
|func_footnote=Causes a hard delay based on the mass of the object rezzed.<br>
The function-name is a bit unhappy choosen, because one could understand that the rezing will happen on the root prim. In fact the rezing happens at the link center.<BR>
If you want to rez on the root prim use llRezObject().<BR>
This function should be used with llGetRootPos() and not with llGetPos(), last one should be used with llRezObject().
 
|func_desc=Instantiate '''inventory''' object at '''pos''' with velocity '''vel''' and rotation '''rot''' with start parameter '''param'''
|func_footnote
|p1_type=string|p1_name=inventory
|p1_type=string|p1_name=inventory
|p2_type=vector|p2_name=pos|p2_desc=position
|p2_type=vector|p2_name=position|p2_desc=initial position
|p3_type=vector|p3_name=vel|p3_desc=velocity
|p3_type=vector|p3_name=velocity|p3_desc=initial velocity
|p4_type=rotation|p4_name=rot|p4_desc=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]].
|p5_type=integer|p5_name=param|p5_desc=[[on_rez]] event parameter and value returned by [[llGetStartParameter]].
|func_desc=Instantiate '''inventory''' object rotated to '''rot''' with it's root at '''position''', moving at '''velocity''', using '''param''' as the start parameter
|func_footnote=Causes a hard delay based on the mass of the object rezzed.<br>
To rez an object so it's center is at '''pos''' (instead of the root) use [[llRezObject]] instead.
|constants
|constants
|spec
|spec
|caveats
|caveats
|examples=<pre>
|examples=<pre class="lsl">//Rez an object on touch
// lets admit there is a prim inside the root prim and its called ONIZUKA_PRIM
string object = "Object";//Object in inventory
integer start_param = 10;
rotation rot;


vector onizuka_vec = llGetPos() + < 0.0, 0.0, 5.0>; // 5 meter above the link center
default
rotation onizuka_rot = llEuler2Rot(< 0, 90, 90> * DEG_TO_RAD);
{
vector onizuka_speed = llGetVel();
    state_entry()
integer onizuka_start_param = 10;
    {
llRezAtRoot("ONIZUKA_PRIM", onizuka_vec, onizuka_speed, onizuka_rot ,onizuka_start_param);
        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);
    }
}
</pre>
</pre>
|helpers
|helpers

Revision as of 20:03, 20 July 2007

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 it's 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
• vector velocity initial velocity
• rotation rot initial rotation
• integer param on_rez event parameter and value returned by llGetStartParameter.

Causes a hard delay based on the mass of the object rezzed.
To rez an object so it's center is at pos (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.

Examples

//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);
    }
}

See Also

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 );