Viewer digest?
|
Ross McCoy
Junior Member
Join date: 23 May 2004
Posts: 16
|
06-21-2004 18:12
Is that my I.d. # that I'd use in scripts, ?
|
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
|
06-21-2004 19:34
huh?
_____________________
Grim
"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
06-21-2004 19:40
You mean your key. No, it isnt. You can get your key with the following script:
default { touch_start(integer total) { llSay(0,(string)llDetectedKey(total - 1)); } }
|
Chase Bravo
Junior Member
Join date: 18 Jun 2004
Posts: 13
|
06-21-2004 22:27
Forgive my noobishness Eggy, but in that example (assuming only one person touched the object) would total be equal to 1?
Also, why is it llDetectedKey(total -1), I've used llDetectedKey before but with a 0 as the argument. What is the significance of total-1?
Or am I missing something simple?
|
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
|
06-21-2004 22:45
I personally always use 0.
If I'm just going to randomly pick one of the detected items, why is the last any better than the first? Why is a math operation better than no operation, and yes I'm lazy, why is 9 characters better than 0?
_____________________
-- 010000010110110101100001001000000100111101101101011001010110011101100001 --
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
06-21-2004 23:34
i'm more lazy i just make a new script and change the default say to just say llGetOwner() i forget if i add the (string)
_____________________
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
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
06-22-2004 01:37
Shrugs, more than one way to skin a cat I suppose.
|
Chase Bravo
Junior Member
Join date: 18 Jun 2004
Posts: 13
|
06-22-2004 08:47
soo. llDetectedKey(total - 1) returns the same as llDetectedKey(0)?
Sorry if this seems like a stupid question, I'm still very new to this and having a hard time understand how passign to different variables to the same functions yields identical results.
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
06-22-2004 09:10
Chase: touch, sensor, and collision events get a "total number" passed to them. This is an upper limit that you can use as an index for the llDetectedBlah() functions. Since it is zero-based, when you have a total of 3 people detected, you can use indices 0, 1, and 2. As you can see, the last index is always one less than the total, hence the total - 1. When you are expecting only one person to be using the script, you can either assume that said person was the first one to touch the object, numbered 0, or the last one to touch the object, numbered total - 1. They are fairly equivalent though. If only one person is touching the object, total == 1, and total - 1 == 0.
|
Chase Bravo
Junior Member
Join date: 18 Jun 2004
Posts: 13
|
06-22-2004 09:17
Ahh! Thank you sooo much for taking the time to explain that to me Eggy. Now I understand "I see! said the blind man"
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
06-22-2004 10:21
"I see!", said the blind man to the deaf child. "It's all coming back to me!", as he was pissing in the wind 
|