|
Savannah Christensen
playing EQ instead
Join date: 4 Jan 2006
Posts: 64
|
07-21-2007 19:32
I swear I've seen something like this here somewhere, and for the life of me now... I cannot find it.
Basically I've compiled a tip jar script which hovers above the user, but if the user leaves, or disconnects the tip jar will hover over someone else... and even if that person comes back and re-resses the item it will continue to go to the new person.
So, if anyone knows what I can add to the script to prevent this, or to just kill the item if it's abandoned I'd really appreciate it.
Thank you, Savannah
|
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
07-21-2007 20:33
hmm not 100% sure if it gets a link change when an avatar drops but I'd try this (or something similar? This is just a shot in the dark)
changed(integer change) { // something changed if (change & CHANGED_LINK) { // and it was a link change if(llGetAttached() == 0) // not attached { llDie(); } } }
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
07-22-2007 06:23
Well, guessing from the description, the tipjar might be a "follower", so somewhere it's probably got an llSensorRepeat() for AGENT. Based on the behavior of hopping from avatar to avatar, it must just follow the nearest one: llDetected*(0).
If all that guessing is correct, and if the person who is supposed to be followed also is the object's owner, then just tightening the filter on llSensorRepeat() to only sense llGetOwner() should work, combined with:
no_sensor { llDie(); }
If somebody else is rezzing the object next to the person-to-be-followed, the no_sensor still applies but there'd be an extra set-up step of identifying who to follow. Might handle that with an initial call to llSensor(), then calling llSensorRepeat() filtered to the llDetectedKey(0) found in that first sensor() event. (I'd hop to a different state at that point, just to avoid having to test a flag variable every time in sensor().)
|
|
Savannah Christensen
playing EQ instead
Join date: 4 Jan 2006
Posts: 64
|
07-22-2007 14:14
Yes, you're correct with all your guessing Qie Thank you both very much, now to see if I can make that work 
|