Jump to content

Unique Chat Channel Question


Wandering Soulstar
 Share

You are about to reply to a thread that has been inactive for 3665 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi All,

 

I have the followng snippet of code that I saw one day that gets me a unique chat channel:

 

CHAN = 0x80000000 | (integer)("0x"+(string)llGetOwner());

 Now I have no idea what the math is behind this, but since it is seeded by the Owner's Key, am I correct in assuming that if I were to substitute llGetKey() for llGetOwner(), I'd get a channel unquie to the prim the script is running in, always?

 

Thanks in advance!

Link to comment
Share on other sites

hmmm .. when you say collisions could occur ...

 

I am trying to keep the data transfer among prims to a minimum and was hoping that a prim with this in it would have a unique channel. I could easily have 100's of prims with this code running in them. This is for a building tool and so I want to be sure that a prim other than the one that calls the HUD does not hear a response.

 

so ... any suggestions for how to get a unique channel id?

Link to comment
Share on other sites


Wandering Soulstar wrote:

am I correct in assuming that if I were to substitute llHetKey() for llGetOwner(), I'd get a channel unquie to the prim the script is running in, always?


You are right that the channel number will be based on the prim key

Take notice that the prim key isn't very stable, it is new each time a new instance of the prim is rezzed


Wandering Soulstar wrote:

I have the followng snippet of code that I saw one day that gets me a unique chat channel:

 
CHAN = 0x80000000 | (integer)("0x"+(string)llGetOwner());

  1. The generated number is not unique, it is one in 2147483648 and anybody is allowed to use anyone of these channel numbers at any time
  2. The integer generated from the string uses no more than the first 8 digits from the key

    Two different keys that share the first 8 digits will generate the same channel number

Otherwise it is not a bad way to obtain an almost unique channel number

:smileysurprised::):smileyvery-happy:

 

Link to comment
Share on other sites


Wandering Soulstar wrote:

hmmm .. when you say collisions could occur ...

 

I am trying to keep the data transfer among prims to a minimum and was hoping that a prim with this in it would have a unique channel. I could easily have 100's of prims with this code running in them.
This is for a building tool and so I want to be sure that a prim other than the one that calls the HUD does not hear a response.

 

so ... any suggestions for how to get a unique channel id?

In that case you can use the same channel number for all when you call with llRegionSayTo()

(You know the prim id the moment you get a request from it)

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3665 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...