|
Bilbo Goodliffe
all around good guy
Join date: 30 Dec 2005
Posts: 22
|
02-18-2007 18:37
default { state_entry() {
llListen( 0, "", llGetOwner(), "" ); }
listen( integer channel, string name, key id, string message ) { message = llToLower(message); if ( message == "pull" ) { llWhisper( 0, "deploying" ); llMessageLinked(LINK_SET,0,"deploy",NULL_KEY); llSetBuoyancy(0.5); } } }
any help would be great thanks
|
|
Elsewhere Essex
Registered User
Join date: 8 Sep 2006
Posts: 50
|
02-18-2007 20:10
hmmmm, does llSetBuoyancy() even work in attachments? i think you need to detect the avatar "Falling" state and use llApplyImpulse inversly proportional to the avatar falling. or maybe llSetForce() setting a drag or resistance to falling
|
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
02-19-2007 00:26
I guess llSetBuoyancy(0.5); is too weak to react against the falling force. What about doing that line like this? integer i; for(i = 0; i < 5; i++) { llSetBuoyancy(4.9 - i); llSleep(0.5); }
_____________________
 Seagel Neville 
|
|
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
|
03-28-2008 07:57
This will work you just need to increase the buoyancy value...and possibly make it physical...can't remember...certainly use a buoyacy value of 0.8 or so to counteract falling speed
_____________________
Tread softly upon the Earth for you walk on my face.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-28-2008 10:10
If a physical object or avatar has a force applied to it, it will continue to accelerate (go faster). Setting buoyancy to 0.5 only reduces the force applied, not eliminate it. So your avatar will still accelerate, and will eventually still fall as fast as it did without the scipt (unless maybe they dynamically calculate terminal velocity based on applied force, but I really doubt they've done that), but it'll take longer/farther before you get to that speed. The time it takes to fall a certain distance should be affected, but not linearly (it should actually take sqrt(2) times the falling time without the script, not 2 times it--as long as you haven't yet reached crticial velocity, that is). If you want to limit SPEED, you'll want to set buoyancy to 1.0 (or force to <0.0, 0.0, 9.8*llGetMass()>  once you reach the desired maximum falling speed, and you'll probably have to test that with a timer. That will keep the avatar from accelerating further once you've reached your desired "terminal velocity", rather than when you've reached the one predetermined by LL.
|
|
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
|
03-28-2008 14:47
Yup..I agree having played around a bit this afternoon. Buoyancy will slow how fast you fall off of an edge but if you turn it on part way trough a fall you already have the inertia and will continue at speed.
_____________________
Tread softly upon the Earth for you walk on my face.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
03-28-2008 15:10
If you want to limit terminal velocity, it is necessary to have a timer applying a reverse force, which applies when the avatar is falling. Which is awkward and laggy but sometimes the only mechanism.
float TERMINAL_VELOCITY = 5.0;
timer() { vector vel = llGetVel(); vector speed = llVecMag(vel); if (speed > TERMINAL_VELOCITY) { llApplyImpulse(llVecNorm(vel) * (TERMINAL_VELOCITY - speed) * llGetMass(), FALSE); } }
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|