Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llListrandmize on wiki?

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
05-29-2008 18:04
here is what it has on wiki for a example but it dosent work :P

CODE

list dice = ["2", "4", "1", "6", "3", "5"];
list shuffled = llListRandomize(dice, 1); // error after llListRandomize

default
{
touch_start(integer touchy)
{
llOwnerSay(llList2CSV(shuffled));
}
}


i added the default stuff didnt have that >.>
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
05-29-2008 19:00
Naughty, naughty! You can't execute a function outside of a state like that :D
Also there is no need to create another list with this function.

CODE
list dice = ["2", "4", "1", "6", "3", "5"];

default
{
touch_start(integer touchy)
{
dice = llListRandomize(dice, 1);
llOwnerSay(llList2String(dice,0));//returns 1st number in list
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
05-29-2008 19:03
i didnt write it so dont yell at me XD

yell at whoever did this in wiki lol
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
05-30-2008 01:04
From: Mrc Homewood
i didnt write it so dont yell at me XD

yell at whoever did this in wiki lol

i added the default stuff didnt have that >.>


Ummm? If you added the default statement then you did indeed write it. It sounds like the wiki only had an example of the function call not an actual working script. Not that it really matters, just thought I'd chime in.
_____________________
Ravanne's Dance Poles and Animations

Available at my Superstore and Showroom on Insula de Somni
http://slurl.com/secondlife/Insula de Somni/94/194/27/
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
05-30-2008 01:18
Yes some of the examples on the wiki aren't in complete script form. Do you think we should change that?

On a related note, do people want Examples on the constant pages? I'm going to be making some (minor) changes to the constant template and I'm wondering if the Examples section should be mandatory like it is on the function pages.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Sean Martin
Yesnomaybe.
Join date: 13 Sep 2005
Posts: 584
05-30-2008 03:54
From: Strife Onizuka
Yes some of the examples on the wiki aren't in complete script form. Do you think we should change that?

On a related note, do people want Examples on the constant pages? I'm going to be making some (minor) changes to the constant template and I'm wondering if the Examples section should be mandatory like it is on the function pages.


Would be nice to have an example for just about everything.
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
05-30-2008 07:42
From: Strife Onizuka
Yes some of the examples on the wiki aren't in complete script form. Do you think we should change that?

Absolutely not. Snippits showing concise, useful examples of a particular topic are much better than a junk script written around the examples that 1.) you have to dig through to get those useful snippits, and 2.) are written generally just so the thing will compile, as a full application is almost definitely going to be too much for most functions or topic pages. I fully support the level of example code currently in the wiki; there are separate example, tutorial, and library sections (here and there) and they fulfill their purpose well too.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
05-30-2008 09:10
From: Hewee Zetkin
Absolutely not. Snippits showing concise, useful examples of a particular topic are much better than a junk script written around the examples that 1.) you have to dig through to get those useful snippits, and 2.) are written generally just so the thing will compile, as a full application is almost definitely going to be too much for most functions or topic pages. I fully support the level of example code currently in the wiki; there are separate example, tutorial, and library sections (here and there) and they fulfill their purpose well too.


I agree. We don't want to go down the rat-hole of writing every example as though someone is going to try to use it without learning the basics of LSL. That's what tutorials are for. The wiki should be a *reference* document, not a tutorial. Try to do both, fail at both.
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
05-30-2008 09:37
From: Hewee Zetkin
Absolutely not. Snippits showing concise, useful examples of a particular topic are much better than a junk script written around the examples that 1.) you have to dig through to get those useful snippits, and 2.) are written generally just so the thing will compile, as a full application is almost definitely going to be too much for most functions or topic pages. I fully support the level of example code currently in the wiki; there are separate example, tutorial, and library sections (here and there) and they fulfill their purpose well too.


I agree. Generally I am quite happy with the level of example.

The majority of times I refer to a wiki entry for a quick example of how a particuliar function or principle works, so that I can work out how that fits, or doesn't fit, into what my script is trying to accomplish. Other times I'll refer to the wiki for a reminder of one thing or another that I have forgotton, or haven't got quite right. Concise snippets are very useful for these things; more cumbersome fleshed-out and compilable examples are more suited to tutorials and librarys, imo
_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
05-30-2008 12:49
From: Strife Onizuka
Yes some of the examples on the wiki aren't in complete script form. Do you think we should change that?

On a related note, do people want Examples on the constant pages? I'm going to be making some (minor) changes to the constant template and I'm wondering if the Examples section should be mandatory like it is on the function pages.


Not really, I understand when I see a full script verses a code snippet, and what to do with the code snippet to make it work.

As far as examples on the constant pages, I don't really think it's needed, It all depends though, do we want the wiki to teach LSL or programming? If you're a programmer, you know what a constant is, so do you really need examples of it in action? I think not.. just my take on it.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
05-31-2008 06:25
It's sounding like people aren't really interested in constants requiring examples.

Where there are examples, we should have both a simple full script example and a snippet example. (this would go into some forth coming best practices article).

Johan: Some people do use the wiki to learn programing. They come to SL with no programing experience and start in on LSL. Though the wiki currently isn't a good new user resource, mostly because we don't have the connecting content and articles.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
05-31-2008 18:46
From: Strife Onizuka
Johan: Some people do use the wiki to learn programing. They come to SL with no programing experience and start in on LSL. Though the wiki currently isn't a good new user resource, mostly because we don't have the connecting content and articles.

Have no idea what the numbers are but I would venture to guess that a very high percentage of people dealing with LSL have no prior programming/scripting experience. The wiki/wikis do work and people can learn to code with them, including myself. Although it would have been considerably more difficult without the expertese available here in the forum. Unfortunately there are so many without access here.

I have been here long enough to have seen so many changes with the wikis. If there had never been a change and so many of us had not ended up jaded and disenfranchised then I can't imagine just how much more helpful it would be now.

I have graduated to other languages now including one I absolutely love: Autoit. If anyone has ever dealt with it then you will have seen that it's documentation is simply unbelievable and should be considered the gold standard. Working examples on nearly every entry in the helpfile and there are a considerable number of them.

That being said, it is our wiki and the content is strictly up to us. I feel that I have given back to the community because of my frequent contributions here. Now, after Autoit, I wonder if I might have done more good and helped a much broader audience by devoting my time to upgrading the wiki content instead. I am going to be extremely busy for the next month, but after that, maybe, just maybe I can rectify that.

The wiki as it stands is the result of just a handful of individuals, Strife, Talarus and a few others. So it seems kind of silly for Strife to ask opinions. You do what you want to do Strife, I am sure that whatever you do, it will prove helpful to others.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
05-31-2008 22:33
From: Strife Onizuka
Where there are examples, we should have both a simple full script example and a snippet example. (this would go into some forth coming best practices article).

That seems about right, this thread is definitely not the first case of "the stuff in the wiki doesn't even compile".
_____________________
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
Breath mint or candy mint?
06-01-2008 09:46
Yes, of course the Wiki should have clearly marked reference material (like most man pages). However, it should also have clearly marked *tutorial* material, and useful examples.
_____________________
So many monkeys, so little Shakespeare.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
06-01-2008 10:20
AutoIt is a fun language, though not my favorite, (which is C#). My only gripe about the AutoIt documentation is that the constants are all mostly lumped all together. But it has been a while (year or two?) since i played with it so things may have improved.

If the LSL community were a dog, and the the LL was it's owner, the ASPCA would have been called in long ago and LL arrested for neglect.

Most man pages in my experience don't describe the functionality or the edge cases in enough detail to satisfy me.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey