|
KittyCat Rosebud
CatGirl Group Owner
Join date: 1 May 2005
Posts: 73
|
05-26-2007 23:31
It would probably be two Scripts (one of the object being followed and one for the Object following).
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
05-27-2007 00:11
From: KittyCat Rosebud Does anyone have a script where Object Follows Object yes i do it works quite well, thank you From: KittyCat Rosebud It would probably be two Scripts (one of the object being followed and one for the Object following). yep shure does
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
05-27-2007 01:18
Object A: The object to be followed Object B: The object Following.
Best way to do it is to rez Object be, on rez have it open a listener waiting for the key of Object A. Then rez Object A, on rez have it say it's object key. Object B records that object then starts a sensor repeat (or sensor in a timer event if you prefer it that way) looking for Object A. Each time it scans have Object B move to Object A at the distance you want by getting the llDetectedPos(Object A).
Hope that helps you out.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-27-2007 05:38
From: Lazink Maeterlinck Object A: The object to be followed Object B: The object Following.
Best way to do it is to rez Object be, on rez have it open a listener waiting for the key of Object A. Then rez Object A, on rez have it say it's object key. Object B records that object then starts a sensor repeat (or sensor in a timer event if you prefer it that way) looking for Object A. Each time it scans have Object B move to Object A at the distance you want by getting the llDetectedPos(Object A).
Hope that helps you out. There is absolutely no need for object A to say its key, saying anything, a pass phrase is best, is enough for object B to receive object A's key as a parameter to the listen. You could create it such that Object B rez's object A, that way you eliminate any listens.
_____________________
I'm back......
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
05-28-2007 04:51
Got me wondering about relative lag effects for different "follower" approaches. I've always used the llSensorRepeat() approach, I guess cuz my follower has always been following an avatar, not a scripted thing, but: if the thing being followed is scripted, would it be cheaper for it to instead keep feeding its own position to the follower on a private listen channel? I've always been suspicious of the actual implementation of sensors, but in this case one would think the sensor scan has to be very cheap, cuz it's targeting a single key... and it's a single active script instead of two. Any thoughts?
|