Jump to content

timing a loop


Tinker Darkbyrd
 Share

You are about to reply to a thread that has been inactive for 2598 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

 

Not sure if my title explains my issue correct,but here is what I need help with.(if any kind soul is willing to offer any :) )

I have a animation system in a HUD im building.

It works off a list and should play the animations in the order of the list with 90 seconds between each animation.

list mehAni = ["ani1","ani2","ani3","ani4"];

the function I made

Play(){

integer number = llGetListLength(mehAni);
integer index;
string name = llList2String(mehAni, index);
while (index < number)
{

llMessageLinked(1,15,"We will now do the "+name+" pose for 90 seconds.","");

llStartAnimation(name);

++index;

}

}

 

I have a timer that will trigger the function at 90 seconds and works fine on the first aniamtion, after that one it loops threw the list super fast with out playing any one the animations only announcing the animations "should" be playing ...but they are not ..it just spits out a list of animation names with out playing them.The timer part im not worried about its how it is indexing the list loop that im having a issue with.it should play each animation for 90 seconds.

Link to comment
Share on other sites

The way to approach that problem is to ditch your user defined function and build its guts into your timer event. Use a global integer variable as a counter that updates each time that the event triggers, and then use its value to grab the next animation from your mehAni list. 

llStartAnimation(llList2String(mehAni,(++gCount)%llGetListLength(mehAni));

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2598 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...