Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

looking for that simple EYE follow script

BloodDoll Lulu
FIX Inventory Issues 1st
Join date: 9 Jul 2005
Posts: 152
10-08-2005 02:25
Not a script where the object physically follows a player around, just the one where say it's an eye and the eye turns it's gaze to look at an avatar close to it, no matter where they move. That is what I am looking for. It's not for an eye either, I just need it to point with an attachments, at people. Thanks to anyone who can help me.
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
10-08-2005 09:51
From: BloodDoll Lulu
Not a script where the object physically follows a player around, just the one where say it's an eye and the eye turns it's gaze to look at an avatar close to it, no matter where they move. That is what I am looking for. It's not for an eye either, I just need it to point with an attachments, at people. Thanks to anyone who can help me.


Try this. It's pretty much so the exact same as the follower script , except looking for ANY nearby player (not just the owner), and with the move part taken out and the turning part left in.

CODE

startup()
{
llSetStatus(STATUS_ROTATE_Z,TRUE);
key id = llGetOwner();
llSensorRemove();
llSensorRepeat("","",AGENT,200,2*PI,2);
}

default
{
state_entry()
{
startup();


}

on_rez(integer start_param)
{
startup();
}

sensor(integer total_number)
{
vector pos = llDetectedPos(0);
llLookAt(pos, .1 , 1);
}
}

Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
10-08-2005 09:53
From: BloodDoll Lulu
I just need it to point with an attachments, at people.


OH, and if you mean that this item will be an attachment that you or someone else will be wearing, it gets a little more tricky - you'll have to wait until 1.7 (which will let us have moving attachments) and probably have to have the script specifically NOT look at the AV wearing it...
BloodDoll Lulu
FIX Inventory Issues 1st
Join date: 9 Jul 2005
Posts: 152
10-08-2005 13:02
No, it's like say a sphere with some "appendage" on it turning, that's all. It's part of something I was making and just wanted to have some movement when someone got close to look at it.

Anyway the important thing is you took the time and posted me the code. I will try it out. THANK You for doing so.
BloodDoll Lulu
FIX Inventory Issues 1st
Join date: 9 Jul 2005
Posts: 152
10-08-2005 14:42
it works but it points up a little higher and the range it activiates is too close. It's mainly got to point from a good distance, trying to play with values in here to see what might change it. I kind of wanted it to stay withing a certain axis, not point up too high which it seems to rest in a upward position instead of straight dead on when not targeting. Still working on it...
mexxa Woyseck
Registered User
Join date: 8 Oct 2005
Posts: 31
10-09-2005 08:19
If you want it as an attachment couldn't you use the follow script on it (so it follows you) and have it ignore you. It's probably the nearest you could get atm.
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
10-09-2005 10:46
When you say "and the range it activiates is too close"... it should look at any AV within 200meters of itself, which is pretty far... If you changed the 200 in the line
"llSensorRepeat("","",AGENT,200,2*PI,2); "
to 10, then it would only look if an AV were closer, within 10 meters.

As far as how the, er, "appendage" is pointing, change the rotation of the sphere - unlink it, change the rotation of the sphere (set it to show "local rotation";) and rotate the sphere so the red arrow, your sphere's local x axis, is horizontal...
Daz Honey
Fine, Fine Artist
Join date: 27 Jun 2005
Posts: 599
10-09-2005 10:48
Sukkubus Phaeton has one of those eyeballs that turns to look at you at ~QotD~ in Stump!
_____________________
All children are artists. The problem is how to remain an artist once he grows up. - Pablo Picasso
BloodDoll Lulu
FIX Inventory Issues 1st
Join date: 9 Jul 2005
Posts: 152
10-10-2005 11:23
hey thanks logan. I will try that. Hopefully I can get it working out. I added some other stuff, so I can use this script in two places, until I can find someone to script the entire thing for me, which will probably be never cause I'm too quiet etc. Anyway, thank you for the post.



BTW- This isn't an eye, it's not an avatar attachment, it's not even organic.


* one other thing, anyway to limit the axis it rotates on? I waa thinking of putting two prims invis at either side hoping when it hits those, it stops, and thus the limitation I wanted.