Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How do

Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
07-14-2004 08:09
How do I figure out my own key? Is it a constant?
Siobhan Taylor
Nemesis
Join date: 13 Aug 2003
Posts: 5,476
07-14-2004 08:12
Create a prim...

Create within it a default script...

Change the llSay line in the touch_start section to read:

llSay(0, "Touched by " + llDetectedKey(0));


Recompile it...
Turn off editing...
Then click on it.
_____________________
http://siobhantaylor.wordpress.com/
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
07-14-2004 08:14
Yes. In fact, everything has a unique constant key.

default
{
state_entry()
{ llSay(0, "My Owner's key is " + (string)llGetOwner()); }
}
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Siobhan Taylor
Nemesis
Join date: 13 Aug 2003
Posts: 5,476
07-14-2004 08:20
lol Wednesday, that too
_____________________
http://siobhantaylor.wordpress.com/
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
07-14-2004 08:46
Thank you.

How bout if i wanted to insert something into a List? Is that possible? Like

List bob = [1,2,0,4,5]

so then i want to enter the number 3 in spot 2. (since it starts at zero)
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-14-2004 11:32
Try this example on the LSL wiki's page on lists.


CODE

// replaces item number _pos_ in list _dest_ with list _src_
// negative values for _pos_ means count from the end of
// the list instead, so a _pos_ of -1 means replace the last item in the list

list ListReplaceList(list dest, list src, integer pos)
{
if (pos < 0) pos = llGetListLength(dest) + pos;
return llListInsertList(llDeleteSubList(dest, pos, pos), src, pos);
}

_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
07-14-2004 18:39
thank you once again
Darwin Appleby
I Was Beaten With Satan
Join date: 14 Mar 2003
Posts: 2,779
07-14-2004 19:27
Check the LSL wiki (www.badgeometry.com/wiki) too, if you have any scripting questions. It's a great recource. Plus, it's a lot faster than asking all of us lazy heads :D
_____________________
Touche.
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
07-14-2004 20:23
I actually did look at. I just totally miss that :p. I really suck at fast reading :(.