Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Arg Local llRezObject

Rebecca Naidoo
Registered User
Join date: 28 May 2008
Posts: 82
08-27-2008 07:27
Hi.

I'm trying to get an object to rezz from an internal linked object, whitch works fine, but works off the worlds axis and not the object that rezzes axis.

How can I make llRezzObject work off the local and not world axis.
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
08-27-2008 08:12
If I understand you correctly, you basically want to specify a position and rotation *relative* to the object doing the rezzing?

That's definitely possible... I had to program the exact same thing for the Sloodle project. Here's the rezzing function I made:

CODE

// Rez the named inventory item
sloodle_rez_inventory(string name, integer password, vector pos, rotation rot)
{
// Check that the item exists (and is an object)
if (llGetInventoryType(name) != INVENTORY_OBJECT) return;
// Attempt to rez the item relative to the root of this object
llRezObject(name, llGetRootPosition() + (pos * llGetRootRotation()), ZERO_VECTOR, rot * llGetRootRotation(), password);
}


You can ignore the "password" part (it's just a rez parameter, so set it to 0 or whatever). The three important parameters are:

- name = the name of the object to rez from inventory
- pos = the position for the object, relative to the rezzer
- rot = the rotation of the object, relative to the rezzer

For example, lets say I wanted my script to rez a chair object 2 metres (local) right of the rezzer, at default rotation, I'd do this:

CODE

sloodle_rez_inventory("chair", 0, <2.0, 0.0, 0.0>, ZERO_ROTATION);


You could easily add in an extra parameter to specify initial velocity too if you wanted. Note that the function will silently fail if you try to a rez an item that isn't in its inventory, or an item that isn't an object (e.g. texture, notecard etc.).