llRezObjectWithParams
DirectoryllRezObjectWithParams key
- InventoryItem string — Name of object in inventory to instantiate
- Params list — Initial list of parameters to rez the object with
Instantiate InventoryItem object from the prim’s inventory with an initial set of parameters specified in Params.
By default rezzes at the position of the object containing the script, unless REZ_POS is specified.
Returns a key which will be the key of the object when it is successfully rezzed in the world.
key object = llRezObjectWithParams("Object", []);
Specification
Section titled “Specification”Params List
Section titled “Params List”Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
REZ_PARAM
| Start parameter passed into the rezzed object’s on_rez event. May also be read with llGetStartParameter | ||||||||||||||||||
REZ_PARAM_STRING
| Pass an initialization string to the root prim of the newly rezzed object that may be read with llGetStartString from within the rezzed object. Maximum string length is 1024 bytes. | ||||||||||||||||||
REZ_FLAGS
| Flags applied to rezzed object when it is created in the world. REZ_FLAGS_*
| ||||||||||||||||||
REZ_POS
| Position to rez the new object in the world. If relative is TRUE the position will be relative to the rezzer, otherwise in absolute region coordinates. If at_root is TRUE the root prim of the rezzed object will be placed at position (like llRezAtRoot), otherwise the center of the object will be placed at position (like llRezObject). | ||||||||||||||||||
REZ_ROT
| The initial rotation to apply to the object. If relative is TRUE, the rotation is relative to the rezzing object, otherwise it is absolute. | ||||||||||||||||||
REZ_VEL
| The initial velocity to apply to the object. If local is TRUE the velocity is in the local object coordinate frame, otherwise it is in world coordinates. If inherit is TRUE the object also inherits it’s rezzer’s velocity. | ||||||||||||||||||
REZ_ACCEL
| A constant force to apply to the object. If local is TRUE, the force vector is in local coordinates, otherwise it is in world coordinates. | ||||||||||||||||||
REZ_OMEGA
| Spin the object around the specified axis. If local is TRUE that axis is in local coordinates, otherwise they are global. | ||||||||||||||||||
REZ_LOCK_AXES
| Prevent the object from spinning on certain axes. Setting the vector’s coordinate to non-zero will prevent the object from spinning on that axis. For instance
| ||||||||||||||||||
REZ_DAMAGE
| The amount of damage applied to an agent upon collision with this object. | ||||||||||||||||||
REZ_DAMAGE_TYPE
| The damage type to apply when this prim collides with another object. Can match one of the DAMAGE_TYPE_* constants, be a custom damage type or repurpose the damage field. | ||||||||||||||||||
REZ_SOUND
| A sound to attach to this object. It will be played at the specified volume. The sound parameter may be either a sound file in the rezzer’s inventory or the UUID of a sound asset. If loop is TRUE the sound will loop continuously for the life of the object. | ||||||||||||||||||
REZ_SOUND_COLLIDE
| A sound to play upon collision with another object, the ground or an avatar. The sound parameter may be either a sound file in the rezzer’s inventory or the UUID of a sound asset. |
Caveats
Section titled “Caveats”- This function causes the script to sleep at least for s and uses0.1energy — this energy deficiency can cause scripts across the entire linkset to skip for two sim frames (200.0s)0.022
- In practice, using multiple scripts, it is possible to reach a maximum object creation speed of ~900 objects per minute per object, however with an active
control
event (user is constantly giving control input) this can be exceeded to double that amount - Mind that there are some dynamic limits in place that are designed to prevent griefing
- In practice, using multiple scripts, it is possible to reach a maximum object creation speed of ~900 objects per minute per object, however with an active
- If InventoryItem 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 InventoryItem if REZ_POS is too far from the geometric center of the object trying to rez InventoryItem — at least 10 meters or up to 10.0-0.00001 + (llVecMag(llGetScale()) * 0.5)
- When scripting attachments meant to rez objects, remember that when used in the root of an attachment llGetPos doesn’t return the position of the attachment but instead returns the position of the avatar’s bounding box geometric center. Read llGetPos and llParticleSystem Caveats for more information
- If the object is unattached and the owner of the object does not have copy permission on InventoryItem, the object will no longer be present in inventory after it is rezzed (so another attempt to rez (the same object) will fail); if the owner does have copy permission, then a copy is rezzed, and the original InventoryItem remains in inventory
- If the object is attached and the owner of the object does not have copy permission on InventoryItem, an error is shouted on DEBUG_CHANNEL: “Cannot rez no copy objects from an attached object.”
- Silently fails if you don’t have offline building rights on the land. To have the right, your objects needs to either:
- Be on land you own yourself
- Be on land where anyone is allowed to build, e.g. a sandbox
- Be deeded to the group that owns the land
- Be set to the same group that owns the land and the land have the parcel flag ‘allow group to build’ set
- 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
Examples
Section titled “Examples”The list of parameters is entirely optional. If you want to rez an object exactly where the rezzer is, you may call the function with an empty list
default{ touch_start(integer total_number) { llRezObjectWithParams("Object", []); }}
The below example rezzes an object slightly above the rezzer, slowly spinning and with automatic cleanup
default{ touch_start(integer total_number) { llRezObjectWithParams("Object", [ REZ_POS, <0,0,1>, TRUE, TRUE, REZ_OMEGA, <0,0,1>, TRUE, 0.5, PI, REZ_FLAGS, REZ_FLAG_TEMP ]); }}