|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-22-2006 02:17
Hello
I have an object with a timer event. It says a sentence. But i want it to says several sentences. How can i do that please.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-22-2006 02:49
From: Yuli Orman Hello
I have an object with a timer event. It says a sentence. But i want it to says several sentences. How can i do that please. Do you mean all at once, sequentially or randomly pick one? i.e. thought for the day type thing? For all at once just add them in. The basic mechanism is similar for both sequentially or randomly picked :- Build a list of sentences to be spoken. Have an index counter to obtain the required sentence, this will either be randomly assigned or sequentially incremented Remember to check for reaching the end of the list. Something like this may be? Code has not been compiled so any errors are newgy-esse! // Dummy List - would probably read from note card? list Sentences = [ "A rolling stone crushes your foot.", "A bird in the hand craps on your fingers.", "Red Sky at night, your barns on fire.", "Red Sky in the morning, your barns still on fire.", "Congratulations you're one day nearer being dead."];
float Interval = 60.0;
integer Index; integer Max = 0;
integer Random = 0; // Set to 1 for random Quotes
SayQuote() { string txt = llList2String(Sentences,Index); llSay(0,txt); }
RandomQuote() { Index = (integer)llFrand(Max); }
SequentialQuote() { if(Index < Max) ++Index; else Index = 0; }
Quote() { if(Random) RandomQuote(); else SequentialQuote(); SayQuote(); }
default { state_entry() { Max = llGetListlength(Sentences); Quote(); llSetTimerEvent(Interval); }
timer() { Quote(); }
}
|
|
Yuli Orman
Registered User
Join date: 4 May 2006
Posts: 20
|
11-22-2006 08:25
Thank you very much
I did that before you reply.
But i cant add some things with your help. Thank you
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-22-2006 08:29
From: Yuli Orman Thank you very much
I did that before you reply.
But i cant add some things with your help. Thank you Your more than welcome. Hopefuly teh code is simple enough to understand but if not feel free to shout. Any problems please post and I will try to answer them as best I can. (And before Jesse or Lauren get there.....  )
|