|
Neb Soyer
Really good looking.
Join date: 9 Apr 2006
Posts: 45
|
04-29-2006 12:08
Okay this has been bugging me all day. I had problems with a little follower orb (with particle effect add-ons), when I gave it to another person to use it only seemed to work on MY commands (the creator). The Listen functions are ALL set: llListen(0, "", llGetOwner(), ""  ; Also in my listen event, I have before any other code; if(id == llGetOwner()) It's weird, 'cause the particle effects work, but the color changing commands dont work. I also have a rezzer bracelet, which with, no commands works for anyone else but myself, the creator. The commands are to rez the orb, give a notecard to the owner, kill any orbs around, and to show and hide the bracelet. I don't know what's going on, I'm 70-80% this isn't error on my part. Anyone have any ideas?
|
|
Zodiakos Absolute
With a a dash of lemon.
Join date: 6 Jun 2005
Posts: 282
|
04-29-2006 12:12
The hint here is that you gave it to another person. If you had the script listen only to owner, did you also add a line to the script to reset on rez? The UUID of the listen is set only when that line is actually called, so when you gave it to the other person, it was probably still listening to you. Just call llResetScript() in the on_rez event. -edit: That seemed a little vague, so here's an example of what I mean.  default { state_entry() { llListen(0, "", llGetOwner(), ""); }
//... All your listen stuff goes here ...
on_rez(integer params) { llResetScript(); } }
|
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
04-29-2006 12:16
the script may still think your the owner try this: on_rez(integer num) { llResetScript(); }
scripts stay in the state they were last in when you take them into inventory, so the listen llGetOwner may still think its you because state_entry hasnt run again. -LW
|
|
Rini Rampal
Rabid Consumer
Join date: 10 Sep 2004
Posts: 72
|
04-29-2006 12:23
Of course, if you have variables that keep you from wanting to actually reset the script, you can also do something like this:
integer listenerIndex;
default { state_entry() { listenerIndex = llListen(0, "", llGetOwner(), ""); }
//... All your listen stuff goes here ...
on_rez(integer params) { llListenRemove(listenerIndex); listenerIndex = llListen(0, "", llGetOwner(), ""); } }
And while we're on the topic, don't use main chat! No! Bad spammer!  If I have to listen to another person say 'ao off', I'm gonna scream. That's what channels were made for! *grin*
|
|
Neb Soyer
Really good looking.
Join date: 9 Apr 2006
Posts: 45
|
04-29-2006 12:33
Thanks guys, really helpful. I'm surprised I didn't know this, guess I should read the FULL on functions and events descriptions.
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
04-29-2006 13:08
Just for the sake of completeness, especially if you sell things direct (i.e. they buy an item set for sale in world and don't rerez it), you can use the changed event and CHANGED_OWNER to remove the listen and reset it.
As Zodiakos said - it's right when it sets the key, but if it doesn't run the code again it doesn't update the listener.
|