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:
// 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:
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.).