PDA

View Full Version : Randomizing the say2 command?


LoneAngelIbesu
07-19-2007, 10:44 PM
How would I go about randomizing the phrases outputted by the say2 command?

xXziroXx
07-19-2007, 10:51 PM
A quick and simple example:


//#CLIENTSIDE
function onCreated()
{
this.texts = {
"This is a text!",
"Guess what this is? :D"
};
say2(this.texts[int(random(0, this.texts.size() + 1))]);
}


Hopefully you'll be able to take it from there on your own. :)

Skyld
07-19-2007, 10:52 PM
say2(randomstring(this.texts));
... would be faster for the new engine, but since we're talking the old engine here:

if (created)
{
say2 #R(first string,second string,third string);
}

LoneAngelIbesu
07-19-2007, 11:37 PM
They really should've put things like that in the commands file. Thanks a lot, Skyld. Yeah, the old-engine is still used on Valikorlia.

xXziroXx
07-20-2007, 05:24 AM
say2(randomstring(this.texts));
... would be faster for the new engine, but since we're talking the old engine here:

if (created)
{
say2 #R(first string,second string,third string);
}

Oh right, the randomstring() command - kinda forgott about that one, I've yet to use it in a script.

And I didn't know you wanted it in GS1, buuuut since it's posted in "Old Scripting Engine" I should have payed slightly more attention ^^

You could also do:

if (created) {
setstring this.stringlist,first string,second string,third string;
say2 #R(#s(this.stringlist));
}

Whatever appeals you the most. :)

cbk1994
07-20-2007, 06:00 PM
You could also do:

if (created) {
setstring this.stringlist,first string,second string,third string;
say2 #R(#s(this.stringlist));
}

Whatever appeals you the most. :)

Can you really?

I tried something like that, and it said that it didn't take a single string, or such.

GS1 makes no sense :(

It's a weird mix of a conditional language, and a function language :/

Inverness
07-20-2007, 07:07 PM
GS1 should be removed from the face of Graal in its entirety. Can't believe Val is still GS1 after so long, its a travesty and a supreme irritation.

xXziroXx
07-21-2007, 03:12 AM
Can you really?

Yes. I used it several times on Maloria. :)

Horrified
09-01-2007, 01:10 AM
GS1 should be removed from the face of Graal in its entirety. Can't believe Val is still GS1 after so long, its a travesty and a supreme irritation.

these words deserve an agreed.

Crow
09-01-2007, 03:14 PM
these words deserve an agreed.

Old thread is old.