|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
12-16-2007 07:31
heyas;
is there a standardized way of detecting the key of an avatar riding a vehicle through a volume detect thing? when i hit my object while riding, it gets the vehicle key, and not mine at all.
also, i want to ignore objects without avatars. and to top it all off, the avatar riding the vehicle might not always be the vehicle's owner.
is this entering the realm of the impossible, here? :/
_____________________
Why Johnny Can't Rotate: http://forums.secondlife.com/showthread.php?t=94705
|
|
Xhawkx Holden
Registered User
Join date: 1 Nov 2006
Posts: 86
|
12-16-2007 11:03
use: llAvatarOnSitTarget
key llAvatarOnSitTarget(void);
If an avatar is sitting on the sit target, return the avatar's key, NULL_KEY otherwise. This only will detect avatars sitting on sit targets defined with llSitTarget.
You must first define the llSitTarget before you can detect the key of the AV sitting on the object.
you can store the key of the AV riding the vehicle, then use a collision event in the other object to ask this vehicle object who is riding..
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-16-2007 15:29
take the key you get from your collision, and feed it to llGetOwnerKey... if it was a vehicle, it'll return the owner (which may not be the rider) and if it's an av it'll just toss the av key back at you...
I can't think of a clean way to get just the driver, as in the case of vehicles that aren't owned by their riders (rental setups etc)
if it's a controlled environment, you could instead have the vehicle send a message with the seated av's key, or even place it in a description field to be read by colliders
_____________________
| | . "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... | - 
|
|
Xhawkx Holden
Registered User
Join date: 1 Nov 2006
Posts: 86
|
12-16-2007 15:55
You could use a sensor.. and only get Agents... and when a collision is detected.. make the assumption that the closest Agent is the one that just collided...
|
|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
12-17-2007 07:48
heyas;
hawk... llavataronsittarget or whatever it is only works if the avatar is sitting on the object the script is in. otherwise, that'd be perfect.
the getowner if agentsize is zero is working to do a plain avatar or an avatar on his own vehicle.... its pretty slick.
ehhhhh sensors. don't like me. i might try it though. or just have to accept this is a limitation of what i want to do.
oh....
how about this, is this even more impossible? if an avatar is sitting on an object, and touches something.... the touched object can't get the key of what the avatar is sitting on, right? gawd.
hmmm... i suppose i could make a special version that treats the vehicle as the racer. so whoever is sitting in car1.... car2, car3, etc... it just does generic names. that can work, too.
thanks guys!
|