Rezzer

Written by: Headmaster

 

Written by Innula Zenovka

 

To make this work, set up the rezzer at whatever rotation you want, and place the object you want to rez at the correct relative position. You can either then read their respective positions and rotations by dropping the following simple script into each one and copy-pasting the results into the main script, or, if prefer, you can just read the numbers from the rotation boxes in the prims' edit windows and let the script convert the vector to rotation. 

Either way, enter them in the rezzer script, and there you are.

 

 

//Sample rezzer script by Innula Zenovka Jan 27 2010
// released under the "do what the hell you want with it" licence

vector rezzer_pos = <68.4949, 151.2232, 25.6000>;  // the position of the rezzer when first you set it up
rotation rezzer_rot; // you could read the rotation by script, enter it here and comment out the next line
vector rezzer_rot_window = <180.05,0.00,52.00>;  // the numbers in the rotation box in the edit window

vector child_pos = <133.67170, 156.75260, 1751.52900> ; // the position of the rezzed object at first set up
rotation child_rot;// you could read the rotation by script, enter it here and comment out the next line
vector child_rot_window =<320.25,11.05,257.00>;// the numbers in the rotation box in the edit window

vector offset;
default
{
    state_entry()
    {
        
        rezzer_rot = llEuler2Rot(rezzer_rot_window*DEG_TO_RAD); 
        // you could comment this out and use the following line, to which it is equivalent
        // rezzer_rot = <-0.50000, -0.50000, 0.50000, 0.50000>;
        child_rot = llEuler2Rot(child_rot_window*DEG_TO_RAD);
         // you could comment this out and use the following line, to which it is equivalent
        //child_rot =<0.27363, 0.39548, 0.12470, 0.86785>;
        offset = offset/rezzer_rot;
    }

    touch_start(integer total_number)
    {
        llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT,0),
        llGetPos()+offset*llGetRot(),
        ZERO_VECTOR,
        (child_rot/rezzer_rot)*llGetRot(), 
        99);
    }
}

 

 

The Helper Script:

 

//reads position and rotation
default
{
    state_entry()
    {
        llOwnerSay((string)llGetPos()+" "+(string)llGetRot());
        llRemoveInventory(llGetScriptName());
    }

  
}

 

 

 

Category: