|
BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
|
06-15-2007 10:38
What is the most efficient way to tell when the owner of a multiple passenger vehicle has UNseated themselves? (stood up).
It's for a vehicle; when the owner gets up, the engine stops, regardless of what the passengers do.
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
06-15-2007 11:09
It may depend on how the whole thing is currently scripted, but a straightforward way would be to have each sit target script keep track of who is sitting on them. When someone gets up (detected via the changed event and llAvatarOnSitTarget) you can check the variable you stored the sitter in when they sat down. if it was the owner, do what is needed to disable the vehicle.
|
|
BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
|
06-15-2007 21:17
That's the part i'm having trouble with. Should I be using global variables? Or listeners? or a linkage scan? or what? I assume some reference will need to be made to: LlMessageLinked and probably llGetNumberOfPrims.... or should I just on_change scan the entire linkset with LlGetLinkKey for the owner's key? Should I assume that function would return av keys as well as prims?
Obviously I'm going to run some tests myself, but it seems like a trivial function that somebody has surely already written.
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
06-15-2007 22:45
Well the simplest way is to detect CHANGED_LINK and discover that llAvatarOnSitTarget() == NULL_KEY. In your case you'll need to remember (in a global variable) who was sitting there last and if the owner, stop the engines with a link message from your seat to the vehicle control script. The issues come when the event fails to register in a severely lagged sim, but it'll work most of the time. 
_____________________
http://slurl.com/secondlife/Together
|
|
BETLOG Hax
Geek
Join date: 22 May 2007
Posts: 91
|
06-16-2007 00:00
How does each seat remember who is sitting on it? Using a global *list* or something?
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
06-16-2007 00:03
The seats would be all linked? Then use either LINK_CHILDREN or LINK_ROOT to pass the info with llMessageLinked.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-16-2007 04:53
Actually, the seated avatars will become part of the linkset, right? So if the changed() CHANGED_LINK event in the root prim can't find the owner among the links...
|
|
Selesnya Fermi
Registered User
Join date: 13 Jun 2006
Posts: 1
|
06-16-2007 17:19
You can't drive a car from the backseat, you can't fly an airplane from Seat F3, why do you need a list of seats, shouldn't (for most vehicles) there be only one seat that needs to be checked.
|