Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Volume Detect Movement help?

Tokay Slade
Registered User
Join date: 18 Nov 2007
Posts: 7
10-03-2009 19:52
My objective is to have a moving object that can collide, while being phantom.

Because of the issues I've heard of with Volume Detect and Physical.. I decided that this would not be what I would go with.. Though, please correct me if it is.

Currently, my prim moves in a setpos for loop, with llVolumeDetect(FALSE); before llSetPos(), and llVolumeDetect(TRUE); after it, within the loop.

The problem occurs when I try to walk into the object. It should say something when I do, and I have tried both on collision() and collision_start() events.. neither produce a message unless the object has ceased all movement.

Can anyone think of a more productive, or more successful way?
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-03-2009 20:37
From: Tokay Slade
neither produce a message unless the object has ceased all movement.

this is because you are in a loop, nothing else will function until the loop is finished
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Tokay Slade
Registered User
Join date: 18 Nov 2007
Posts: 7
10-03-2009 22:41
Any suggestions, then, as to how I might achieve my end goal?
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
10-04-2009 00:24
Put the movement in a timer event so that it has time to process other events such as collision.
Myrmidon Hasp
Registered User
Join date: 7 Dec 2004
Posts: 1
10-04-2009 00:25
Use a second script for the detection part, but, from what I know, if a prim uses llSetPos() to move into a collision event it doesn't trigger a collision unless it's at a stop and something collides with it.
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
10-04-2009 00:57
Which should work using either a timer event for movement or a separate script for collision detection. The avatar's movement should generate an interpenetration and be detected by volume detect during a rest period between llSetPos() being activated. As long as there's a long enough pause between calls to llSetPos to allow a moving object to generate a new collision event. Collisions with stationary objects likely will be ignored completely though.

I would also check for collision not in collision_start or collision_end but in collision.
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
10-04-2009 04:21
A few points and ideas.

The problem with physics and volume detect is it falls through the ground, but you can use llSetBuoyancy to overcome this.

Volume detect does not work during llSetPos

Volume detect does not register a collision event, only collision_start and collision_end.

I just tried this VERY basic script in world at it seems to do what you want.

This is not a finished script by any means, i throw it in for discussion.

CODE


default
{
state_entry()
{
llSetStatus(STATUS_PHYSICS, TRUE);
llSetBuoyancy(1.0);
llVolumeDetect(TRUE);
}
touch_start(integer total_number)
{
llMoveToTarget(llGetPos() + <10.0, 0.0, 0.0>, 1.0);
}
collision_start(integer total_number)
{
llSay(0, "Impact");
}
}

Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
10-04-2009 07:30
From: Beverly Ultsch
...script...

/me suggests calling llSetBuoyancy before llSetStatus - less chance of the object dropping on a laggy sim..
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
10-04-2009 07:51
/me agrees
Tokay Slade
Registered User
Join date: 18 Nov 2007
Posts: 7
10-04-2009 09:46
From: Beverly Ultsch
A few points and ideas.

The problem with physics and volume detect is it falls through the ground, but you can use llSetBuoyancy to overcome this.

Volume detect does not work during llSetPos

Volume detect does not register a collision event, only collision_start and collision_end.

I just tried this VERY basic script in world at it seems to do what you want.

This is not a finished script by any means, i throw it in for discussion.

[Script]

Wow, that was a big help. Thanks!
Note, just to clarify what I had meant earlier (though it matters little at this point), I had the for() for the llSetPos() saying llVolumeDetect(FALSE) before, and llVolumeDetect(TRUE) after so that the 'glitch' that occurs with llSetPos() wouldn't happen.
Now, of course, I see my fault. ^^ I love you guys. O.o