|
Jay Karlfeldt
Happy Scripter
Join date: 4 Nov 2005
Posts: 51
|
05-31-2006 20:36
I have an animal to which I have now attached a flexible tail, the animal wanders randomly around a Breeding Pen and turns away from the fence when it collides. Since adding a flexible tail makes the whole linked group phantom, collisions no longer work. Nor does setting llVolumeDetect and using collison_start, as the root of the the group has been made flexible before llVolumeDetect can do the job. These animals are carnivorous and can now walk through the fence, which is fine on three sides which are protected water and they immediately get returned, on the fourth side is my neighbours garden and I do not want my animals eating their children. I tried sensors, but in order to sense an object the centre of the object must be in the field of scan, which means they are not good for object avoidance. Please does anybody have any ideas on detecting collisions with flexible prims attached to linked groups?
|
|
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
|
05-31-2006 20:55
If you're just trying to keep them within a square pen you can check their position on a timer, and detect if they've moved outside the safe bounds (and get them to go home or something).
_____________________
-Seifert Surface 2G!tGLf 2nLt9cG
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
05-31-2006 21:16
instead of a timer, use a bounding box defined by your fence. this way, the random target for them to move too won't every be outside that box. This will keep them all in the pen, since they can not have a target outside the pen.
|
|
Jay Karlfeldt
Happy Scripter
Join date: 4 Nov 2005
Posts: 51
|
06-01-2006 03:45
They are to be free ranging in a Desert environment, but I do not want them entering buildings. Also they are to be sold for general use so I cannot determine the enclosure they will be in.
|
|
Rasah Tigereye
"Buckaneer American"
Join date: 30 Nov 2003
Posts: 783
|
06-01-2006 06:22
From: Jay Karlfeldt They are to be free ranging in a Desert environment, but I do not want them entering buildings. Also they are to be sold for general use so I cannot determine the enclosure they will be in. You could set up the fence posts to announce their position on a hidden chat channel when placed on the ground and have the pets listen for them. For instance, you plop down your pet, then plop down the four fence posts, your pet figures out where it is in relation to the posts (greater than or less than positions and such), and uses that as the bounding box. Other options I can think of is making the tail not actually be attached and using a sensor to make the tail follow the rest of the pet. Or, OOH, just thought of an easier way. Just stick a sensor on the pet that scans surrounding areas (or just the area in the direction of movement) within a very short distance every time before it moves for all types of objects. If there is one in front of it, then there's something in front of it 
|
|
Shep Korvin
The Lucky Chair Guy
Join date: 30 Jun 2005
Posts: 305
|
06-01-2006 07:43
Put all your movement logic into an invisible "guide" prim. don't link this to the main animal. Then, simply code your animal to follow the invisible prim, wherever it goes (you'll probably need to put in some failsafe self-destruct/respawn code, for the event that an animal loses contact with it's gude prim - shouldn't be too tricky though)
|
|
Tip Baker
Registered User
Join date: 12 Nov 2005
Posts: 100
|
06-01-2006 07:59
Two other suggestions, You could use llTarget() and not_at_target to tell whether or not the creature needs to turn back. No good for square containment areas tho' or Get into steering behaviours Tip
|