Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Offset Reporter - Track changes to a prim's position and rotation

Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
10-22-2006 07:08
The following script can be dropped into a prim to report changes to it's position and rotation. This works consistantly whether the item is rezzed from inventory, or from an object which rezzes the prim already rotated.

CODE

// Offset Reporter
// Version 1.0
// Copyright 2006 Domino Marama

vector start_pos;
rotation start_rot;
rotation current_rot;

say_offset() {
llOwnerSay("/me's offset is:\n" + (string) ((llGetPos() - start_pos) / start_rot) \
+ "|" + (string)((<0.0,0.0,0.0,1.0> / start_rot) * current_rot));
}

default
{
on_rez(integer start_param) {
llSetTimerEvent(5);
start_pos = llGetPos();
start_rot = llGetRot();
current_rot = start_rot;
}

moving_end()
{
say_offset();
}

timer()
{
rotation r = llGetRot();
if (r != current_rot) {
current_rot = r;
say_offset();
}
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
10-22-2006 21:01
/15/8a/144806/1.html
_____________________
i've got nothing. ;)