Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

vehicle passenger sit, unsit, and control

Coal Porter
Owner CP Motors
Join date: 26 Mar 2008
Posts: 37
05-11-2008 08:48
Hello,

I've been scripting for about 2 months. Mostly a Franken-scripter. I've been looking around and cant quite find what i need.

How do i script a passenger seat that ask the owners permission for the passenger to board, allows owner to eject a sitting passenger, and also allows owner to pass controls of the vehicle and take controls from a passenger.

any helpful code snippets would be great. thank you
Coal Porter
Owner CP Motors
Join date: 26 Mar 2008
Posts: 37
05-11-2008 15:03
anyone know of any full perm freebies that have those functions?
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
05-11-2008 15:42
No, I don't know of any free items that do this.

It is all possible, but varies as to trickiness. Asking for owner permission beforehand and allowing the owner to unsit is fairly straightforward - all that one needs to do is set a listen for commands from the owner, then send a message to the owner whenever anybody sits on the vehicle (in the changed() event) instead of immediately requesting permissions. The llRequestPermissions call would only take place on receiving a response from the owner.

Similarly, the listen() event could respond to the owner saying "unsit" by triggering llUnsit on the av currently on the sit target.

Changing controls would be slightly more sophisticated. You would need to release controls from the sitter when hearing an owner command, then request to take controls from the owner. Note that it's very difficult to actually have a script that controls a remote vehicle that works properly unless you also do a lot of camera scripting.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names