Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Activate particles on flight, deactivate on land

Psyra Extraordinaire
Corra Nacunda Chieftain
Join date: 24 Jul 2004
Posts: 1,533
08-20-2004 18:50
Is this possible? Basically, a light particle trail on one of my attachments, I'd like it to automatically turn on when I enter fly mode, and disable again when I land. Right now I've got to use two seperate attachments, one with the particles on, one without, and manually switch them when I switch to fly... which is really ugly. Hee. Is there a quick script to either turn on/off particles, or swap attachments in a position when switching from walking to flying and vice versa? :)

Thanks in advance for... well... anything. :D

-Psyra-
_____________________
E-Mail Psyra at psyralbakor_at_yahoo_dot_com, Visit my Webpage at www.psyra.ca :)

Visit me in-world at the Avaria sims, in Grendel's Children! ^^
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
08-20-2004 19:34
Well, maybe it's a bit unwieldly and someone here can suggest a better method, but I usually have a timer firing every two seconds or so, checking againt ( llGetAgentInfo( llGetOwner() ) & AGENT_FLYING )

If it's true, then call your happy llParticleSystem() thingie. If it's not true, then call llParticleSystem([]);

I imagine instead of using a timer one could probably use land_collision_end() or some crazy thing like that, I dunno. I'm not exactly an efficient coder. ^^

CODE


particlesystemfunction()
{
// Your cute particle system code goes here as a function!
}

default
{
state_entry()
{
llSetTimerEvent( 2 ) ;
}

timer()
{
if( llGetAgentInfo( llGetOwner() ) & AGENT_FLYING )
{
particlesystemfunction() ;
}

else
{
llParticleSystem( [] ) ;
}
}
}

_____________________
- 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?"
Psyra Extraordinaire
Corra Nacunda Chieftain
Join date: 24 Jul 2004
Posts: 1,533
Eeeeeee. :(
08-20-2004 19:59
Ahhhh, yeah, it was a challenge to incorporate it, but it worked! MANY THANKS! :D
_____________________
E-Mail Psyra at psyralbakor_at_yahoo_dot_com, Visit my Webpage at www.psyra.ca :)

Visit me in-world at the Avaria sims, in Grendel's Children! ^^
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
08-20-2004 22:14
Most welcome! Hehe, it's more or less what I used on my daemoney wings-things. :)
_____________________
- 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?"
Wraith Jensen
I can walk thru walls....
Join date: 8 Aug 2004
Posts: 130
08-20-2004 22:33
I use the same thing on my jetpack. It "unfolds" the wings (turns the alpha up from 0) and turns on the particles on the thrusters all at once.
_____________________
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
08-21-2004 08:22
So the way Cross posted will work, but it will send a lot of unnecessary data to your client (and everyone nearby) every 2 seconds. This one would be better:

CODE
integer isFlying = FALSE;

particlesystemfunction()
{
// Your cute particle system code goes here as a function!
}

default
{
state_entry()
{
llSetTimerEvent( 2 ) ;
}

timer()
{
if( (llGetAgentInfo( llGetOwner() ) & AGENT_FLYING) && !isFlying )
{
particlesystemfunction() ;
isFlying = TRUE;
}

else if( !(llGetAgentInfo( llGetOwner() ) & AGENT_FLYING) && isFlying )
{
llParticleSystem( [] ) ;
isFlying = FALSE;
}
}
}
Why? Because everytime you call the llParticleSystem(...) it sends all that information to everyone nearby, however the particle system is designed to keep goign with only 1 call. This way the system is called only when you change modes - when you start or stop flying.
_____________________
--
010000010110110101100001001000000100111101101101011001010110011101100001
--
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
See??
08-21-2004 13:16
I told you somoene smarter'n me would come along. ^^
_____________________
- 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?"
Tessa Tyne
Registered User
Join date: 10 Jun 2005
Posts: 1
08-05-2005 15:10
Well i just found this and chopped it apart and cramed it into my fun new jet pack.... man you guys are good!!!