Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Disable rotation in a script?

Nyx Divine
never say never!
Join date: 11 Dec 2004
Posts: 1,052
05-08-2006 11:56
Ok I have a script for a holo vendor and would like to 'disable' the rotation of the item that is on temp rezz for display. I have tinkered around a 'wee bit' w/ some scripts to change this or that but am unsure how to disable rotation in this script.

Any takers? I'm sure it'll be a piece of cake for most of you :D


//If your vendor sets things up in an unsuitable position or rotation when testing it you can adjust the rotation and position of individual items using this script. Move the item into position and then touch it - this will say the position (only for you) and rotation and you can replace the default entries in the next two lines. Simply copy the lines from the chat history one at a time, paste them into this script to replace the two lines and go from there! You'll have to take the object's name off the front up to and including the colon(:), but you can simply cut and paste the rest.

rotation rot=ZERO_ROTATION;
vector position=ZERO_VECTOR;


string commandDerez = "derez";
integer commChannel;
vector startPos;

default {
state_entry()
{
llTargetOmega(<0,0,1>,0.2,1.0);
llSetPrimitiveParams([PRIM_TEMP_ON_REZ, TRUE, PRIM_PHYSICS, FALSE, PRIM_PHANTOM, TRUE]);
startPos=llGetPos();
}

on_rez(integer startParam)
{
commChannel = startParam;
startPos=llGetPos();
llSetRot(rot);
llSetPos(position+startPos);
llListen(commChannel, "", NULL_KEY, commandDerez);
}

listen(integer channel, string name, key id, string message)
{
llDie();
}
touch_start(integer times)
{
if(llDetectedKey(0)==llGetOwner())
{
llOwnerSay("rotation rot="+(string)llGetRot()+";";);
llOwnerSay("vector position="+(string)(llGetPos()-startPos)+";";);
}
}
}
_____________________
Yes Virginia there is an FIC!

If someone shows you who they are.....believe them!

Don't be afraid to go out on a limb, because that's where the fruit is!
Teddy Wishbringer
Snuggly Bear Cub
Join date: 28 Nov 2004
Posts: 208
05-08-2006 12:44
Remove the llTargetOmega() function at the top of State Entry if you want to stop it from rotating continuously.