llBreakAllLinks buggy?
|
Dan Medici
Registered User
Join date: 25 Jan 2004
Posts: 132
|
11-20-2004 14:09
I've recently tried to make a plane that "blows up" when a certain event happens. So far, it works decent. It undoes all the vehicle parameters, so that once it becomes damaged, you stay in the plane, and it falls with whatever momentum it had when you last controlled it. (think Battlefield 1942; I even made the debree turn black-ish  )When it hits the ground, it does the following (In order): releases controls, boots you off, breaks all links, and is supposed to apply an impulse to every piece nearby through a loop to try and make them "explode" more. Every time I test it, my controls don't get released until 5 seconds after the link breaks for some reason... also, sometimes the impulses work, and sometimes it just breaks apart. Another problem is, sometimes, not all the pieces always fall apart. Even though they have physics on them, sometimes, 60% of the prims will just stay there and not fall until I select them, even if an impulse gets applied... and SOMETIMES, the whole thing works completely fine. Anyone know if these problems are because of the llBreakAllLinks function, or what?
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
11-20-2004 15:42
It sounds like multiple visitations by Our Lady of Lag, to me.  Say, how are you applying impulse to the 'fragments' after they're unlinked? llApplyImpulse() in a script in each one, or a sensor and llPushObject()? I wonder if you might be better served by having the plane die on impact, rezzing a dummy 'exploding plane' group of unlinked prims, and scattering those to the wind?
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|
Dan Medici
Registered User
Join date: 25 Jan 2004
Posts: 132
|
11-20-2004 17:03
That's also a good idea. This is how I'm scattering my pieces:
//after sensor call
sensor(integer c) { integer x; for(x=0;x<=c;x++) { llPushObject(llDetectedKey(x), <100,100,100>, <0,0,0>, FALSE); } }
And no, it is not lag. I tried it in the vehicle sims (no objects at all), and it still acted extremely strangely.
|
Meiyo Sojourner
Barren Land Hater
Join date: 17 Jul 2004
Posts: 144
|
11-20-2004 18:05
From: Dan Medici Even though they have physics on them, sometimes, 60% of the prims will just stay there and not fall until I select them... If I remember correctly, this is simply a limitation of the physics engine. I think I read this somewhere in the thread that was started way back when it was originally announced that they were working on implementing Havok 2. EDIT TO ADD: i have hardly ever used the pushobject function but if I'm understanding your set up right, if you're flinging all pieces away from a central piece that contains the sensor and push function, shouldn't you push function look like this so the pieces scatter in a direction relative to the central point? llPushObject( llDetectedKey(x), alpha * (llDetectedPos(x) - llGetPos()), <0, 0, 0>, FALSE); where alpha is your magnitude of the force applied and can be defined at the beginning of the script like: float alpha = 100.0; -Meiyo
_____________________
I was just pondering the immortal words of Socrates when he said... "I drank what??"
|
ramon Kothari
FIC
Join date: 9 Dec 2002
Posts: 249
|
11-20-2004 18:58
from experience ....it could be the way the parts are linked together , i had this happen with the demolition cars i have , took alot to figure it out but if one wrong piece interpenetrates wrong it messes up the physics engine and things dont explode excactly the way you want them too
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
11-21-2004 11:59
I've also noticed weirdness with the sensor/llPushObject combo. In some cases, even though the sensor does detect an object, and fires off the sensor() event, llPushObject of-times doesn't take on the first try, and the object will just sit there. Anytime I'm making a push-sensor, I always use a for loop to throw several llPushObjects for each object being shoved.
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
|
11-22-2004 02:47
i dunno if you tried doing that without pushing the pieces with a script but whenever i unlink a physical object it explodes like nobody's business even without me adding any push.
|