llStartObjectAnimation() & llStopObjectAnimation() does not visually work on Viewer 26.3
Lucia Nightfire
llStartObjectAnimation() & llStopObjectAnimation() does not visually work on Viewer 26.3
Tested with the following script:
I_C()
{
llSetTimerEvent(0.0);
llListenRemove(o_listen);
while(o_channel == lo_channel)
{
o_channel = -((integer)llFrand(1000000000.0) + 1000000000);
}
o_listen = llListen(lo_channel = o_channel,"",owner,"");
llSetTimerEvent(300.0);
}
Target_Dialog_Handling()
{
if (t_count)
{
llMessageLinked(LINK_ALL_OTHERS,0,"#close_dialog","");
list T = llGetObjectAnimationNames();
integer i;
integer t = llList2Integer([t_count,10],t_count > 12);
string display = "Select an animation...\n ";
string a;
for (; i < t; i++)
{
if ((t_count > 12) && i && !((t_index + i) % t_count))
{
display += "\n---end/start---";
}
a = llGetInventoryName(INVENTORY_ANIMATION,(t_index + i) % t_count);
display += ("\n" + llList2String([">"," "],llListFindList(T,[a]) == -1) + llList2String(LETTERS,i) + ") " + a);
}
I_C();
if (t_count > 12)
{
llDialog(owner,llGetSubString(display,0,510),["J","<<",">>","G","H","I","D","E","F","A","B","C"],o_channel);
}
else
{
list BUTTONS = llList2List(LETTERS,0,t_count - 1) + llDeleteSubList([" "," "," "],0,((t_count < 3) * 2) + llList2Integer([2,0,1],t_count % 3));
for (i = 0; i < (llCeil(t_count / 3.0) * 3); i+=3)
{
BUTTONS = llListInsertList(llDeleteSubList(BUTTONS,-3,-1),llList2List(BUTTONS,-3,-1),i);
}
llDialog(owner,llGetSubString(display,0,510),BUTTONS,o_channel);
}
}
else
{
llOwnerSay("No animations found in inventory.");
}
}
Display()
{
list A;
list T;
integer i;
for (i = -llGetListLength(T = llGetObjectAnimationNames()); i < 0; i++)
{
if (llGetInventoryType(llList2String(T,i)) == INVENTORY_ANIMATION)
{
A = (A = []) + A + [llList2String(T,i)];
}
}
llSetText(llDumpList2String(A,"\n"),<1.0,1.0,1.0>,1.0);
}
key owner = NULL_KEY;
integer o_listen;
integer o_channel;
integer lo_channel;
integer t_index;
integer t_count;
integer d_text;
list LETTERS = ["A","B","C","D","E","F","G","H","I","J","K","L"];
default
{
state_entry()
{
owner = llGetOwner();
if (d_text = (integer)llList2String(llParseStringKeepNulls(llToLower(llGetScriptName()),["text="],[]),1))
{
Display();
}
}
on_rez(integer i)
{
llResetScript();
}
touch_end(integer i)
{
if (llDetectedKey(0) == owner)
{
t_count = llGetInventoryNumber(INVENTORY_ANIMATION);
t_index = 0;
Target_Dialog_Handling();
}
}
listen(integer i, string name, key k, string message)
{
llSetTimerEvent(0.0);
llListenRemove(o_listen);
if ((t_count > 12) && ~(i = llListFindList(["<<",">>"],[message])))
{
t_index = llList2Integer([(t_count + (t_index - 10)) % t_count,(t_index + 10) % t_count],i);
Target_Dialog_Handling();
}
else if ((i < t_count) && ~(i = llListFindList(LETTERS,[message])))
{
string a = llGetInventoryName(INVENTORY_ANIMATION,(t_index + i) % t_count);
if (~llListFindList(llGetObjectAnimationNames(),[a]))
{
llStopObjectAnimation(a);
llOwnerSay(llList2String(["'" + a + "' could NOT be stopped...","Stopping '" + a + "'..."],llListFindList(llGetObjectAnimationNames(),[a]) == -1));
}
else
{
llStartObjectAnimation(a);
llOwnerSay(llList2String(["Starting '" + a + "'...","'" + a + "' could NOT be started..."],llListFindList(llGetObjectAnimationNames(),[a]) == -1));
}
if (d_text)
{
Display();
}
Target_Dialog_Handling();
}
}
link_message(integer i, integer ii, string message, key k)
{
if (message == "#close_dialog")
{
llSetTimerEvent(0.0);
llListenRemove(o_listen);
}
}
timer()
{
llSetTimerEvent(0.0);
llListenRemove(o_listen);
llOwnerSay("Your use period has expired.");
}
}
llGetObjectAnimationNames() sees animations start/stop, but Developer > Avatar > Animation Info does not.
Teleporting out of the region, waiting for a few minutes then teleporting back shows the character correctly.
Log In
Jellyfish
Can you simplify this script a bit? I spent a bit of time trying to dig into what it's doing to force it to fail, but it has so many branches I'm not sure if the problem you describe is happening or if the script might just be having problems.