Jump to content

llListen and Getowner question


ChaosRaine
 Share

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

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

Recommended Posts

I was just looking through the forums and came upon this one http://community.secondlife.com/t5/LSL-Scripting/llGetOwner-breaks-my-tiny-script/td-p/2720976 (I've never posted a link in here sorry if it doesn't work) it was titled "llGetOwner breaks my tiny script". It made me start thinking about a possible revision to an older script I did.

If I use a script like theirs

key owner;//placeholder for the owner's uuid
default
{
	state_entry()
	{
		owner = llGetOwner();//get the owner's uuid
		llListen(1234, "", NULL_KEY, ""); //listen to messages from anyone on 1234
	}

	changed(integer change)
	{
		if (change & CHANGED_OWNER){//if the owner changes
			owner = llGetOwner();//get the new owner's uuid
		}
	}
	listen(integer channel, string name, key id, string message)
	{
		if (llGetOwnerKey(id) == owner){ // if the message is from an object belonging to my owner, or from my owner,
			if (message == "tex3") llSetTexture("xxxxx-xxxxx-xxxxx-xxxxx-xxxxx", ALL_SIDES);
		}
	}
}

 only instead of the owner talking I want it to listen for a message from another object can I replace the llGetOwner with the an object's or script's uuid or someway to get it to identify a spacific object giving the command rather then just the owner?

Kinda like having a remote control nearby that is not attached to the prim that is changing textures.

 

Link to comment
Share on other sites

Hi Chaos,

 

Not quite sure what your question exaclt is. Theid paramete in the listen gives you the key from which the message is initiating, and could be a prim or Avatar. The way the code you have provided is written, it will only respond to messages that come from objects (prims) that are owned by the owner of the script .

What is the specific conditionyou are trying to test for?

 

Wanda

Link to comment
Share on other sites

Sorry the question was poorly written. I selling an object that rezzes other objects. When it rezzes on I use llSay to send a message on a predettermend channel and when the rezzed object hears the message it deletes. This works great the only problem would be if a customer has two of the same item next to each other. Rezzing an object from one would cause both rezzed objects to delete sence they would both be listening to the same channel. I'm trying to figure out a way around this so they can work independantly.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3603 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...