Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Owner-Dependant Channel

Archetypus Deed
(title goes here)
Join date: 13 Sep 2009
Posts: 13
09-22-2009 15:41
What is the best way to generate a unique channel for a set of objects to use based off of the owners UUID? The objects may be located anywhere withing the same region so they are not linked.

I've tried several ideas and gotten nothing at all to work.
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
09-22-2009 15:55
Look here: /54/5f/338587/1.html
Post #18 might be the most helpful to you.
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
09-22-2009 15:58
From: Archetypus Deed
What is the best way to generate a unique channel for a set of objects to use based off of the owners UUID? The objects may be located anywhere withing the same region so they are not linked.

I've tried several ideas and gotten nothing at all to work.
Try
CODE

integer my_channel = (integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1));

Remember, though, that
CODE

key owner
default{
state_entry(){
owner = llGetOwner();// better to make owner a global variable rather than check it each time
}
listen(integer channel, string name, key id, string message{
if(llGetOwnerKey(id)==owner){ // if the owner of the object talking to me is also my owner
//do stuff
}
}
changed(integer change){

if(change&CHANGED_OWNER){
owner = llGetOwner(); // or llResetScript() of course.. you need to reset the value of owner, anyway
}
}
}
will filter out all messages from objects belonging to anyone else.
Archetypus Deed
(title goes here)
Join date: 13 Sep 2009
Posts: 13
09-22-2009 22:36
That is exactly what I was trying to do.

Thank you both so much.