Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Limit a moving object to water's surface?

Randolph Peccable
Registered User
Join date: 12 Jul 2007
Posts: 20
07-25-2007 08:51
Please be gentle with a newbie.

I have an object (a duck, in fact) that I'd like to animate swimming around my property. Thus, I need to do two things:

1. Limit duckie to the plane of the water; and
2. allow him to recognize when he hits dry land so he can turn.

I'm stumped at how to accomplish this. Is there some easy way to detect whether an object is in/on water?

Thank you for your time.
Scott Tureaud
market base?
Join date: 7 Jun 2007
Posts: 224
07-25-2007 09:06
use llSetHover(REALY_LOW_NUMBER, TRUE(this is setting it so it hovers above water instead of land), 1); it will be extremely difficult to force it above and below that point- need physics on.

land_collision_start() //phantom objects still collide with land, or you could use normal collision if it wasn't phantom
{
//change direction code
}

and so the duck doesn't say appear to crash into the land you can use transparent prims
Randolph Peccable
Registered User
Join date: 12 Jul 2007
Posts: 20
07-25-2007 10:42
Thanks very much! I see what you're saying.

Now, does anyone have insight into keeping a roving object within one's own property limits? I can't find a function or script that does this.

Thanks again.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
07-25-2007 11:20
From: Randolph Peccable
Thanks very much! I see what you're saying.

Now, does anyone have insight into keeping a roving object within one's own property limits? I can't find a function or script that does this.

Thanks again.

you'll need to do a llGetLandOwnerAt() command periodically to check where it's at. for my bots, they usually have a way-point set (whether randomly generated or set locations). in the case of the randomly generated waypoints, the bot will check when the waypoint is generated whether or not the waypoint is on my property. If not, it generates a new one.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.