Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Collision Event: Which *direction* does it work in?

Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
11-04-2007 11:46
Collision question:

KK I know direction a confusing word there, but hang in, you'll see what I mean:

Wiki says a collision event is triggered when an object or avatar collides with the object the script is attached to. I gather then that the reverse is *not* true, that a collision event is *not* raised when the object containing the script collides with an avatar....?

Scenario.

I have a door. It is not physical, nor phantom, just a regular prim, 1 prim.

I am telling it to open upon collision event. If i walk into it, it opens. However, if it stand in its way while it is auto closing, it closes right through me and doesn't sense me at all, no change in its behaviour. I was actually hoping that if it sensed it was closing *into* me, colliding into me, (okay, squishing me :} ) that it would re-open.
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-04-2007 12:40
From: Chaz Longstaff
Collision question:

KK I know direction a confusing word there, but hang in, you'll see what I mean:

Wiki says a collision event is triggered when an object or avatar collides with the object the script is attached to. I gather then that the reverse is *not* true, that a collision event is *not* raised when the object containing the script collides with an avatar....?

Scenario.

I have a door. It is not physical, nor phantom, just a regular prim, 1 prim.

I am telling it to open upon collision event. If i walk into it, it opens. However, if it stand in its way while it is auto closing, it closes right through me and doesn't sense me at all, no change in its behaviour. I was actually hoping that if it sensed it was closing *into* me, colliding into me, (okay, squishing me :} ) that it would re-open.

In many cases, your avatar has 'settled,' and isn't really able to collide with it during the process of closing, mostly because the door isn't physical either. Watch what happens when you do the same thing while you are turning in place, or try talking after the door closes on top of you. It'll collide then, because your avatar 'unsettles' and checks whether it's actually colliding with things.
_____________________
Kage Seraph
I Dig Giant Mecha
Join date: 3 Nov 2004
Posts: 513
11-05-2007 12:21
Could you not fire off a short range, long interval llSensorRepeat and check for avatar presence?
_____________________
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
11-05-2007 15:36
From: Kage Seraph
Could you not fire off a short range, long interval llSensorRepeat and check for avatar presence?


yeah, i just wanted to avoid having a sensor running day in and day out in my sim. Thanks for the idea tho!

The collision stuff is working now; you just wait till they squirm, as Tyken said, and that kicks it off.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-06-2007 00:46
From: Chaz Longstaff
yeah, i just wanted to avoid having a sensor running day in and day out in my sim. Thanks for the idea tho!

The collision stuff is working now; you just wait till they squirm, as Tyken said, and that kicks it off.

actually you could fire a single sensor before it closes, then only close in the no_sensor event
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
11-06-2007 00:59
Instead of a sensor and if you can spare another prim then Volume Detect is probably your best bet. You could rez a cube the size of your door but slightly thicker and when your door wishes to close (i.e. after a timer or on touch event) it pings the volume detect prim to ask if the area is clear to close. You could also replace the collision detection with the volume detect if you wish.
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Kage Seraph
I Dig Giant Mecha
Join date: 3 Nov 2004
Posts: 513
11-06-2007 12:34
Void singer and Nand both have valid solutions. A sensor event or two won't torpedo the sim.
_____________________