|
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
|
09-22-2008 19:50
Hi team. I wanna use particles on a boat. On when moving, diff params when idle or slow and off when stopped or dismounted. I can only get moving_start and moving_end to work but are quite useless really.
What should I be using?
Sensors to detect movement DetectedVelocity? detected something? or something else or a combo. The magic carpet by Cubby terra uses a timer thing but I can't get that to work properly. Its all very complicated. What should I really try?. Thanks.
_____________________
SCOPE Homes, Bangu -----------------------------------------------------------------
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-23-2008 05:04
You'll need to get the timer to work, and then call llParticleSystem() with settings depending on something like llVecMag() of llGetObjectDetails(..., [OBJECT_VELOCITY]). Don't call it over and over with the same settings, and don't make the timing interval too tight because this has the potential of lagging really badly.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
09-23-2008 08:48
Erm...was there something wrong with plain old llGetVel()? http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetVel
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-23-2008 09:59
That might work. 
|
|
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
|
09-23-2008 17:55
Thanks for the info gentlepeople. llVecMag() is not something I was looking forward to. It looks ominous I should really finish a project before starting a new one. But a workshop isn't a "Workshop" unless it's got some half-finished projects around. Anyway... I don't understand this line from the particle starter in the Magic Carpet script. Why is llGetVel multiplied by 1.94384449 + 0.5? Does 1.94384449 represent something? Also.. is 0.5 seconds about right for the timer? //timer event.. timer() { // Speed integer speed = (integer)(llVecMag(llGetVel()) * 1.94384449 + 0.5); if(speed > 3) { if(!particles_on) { llMessageLinked(LINK_SET, 0, "particles on", ""); particles_on = TRUE; } } else if(speed < 3) { if(!particles_on) { llMessageLinked(LINK_SET, 0, "particles idle", ""); particles_on = TRUE; } } else { { llMessageLinked(LINK_SET, 0, "particles off", ""); particles_on = FALSE; } } }
_____________________
SCOPE Homes, Bangu -----------------------------------------------------------------
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-24-2008 02:52
From: Kornscope Komachi llVecMag() is not something I was looking forward to. It looks ominous It's not. It's just taking a velocity (a vector, with speeds in each of the three dimensions) and turning it into a single speed number--sort of the "as the crow flies" speed. From: someone Why is llGetVel multiplied by 1.94384449 + 0.5? Does 1.94384449 represent something? You got me. It's just converting units from meters/second (in which the magnitude of llGetVel is expressed) into some other system of measurement--but not one with which I'm familiar. It's certainly not feet/second, and unless my arithmetic fails me, for miles/hour it should be about two-and-a-quarter. MilliMach? The airspeed velocity of an unladen sparrow? Anyway, it doesn't matter, inasmuch as you get to choose the constants you'll compare that speed against. If it doesn't look right, you can tweek the cutoff points. (The bit with adding 0.5 is just to make it so truncating the float with the "  integer)" cast results in rounding the number to the nearest integer.) From: someone Also.. is 0.5 seconds about right for the timer? Probably. I'm not crazy about the rest of the code, though. In the case of speed == 3, it will keep sending that "particles off" linked message continuously, until the speed gets up to 4 or down to 2. It's also not immediately obvious to me why the particles should be off at speed 3, and "idle" at lower speeds--but I don't know from magic carpets.
|
|
Kornscope Komachi
Transitional human
Join date: 30 Aug 2006
Posts: 1,041
|
09-24-2008 18:09
Thanks for that reply Qie. It goes some way in clearing up the confusion. I have rewritten all the code and it now seems to work fine enough. Just need to test and tweak a bit more. Now to find some decent boat motor sounds... Thanks team!
_____________________
SCOPE Homes, Bangu -----------------------------------------------------------------
|