Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Get object key?

Maya Remblai
The one with pink hair.
Join date: 25 Mar 2006
Posts: 434
11-02-2007 00:14
This is probably really obvious, but...

At the moment the "Copy asset UUID" is not working for objects in my inventory (it always results in zeroes) and I need to find the key of an object so I can feed that to another object to follow the first object. So what script can I use to force SL to give me the UUID of the first object?
Cristiano Midnight
Evil Snapshot Baron
Join date: 17 May 2003
Posts: 8,616
11-02-2007 00:19
llGetKey() returns the key of the object a script is running inside of.
_____________________
Cristiano


ANOmations - huge selection of high quality, low priced animations all $100L or less.

~SLUniverse.com~ SL's oldest and largest community site, featuring Snapzilla image sharing, forums, and much more.

Maya Remblai
The one with pink hair.
Join date: 25 Mar 2006
Posts: 434
11-02-2007 00:37
I was right, it was obvious :P Thank you. :)

string objectkey;

default
{
state_entry()
{
objectkey = llGetKey();
}

touch_start(integer total_number)
{
llSay(0, objectkey);
}
}
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
11-02-2007 02:13
From: Maya Remblai
This is probably really obvious, but...

At the moment the "Copy asset UUID" is not working for objects in my inventory (it always results in zeroes) and I need to find the key of an object so I can feed that to another object to follow the first object. So what script can I use to force SL to give me the UUID of the first object?


I can't see "Copy asset UUID" being of any use for an object. Any time you rez an object it is assigned a new UUID. The only things with static UUIDs are textures, notecards (well, only one revision of a notecard, any time you save a notecard it is assigned a new UUID), sounds and animations (plus people/agents and groups). You will only be able to access the UUID using "Copy asset UUID" if you have full permissions.

So on your initial issue you mentioned a following object. The two objects would need to "pair" when rezzed as the keys change. (Pairing could just be a simple handshake on an obscure channel).
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Aniam Ingmann
llOwnage(float pwnage);
Join date: 22 Oct 2005
Posts: 206
11-02-2007 02:43
Yeah just have the other object simply listen for the 1st's confirmation key on rez.

I just wrote them up real quick cuz they're pretty simple so bare with me if there's a few mistakes i'm pretty tired :/

1st object:
From: someone

default
{
on_rez(integer sp)
{
llRezObject("follow",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,42);
}
object_rez(key id)
{
llWhisper(-3471283,(string)id);
}
}

2nd Object:
From: someone

key followkey;
default
{
on_rez(integer sp)
{
llResetScript();
}
state_entry()
{
llListen(-3471283,"",NULL_KEY,"";);
}
listen(integer c, string n, key id, string msg)
{
if (c == -3471283)
{
followkey = (key)msg;
}
}
}
_____________________
From: someone

Don't worry, Aniam is here!
- Noob
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-02-2007 09:54
nand got it, objects don't have keys till rezzed, all other items that you can't rez separate from an av, do.

Q: aren't object keys, per sim? meaning they get a new key upon entering a new sim?
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-02-2007 11:17
From: Void Singer

Q: aren't object keys, per sim? meaning they get a new key upon entering a new sim?

Yes, but you can wear an object, teleport to a new sim, and drop it without having its key changed. Useful for when you want to move your precious hard-coded updater.
_____________________
Rune Quinnell
Registered User
Join date: 25 Aug 2007
Posts: 28
11-02-2007 15:13
From: Aniam Ingmann
Yeah just have the other object simply listen for the 1st's confirmation key on rez.

I just wrote them up real quick cuz they're pretty simple so bare with me if there's a few mistakes i'm pretty tired :/

1st object:

2nd Object:


Now lets say you want to assign the key of a rezzed object to a variable in the origional...

Can you do that with a getkey function somewhere in the llrez_object?
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-02-2007 16:09
From: Rune Quinnell
Now lets say you want to assign the key of a rezzed object to a variable in the origional...

Can you do that with a getkey function somewhere in the llrez_object?



Yep we were just discussing it in this thread about a door script you can see in thread #17 what I did to send and recieve the key in the rezzed object and read down further for a gotcha or two you have to watch for.

/54/80/220084/1.html
_____________________
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