These forums are CLOSED. Please visit the new forums HERE
Library: Basic Pet Script (Follow/Face Owner) |
|
Alfred Lardner
Mad Scripter.
Join date: 28 Dec 2005
Posts: 28
|
01-14-2006 08:28
I'm tempted to use some of my older scripting tricks to make Pet v2.0. There's a way to make a follower without sensors, if you're willing to wear an attachment. There's also some scripting tricks that allow you to cascade the same for a follower trail.
_____________________
Needlessly complicating LSL since 2005.
|
Alfred Lardner
Mad Scripter.
Join date: 28 Dec 2005
Posts: 28
|
01-14-2006 08:47
That should just be a matter of offset.
_____________________
Needlessly complicating LSL since 2005.
|
Percy Plunkett
Registered User
Join date: 3 Dec 2005
Posts: 8
|
02-20-2006 22:07
I'm tempted to use some of my older scripting tricks to make Pet v2.0. There's a way to make a follower without sensors, if you're willing to wear an attachment. There's also some scripting tricks that allow you to cascade the same for a follower trail. Sounds interesting Alfred...could also be used for an object to call an animal at a certain time, or when an event is triggered through that object. I'd be interested in seeing your bag of tricks for that. |
Uyek Margetts
Registered User
Join date: 24 Apr 2006
Posts: 12
|
This sounds like such a fun script but I have a really rookie question . . .
04-26-2006 08:40
. . . to ask about it (and perhaps about scripts in general).
I tried this out last night in SL: created a simple object, gave it this follower script. Now here's the rookie question: I was at a loss as to how to get the object to follow my avatar. Do I have my avatar touch it, attach it, take it? Enter my avatar's name somewhere in the script [e.g., enter it within the parentheses of "llGetOwner();"] It must be something simple but I am stumped. Thanks to anyone that can educate me. |
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
05-17-2006 13:00
Looking back through this thread . . . am curious about Alfred's idea to make a pet by means of attachment. Can you enlighten me?
The only thing that comes to mind is attaching something with a llSay or the like and a pet that hears it. Is there another way that is not coming to this mind? I am thinking of doing something like a cart or a wagon . . . would be nice if it ALWAYS remained with its avatar, but did not bob up and down, instead remaining on the ground. Thanks for any help, Baron |
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
06-01-2006 10:11
I would think the wagon would be accomplished using some variations of setting up the script as a ground vehicle.
I'm still very much a newbie at scripts and couldn't create one to do much of anything more complicated than a llsittarget() for extra vehicle seats, but I've had to adjust quite a few to get my desired results on vehicle behavior, and I wouldn't think it should be too much more complicated than that except that instead of taking your controls, it just uses the sensors to dictate how it moves. |
Kokoro Fasching
Pixie Dust and Sugar
![]() Join date: 23 Dec 2005
Posts: 949
|
06-02-2006 10:03
Is there a way to make a follower without making physics? With the new Flexi prims I can't seem to get it to follow..
Thanks in advance. |
Kokoro Fasching
Pixie Dust and Sugar
![]() Join date: 23 Dec 2005
Posts: 949
|
06-02-2006 12:36
Is there a way to make the script work without making the pet physical?
|
Azarii Fugazi
Registered User
Join date: 26 May 2006
Posts: 4
|
07-28-2006 00:05
Im really enjoying this script. I made a flock of birds fly behind me in a neat little pattern. When I sit on one of the birds I looks as if they were carrying me off!
This is a weird request but does anyone have a script that makes pets attack others? In a harmless way of course. Or anyscript that can be used for pets to make them do something. |
Tai Clifford
Registered User
Join date: 26 Jul 2006
Posts: 45
|
08-02-2006 22:05
This is a fun little script, but I have some questions... I see in this thread how to get the "pet" to look at your head or mid section and so on. I also see a little tweak that will have your pet look the same direction as you not at you. When I use this change my prim is reset to 000 rotation. I have a cube with a cone as the nose... I want the cone facing forward and looking in the same direction as my avatar. What am I missing? Is there some place in the script to set the default rotation of the prim? Thanks I have been scripting for a whole day so far, I have been playing with this script and wondered exactly the same thing as you, why my object rotated when I added the script. I looked up "llLookAt" in the functions library and it said this "Causes the object to point the up (Z) axis toward target". That was my problem, I wanted the x axis to point to the target. So I read a bit further and saw that by changing the llLookAt line to llRotLookAt, there is an example here http://secondlife.com/badgeo/wakka.php?wakka=llLookAt my object was pointing the right way. |
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
08-03-2006 15:07
Well, here's how to calculate a rotation you can use with 'llSetRot()' or 'llRotLookAt()' in order to point your x-axis in a given direction and keep your z-axis oriented in an, "upward," direction:
CODE rotation lookDirToRot(vetor lookDir) |
Goapinoa Primeau
Addict
Join date: 29 Jun 2006
Posts: 58
|
i give up!!!
08-04-2006 12:17
I've been trying for days to accomplish something like this without success, i wanted to try to crack it for my own learning but, im going round and round in the kind of circles im trying to create.
I'm trying to make R2D2 from Star Wars as realistic as possible, i spent a long time trying to get the head to rotate around its own z axis but eventually gave up in favour of a texture animation (although i'd much prefer the former) since the head piece has a couple more prims which would also need to reposition themselves in the rotation, i think... theres no way to get around this is there??? since we dont have hierarchical linking.... so ive spent three days now trying to get him to tilt up slightly on moving start and tilt back down again on moving end, the root prim is his main body so i've tried to apply the ideas in this thread to get him to look slightly up and then then slightly down but to no avail, ive tried all manner of quaternion to eulers and back agains, every time the result is the same, i have managed to get him to tilt in the right way (regardless of his current global rotation) but when i try and restore the original looking , he goes awry. any help would be much appreciated. |
Goapinoa Primeau
Addict
Join date: 29 Jun 2006
Posts: 58
|
i give up!!!
08-04-2006 12:28
I've been trying for days to accomplish something like this without success, i wanted to try to crack it for my own learning but, im going round and round in the kind of circles im trying to create.
I'm trying to make R2D2 from Star Wars as realistic as possible, i spent a long time trying to get the head to rotate around its own z axis but eventually gave up in favour of a texture animation (although i'd much prefer the former) since the head piece has a couple more prims which would also need to reposition themselves in the rotation, i think... theres no way to get around this is there??? since we dont have hierarchical linking.... so ive spent three days now trying to get him to tilt up slightly on moving start and tilt back down again on moving end, the root prim is his main body so i've tried to apply the ideas in this thread to get him to look slightly up and then then slightly down but to no avail, ive tried all manner of quaternion to eulers and back agains, every time the result is the same, i have managed to get him to tilt in the right way (regardless of his current global rotation) but when i try and restore the original looking , he goes awry. any help would be much appreciated. |
Goapinoa Primeau
Addict
Join date: 29 Jun 2006
Posts: 58
|
I give up!!
08-04-2006 14:15
Im trying to make R2's little tilt as he starts moving and return to the original position when he stops, i cant get it too work independantly of his root rotation.
this is how far ive got, after three days of brainache, walktilt() { llInstantMessage(llGetOwner(), "walktilt" ![]() rotation currentRot = llGetRot(); vector targetrot = llRot2Euler(currentRot); vector targetrotto = targetrot+<0.0,2.0,0.0>; targetrotto*=DEG_TO_RAD; rotation targetrotoutput = llEuler2Rot(targetrotto); llRotLookAt(targetrotoutput,1.0,5.0); } i've just noticed llAxisAngle2Rot and i'm sure i need something like that in there somewhere. this is my first encounter with programming and certainly with quaternions, im going round and round in circles that i'd never be able to describe in eulers let alone anything else. any help much appreciated |
Wendy Rote
Registered User
Join date: 28 Jun 2006
Posts: 1
|
08-19-2006 05:52
I made a cute one... thank you!!
|
ArchTx Edo
Mystic/Artist/Architect
![]() Join date: 13 Feb 2005
Posts: 1,993
|
08-22-2006 13:55
This is a weird request but does anyone have a script that makes pets attack others? In a harmless way of course. Or anyscript that can be used for pets to make them do something. I encountered a bull dog in SL that would attack visitors to his owners land, it would bump into you and even push your avatar around. I think I saw it for sale on SL Exchange. _____________________
![]() VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30 http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240 http://shop.onrez.com/Archtx_Edo |
Markubis Brentano
Hi...YAH!!
![]() Join date: 15 Apr 2006
Posts: 836
|
08-31-2006 18:42
I encountered a bull dog in SL that would attack visitors to his owners land, it would bump into you and even push your avatar around. I think I saw it for sale on SL Exchange. I have a Black Panther that does the same thing. It has a drop down menu that allows you to select which avatar you want to attack. |
ScriptScavenger Lei
Registered User
Join date: 3 Sep 2006
Posts: 14
|
confusing much
09-12-2006 18:52
This script will make an object follow it's owner and face towards it's owner, creating a very basic "pet". Make sure that the root prim of the object is facing a rotation of <0,0,0,1>, or <ZERO_ROTATION>, or just edit the object and put 0 in the X,Y, and Z rotations... OR, be prepaired for your pet to always face the wrong way! ![]() CODE
ok after reading it and trying it came to the conclusion that if i dont want it to bob up and down that the following works just fine assuming the root prim is at (0.00,0.00,0.00) CODE
feal free to remove all the // stuff if its to confusing |
Methodius Dagger
Registered User
Join date: 29 Aug 2007
Posts: 1
|
how about an avatar following another
08-29-2007 06:03
Would it be possible, instead of an object (pet) following an avatar, to have avatar 1 to follow avatar 2 (leader)? What would be required? Any hints in the right direction would be appreciated.
I can see many applications. If you're going shopping with a friend, you can just let your friend lead, and you can follow without controlling the movement. If you're in a role playing game, the party member can follow the party leader. And so on. |
Medusa Torok
Registered User
Join date: 13 Oct 2007
Posts: 13
|
11-08-2007 12:30
I would like to know if, and how, this script can be modified so that an object will follow any avatar that passes near to it, rather than being specific to the owner.
|
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
|
11-09-2007 14:52
use the sensor function to find the key to the nearest agent rather than using the owners key and have the pet follow that key
![]() http://www.lslwiki.net/lslwiki/wakka.php?wakka=TutorialRobotics has a really useful tutorial on autonomous objects. In particular you might want to check out Anorca Calamari's robot script as it uses a sensor to find agents within 50m or more. Alternatively there is a script that creates a hopping physical creature that also uses a sensor to find avatars and move towards it. _____________________
Tread softly upon the Earth for you walk on my face.
|