Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Particle trail

Paul Wardark
Wait, what?
Join date: 10 Jan 2009
Posts: 383
06-18-2009 16:25
I'm trying to create a particle trail from an attachment, that activates on flight. However, the only ways I can seem to find to do it use the timer, which I'm told can lag a place pretty bad. Anyone have any suggestions to make this work?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-18-2009 17:38
do a drop particle and turn it on when they are moving and flying, off otherwise

essentially use two state... one for flying one for not, and moving start/end in the flying state... check flying in moving start in the off state, and check it again in the move end in the flying state
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
06-18-2009 17:46
It will work the same way an AO works. You use llGetAgentInfo inside a timer to find out what the av is doing. Turn the particles on in an if test for:

if (llGetAgentInfo(llDetectedKey(i)) & AGENT_FLYING)

if the test fails, then turn the particles off.

http://lslwiki.net/lslwiki/wakka.php?wakka=llGetAgentInfo
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-18-2009 18:06
testing from moving/not moving will cut down on some of the polling
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
06-18-2009 19:34
i'm wondering, would using controls be laggier/better than a timer? when one of the controls is pressed it could do the same thing as when the timer goes off, but doesn't do anything really when there's no controls used.....

edit: just thought about that some more after i said that. i guess the timer is needed to continue checking the status, since with a control, it would only check the status when the control is pressed, so with nothing to check the status, whatever animations/particles were started would continue when not wanted/needed
_____________________
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
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-19-2009 08:21
From: Ruthven Willenov
i'm wondering, would using controls be laggier/better than a timer? when one of the controls is pressed it could do the same thing as when the timer goes off, but doesn't do anything really when there's no controls used.....

edit: just thought about that some more after i said that. i guess the timer is needed to continue checking the status, since with a control, it would only check the status when the control is pressed, so with nothing to check the status, whatever animations/particles were started would continue when not wanted/needed

actually no, controls get events when the button is pressed, held, and released, so it COULD be effective (use edge to check status much like you would moving_start/end). again, no timer needed, and the additional free benefit of working in no script areas (although you'll have to be careful of what you check, since turning of fly can be done from the menu bar)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-19-2009 10:14
I don't know that controls will help, because controls can be used when flying or not flying and collisions can also cause your avatar to move. You probably won't want to take the controls 100% of the time as well (when the avatar is walking and sitting?), so I think the timer is the nicer of the options in this case. I've also been told on many occasions that 'moving_start' and 'moving_end' have been very unreliable for a long time, though I haven't tested them recently myself.

Timers themselves don't cause much lag. It's what is done with them that can make a difference. Don't make the timer extremely small in period (i.e. every 0.5-1.0 seconds is probably sufficient for this application; no need for a 0.05 second timer), and do as little as possible in the timer. For example, keep a flag around that tells you whether the particles were already on or not, and if the state of the avatar hasn't changed in a way that should trigger a CHANGE in the particles, return without making any llParticleSystem() calls.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-19-2009 13:03
you don't have to take over the control, just capture them, and it'd only be a place to test from, so that you aren't testing constantly
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-19-2009 13:07
I use controls *and* a slow timer in the Flight Feather, because controls won't detect when you click the "fly"/"stop flying" button.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-19-2009 13:44
From: Argent Stonecutter
I use controls *and* a slow timer in the Flight Feather, because controls won't detect when you click the "fly"/"stop flying" button.

yeah that's kinda why I favor the moving events myself
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
06-19-2009 17:19
But what would cause more event triggers? someone who is walking on the ground or a timer, would be a balance thing I'd assume..... something to keep in mind if you use the moving events
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-19-2009 20:24
From: Lazink Maeterlinck
But what would cause more event triggers? someone who is walking on the ground or a timer, would be a balance thing I'd assume..... something to keep in mind if you use the moving events

well I wouldn't use moving... just the start and end ones... but they have their own host of issues with not triggering in certain situations last I checked so... I guess it falls down to how often you check those timers, or haw active you av is in start stop situations...

of course most people already have one fast timer going, and it's a small thing to add a line to an an AO that spits out the current av status on on a large negative channel for all devises to catch....
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
06-19-2009 21:37
From: Void Singer
of course most people already have one fast timer going, and it's a small thing to add a line to an an AO that spits out the current av status on on a large negative channel for all devises to catch....


Yep, was just a warning to think about which way would be best to implement what they want. To look at the benefits vs costs of each way to do it. All a part of the fun of scripting :)
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-20-2009 10:27
From: Void Singer
well I wouldn't use moving... just the start and end ones... but they have their own host of issues with not triggering in certain situations last I checked so... I guess it falls down to how often you check those timers, or haw active you av is in start stop situations...

of course most people already have one fast timer going, and it's a small thing to add a line to an an AO that spits out the current av status on on a large negative channel for all devises to catch....

That's an interesting possibility. And if it only chats when the status CHANGES....
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-20-2009 10:48
Even if you use moving start and end, you still need a timer, because you don't always stop or start moving when you stop or start flying.

Flight feather is using controls anyway, so it just runs a slow timer checking for a status change when it's not active. When it is active it's running a faster timer anyway to maintain the feedback.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-21-2009 00:03
From: Argent Stonecutter
Even if you use moving start and end, you still need a timer, because you don't always stop or start moving when you stop or start flying.

Flight feather is using controls anyway, so it just runs a slow timer checking for a status change when it's not active. When it is active it's running a faster timer anyway to maintain the feedback.

doesn't moving start trigger for falling?
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-21-2009 04:48
From: Void Singer
doesn't moving start trigger for falling?
If you were already moving?
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-21-2009 06:56
From: Argent Stonecutter
If you were already moving?

well no... but it'd catch it at moving stop... because IIRC the viewer (or server I'm not sure) stops you if you land, not 100% sure about soft landings though.

technically you'd still be in the air =X
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
06-21-2009 07:00
From: Argent Stonecutter
If you were already moving?

Two years ago I investigating making a friendlier AO. moving_start, moving_end and the changed events just really are not very reliable, as opposed to just checking in a timer event.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-21-2009 07:51
From: Jesse Barnett
Two years ago I investigating making a friendlier AO. moving_start, moving_end and the changed events just really are not very reliable, as opposed to just checking in a timer event.
That's what I found out, too. They can augment a slow timer but you can't get away without any timer at all.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-21-2009 10:06
If the moving events DID work reliably, you could use them to start and stop a timer, so that you aren't making use of one ALL the time.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
06-21-2009 10:10
If they worked reliably and triggered when you changed state, you wouldn't need a timer at all. The unreliability is that you don't necessarily stop or start moving when you stop and start flying, so you don't know when to stop or start the timer. :)
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore