Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

triggering an event once avatar passes a certain speed

SqueezeOne Pow
World Changer
Join date: 21 Dec 2005
Posts: 1,437
07-06-2007 14:16
I'm trying to put together a script that has dust particles come off the av's feet when it runs.

Is it possible to make it so it'll start up once it goes past a certain speed? I ask this because I am going to be putting together a faster-than-normal avatar running script in this as well and I want to try to have the option of choosing how fast you go and have that affect the amounts and types of particles coming out.

I'd try to figure it out myself but I really don't know where to begin and the lsl wiki sucks now so it's no help like it was a year ago.

Anyway thanks for the help in advance!
_____________________
Semper Fly
-S1. Pow

"Violence is Art by another means"

Visit Squeeze One Plaza in Osteria. Come for the robots, stay for the view!http://slurl.com/secondlife/Osteria/160.331/203.881
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-06-2007 14:47
From: SqueezeOne Pow
...and the lsl wiki sucks now so it's no help like it was a year ago.
Perhaps I missed its days of glory, but lslwiki.net seems just an updated version of what I remember from a year ago (wherever it was, back then). The "official" wiki off the LSL Portal, on the other hand... well, "modest further effort would be readily apparent."

As for the actual question, hmmm... well, there are moving_start and moving_end events that might be used to control a timer that sampled positions to calculate speed. Or there's llDetectedVel(), but not sure how one could regularly "detect" the avatar to which the script is attached, cuz I'm pretty sure a sensor can't detect the agent to which it's attached.
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-06-2007 14:59
can't you just use a timer and llGetVel() as an attachment is also moving with respect to the world if attached?

"Returns the current velocity of an object in meters/second, relative to the simulator axes."

It might be as easy as that, but I don't think there is an explicit event you could use, monitoring with timer or sensor (though as Qie points out this might not work) is probably the only alternative.
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
07-06-2007 15:21
That's right, there is no "event" you can trigger when your speed reaches a certain threshold, so you'll have to poll for it on a timer.

However it seems to me that if your script is accelerating the agent's movement, you already have the information you need when you trigger the movement.