Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

dance light wont go back to random rotation after calling llTragertOmega

MCM Villiers
Registered User
Join date: 7 Oct 2007
Posts: 39
02-08-2008 11:38
Heres the code and I cant figure out why its doing it
CODE

integer i;
integer rColor = TRUE;
integer rDir = TRUE;
list colorName = ["red", "green", "blue", "aqua", "yellow"];
list colorVec = ["<1,0,0>", "<0,1,0>", "<0,0,1>", "<0,1,1>", "<1,1,0>"];
vector clr = <1,1,1>;
default
{
state_entry()
{
llSetTimerEvent(1);
llListen(100, llKey2Name(llGetOwner()) + "'s Light Control", "", "");
llListen(0, "", "", "");
}
listen(integer c, string n, key id, string m)
{
integer color = llListFindList(colorName, [llToLower(m)]);
if(color != -1)
{
clr = (vector)llList2String(colorVec, color);
rColor = FALSE;
}
else if(llToLower(m) == "rcolor")
{
rColor = TRUE;
}
else if(llToLower(m) == "vspin")
{
llTargetOmega(<1,0,1>, 1, 1);
rDir = FALSE;
}
else if(llToLower(m) == "rotup")
{
llTargetOmega(<1,0,0>, 1, 1);
rDir = FALSE;
}
else if(llToLower(m) == "rotdown")
{
llTargetOmega(<-1,0,0>, 1, 1);
rDir = FALSE;
}
else if(llToLower(m) == "spin")
{
llTargetOmega(<0,0,1>, 1, 1);
rDir = FALSE;
}
else if(llToLower(m) == "rdir")
{
rDir = TRUE;
}
}
timer()
{
if(rDir == TRUE)
{
llLookAt(<llFrand(512), llFrand(512), llFrand(512)>, 2, 2);
}
if(rDir == FALSE)
{
llStopLookAt();
}
if(rColor == TRUE)
{
llSetLinkColor(2, <llFrand(1), llFrand(1), llFrand(1)>, ALL_SIDES);
}
if(rColor == FALSE)
{
llSetLinkColor(2, clr, ALL_SIDES);
}

}
}
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-08-2008 12:16
You might want to turn OFF llTargetOmega() at some point, by doing something like 'llTargetOmega(ZERO_VECTOR, 0.0, 0.1);'