Odd key change bug.
|
|
Lucius Obviate
Evil Incarnate
Join date: 5 Dec 2006
Posts: 15
|
05-13-2007 10:03
Ok first off lets get the bug out of the way. This is a leash script in a collar, that is working based off the key of the person giving the command to the collar script which sends a message to the leash script with the needed information for functioning.
If I TP to a new region then TP the wearer the leash remains intact and functions, however if the wearer TPs to a new region and TPs me the key that it is using to make the actual leash function is changed to that of the wearer. Any suggestions?
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
05-13-2007 10:26
I imagine it has something to do with the leash looking for it's target key in the sim, not finding it, and defaulting. It would seem to me, however, that the key would default to NULL rather than OwnerKey.
Just speculation...but from the situation you describe, it sounds like if the leash target-key is in the sim previous to arrival it can detect and remain...but if the target-key is unfindable, it reverts to a default.
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|
|
Lucius Obviate
Evil Incarnate
Join date: 5 Dec 2006
Posts: 15
|
05-13-2007 10:28
Its getting the key via llMessageLinked from the collar script. and being set to a global variable which is used in llSensor to get the position of the person "holding" the leash in order to check for distance.
And if it were a case of it reverting to default why does it only happen when the wearer teleports away from teh leash holder and not vice versa?
|
|
Adrian Zobel
Registered User
Join date: 4 Jan 2006
Posts: 49
|
05-13-2007 21:17
I assume it's got an on_rez event that is triggered when the wearer teleports.
If the wearer teleports first, the event triggers and notices that the owner is not around, so turns the leash off. But if the owner teleports first, the event triggers and notices that the owner is still nearby.
|
|
Lucius Obviate
Evil Incarnate
Join date: 5 Dec 2006
Posts: 15
|
05-13-2007 21:41
Actually no it doesnt have an on_rez event, so basically thats the issue then?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-14-2007 00:41
Without seeing the actual scripts we can only sumise from experience. It is quite common for scripts to reset in the on_rez event which would possibly give your described behaviour, i.e. forgetting the assigned keys and defaulting back to owner.
_____________________
I'm back......
|
|
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
|
05-14-2007 06:32
Does state_entry get called when you teleport?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-14-2007 06:55
From: Milambus Oh Does state_entry get called when you teleport? No but on_rez will or at least used to be.
_____________________
I'm back......
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
05-14-2007 09:07
From: Newgate Ludd No but on_rez will or at least used to be. From: The Wiki Triggered in an object whenever it is rezzed from inventory or by another object, or in an attachment when its owner logs in while wearing it, or attaches it from inventory. on_rez is not triggered when an object is rezzed after a teleport. For that, use a changed() event instead. The latter.  That said, it is most likely a script bug. Keys in attachments don't change from teleports anymore, unless the wearer is detaching and reattaching them.
|
|
Lucius Obviate
Evil Incarnate
Join date: 5 Dec 2006
Posts: 15
|
05-14-2007 19:36
The problem was actually coming from the Franimations AO script that is included in the collar which was sending out link messages everytime the owner spoke or changed regions. The leash script was taking those commands and setting the leash holder based on how it was told to get the key for the person holding the leash.
This was remedied by telling it only to listen to specific commands. The leash script itself was working properly just as it was told to but the AO script was causing the error.
|