Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Follower Sensorless_Pet_follower_script  

Sensorless_Pet_follower_script

Sensorless_Pet_follower_script

Category: Follower
By : anonymous
Created: 2011-01-22 Edited: 2011-01-22
Worlds: Second Life

the Zip file

Download all files for Sensorless_Pet_follower_script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Sensorless_Pet_follower_script_1.lsl
1 vector offset = < -1, 0, 1>; //1 meter behind and 1 meter above owner's center.
2
3 default
4 {
6 {
8 // Little pause to allow server to make potentially large linked object physical.
9 llSleep(0.1);
10 llSetTimerEvent(1.0);
11 }
12 timer()
13 {
14 list det = llGetObjectDetails(llGetOwner(),[OBJECT_POS,OBJECT_ROT" title="View Definition" class="tooltip">OBJECT_ROT]);//this will never fail less owner is not in the same sim
15 // Owner detected...
16 // Get position and rotation
17 vector pos = llList2Vector(det,0);
18 rotation rot = (rotation)llList2String(det,1);
19 // Offset back one metre in X and up one metre in Z based on world coordinates.
20 // use whatever offset you want.
21 vector worldOffset = offset;
22 // Offset relative to owner needs a quaternion.
23 vector avOffset = offset * rot;
24
25 pos += avOffset; // use the one you want, world or relative to AV.
26
27 llMoveToTarget(pos,0.4);
28 }
29 }

Back to the Best Free Tools in Second Life and OpenSim.