Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Elevator Call Buttons and Collision Detection

Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
10-11-2005 10:15
I'm using Hank Ramos' "Elevator in a Box" kit (thank you, Hank!!!). I've been making some modifications because I'd like to add a bit of functionality. Wondering if folks might be willing to share a bit of wisdom on the following?

1) Call Buttons -- Ideally, I'd like to have:
  1. a set of buttons outside of the elevator shaft on each floor that allows people to call an elevator to go up, or down, as in the real world, and

  2. a set inside the elevator car itself that allows them to choose which floor.

Finding this thread helpful:

/8/0c/21019/1.html

though there's no response to the code that Bill Stirling posted on August 20/04, so I don't know about the efficacy?

My elevator is only about 14 meters high. I'm assuming that it's therefore okay for me to use "say", rather than "shout"? Also assuming I need to mindful of channels and avoid doing this on 0.

2) Collision detection -- right now, there are no doors on the elevator entrances at each floor, so someone could step into the bottom of the shaft when the elevator is up on another floor, and get crunched as it comes down. Two problems:
  1. a) Avatar sensor -- where people may accidentally walk into the open shafts, I'm assuming I need to cobble something together using the collision_start event, and the llDetectedType and llRequestAgentInformation functions in order to tell the elevator car to reverse and head back up to the previous floor if it hits an avatar below it? (and nothing, I suppose, if it hits them above it as they'll just go back up for the ride)

  2. b) Door sensor -- I'd like to add doors to the shaft with a sensor that prevents them from opening until the elevator car is at that floor. Problem is that the elevator shaft and car have no relationship (not linked, so there's no child/parent, which I'm assuming nixes the sensor function, unless I'm just being an idiot?). If I implement the call buttons on each floor, then it goes to reason that I should be able to put a little code into the car's arrival to also open the doors for that floor, and not close them until it moves on?

So my scripting prowess leaves something to be desired to say the least ;^) I'm learning as I go, but I'm a little stumped about the best way to approach this, and would be tremendously grateful for any insight folks might be willing to share along the way.

Thanks a bunch!

Sue.
_____________________
Lit Noir
Arrant Knave
Join date: 3 Jan 2004
Posts: 260
10-11-2005 12:31
Well, at work and feeling sick, so I hope I'm not stating the obvious and that this makes some kind of sense.

Well, for avoiding avs walking into open shafts (without doors to block them). One could have a floor prim in the shaft. As the elevator approaches, the prim will derez to not block the car. I was thinking of using collisions and one solid floor prim and two detector prims, course, but this would mix phantom and solid, so that's a no go. You could build listeners into the floor prims that derez when the elevator says it coming down (or up). Not as sim friendly, but it should work. Since the elevator needs to be able to derez the floors whether an av is standing on them or not, I think listens are going to be the way to go.

As for the doors, a sensor could work from the callbox, but to be fairly responsive the sensor would be firing pretty frequently, and a listen in the call box (with a whisper in the elevator when it reaches the floor) may be slightly more efficient. Of course, with doors, may need need the shaft floors at all.

Okay, let me try to make more sense. As much as folks need to try to avoid unnecessary listens, given that the alternative seems to be sensors firing pretty rapidly, listens might be the least bad alternative. The trick will be to minimize the number of listens then obviously. The elevator would need one, and each call box. If you link the the shaft floor prim (or doors) with that floor's call box, the elevator can say it's going down or up, and each call box knows to clear the shaft floor (if using one) if the elevator is coming their way (no point in having the fourth floor clear the way if the elevator is going from 3 to 2 of course). This can be done by turning the whole call box-floor prim set phantom, or just rotating the floor prim flush against the elevator shaft and not obstructing the elevator car.

I'll be around tonight (East Coast time) so IM me if you like, hopefully I'll be more lucid in a few hours.

ETA: Actually, if the height of the elevator is only 14m, might be able to have all the callboxes, doors and floor prims in one set with just one listen. Maybe.
Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
Thanks!
10-11-2005 15:38
Thanks a bunch, Lit, for sharing your thinking on the best way to approach this.

This will be implemented on a private island SIM that I own, where there is (at present) virtually no lag, so perhaps the listens on this won't be as bad as they might be on the mainland (or at least I won't be ticking the neighbours off ;^)

Going back in to kick the tires on it again ...

Thanks!

(... and sorry to hear you're sick :( )
_____________________
Lit Noir
Arrant Knave
Join date: 3 Jan 2004
Posts: 260
10-11-2005 17:16
No problem. Oh yeah, one other thought, a non-physical elevator would avoid a lot of these problems since they would go through solid prims. For 14m, it might not be too jerky, but up to you.
Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
Solved
10-16-2005 06:43
I thought I should follow up since other people may read this thread if they find it in a search somewhere down the road.

I did finish the elevator the day of the last posting, and it works wonderfully. I ended up putting a panel with floor buttons on the elevator car itself. I also put a call button outside of the elevator on each floor. I decided to leave the shaft open and not complicate it with doors. This is one time when simpler seemed better.

If anyone wants a copy of the complete functioning elevator (including call buttons), IM me inworld, and I'll send you a copy. Keep in mind that you will have to adjust the scripts in each of the objects to match the coordinates of your own locale (which is probably why Hank didn't include the call buttons in his kit along with the elevator platform and shaft, because it's likely to cause a lot of confusion).

I'll add a landmark to it here when I open the island this week in case people want to see how I've implemented it and try it out.

Thanks, Lit, for your help :^)

Sue.
_____________________
Kimi Anubis
Registered User
Join date: 21 Jun 2004
Posts: 2
10-16-2005 08:25
From: Lit Noir
No problem. Oh yeah, one other thought, a non-physical elevator would avoid a lot of these problems since they would go through solid prims. For 14m, it might not be too jerky, but up to you.


I would very much like to know how to do a non physical elevator. In our businesses my family and I have had horrible problems with griefers knocking our physical elevators to kingdom come. SOmetimes we find them and sometimes not. We have been reported to lindens before because they turned up several sims away or were making noise because they wanted to go up and couldn't.

Any help at all would be very much appreciated.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
10-16-2005 10:58
Essentially you replace the llMoveToTarget bits with llSetPos bits. Can I suggest http://secondlife.com/badgeo/wakka.php?wakka=dynamics as a good place to start.

You'll have to hack some of the rest of the code around too, but llSetPos is non-physical movement, but it's also a bit jerky - you tp in up to 10m steps rather than actually flying.

You could also put in something that checks the land the elevator is over and a die command if it's not over your land on a moderately slow timer (every 10 minutes say).
Bill Martin
Registered User
Join date: 15 Sep 2005
Posts: 2
10-21-2005 07:30
I believe I used the same elevator in a box. What I did to deal with being crunched, is add a prim for the bottom of the shaft. Upon collision with this prim, which only happens when an av walks underneath the car, it sends the goto floor command to go to the floor above it.

Also, for call buttons, I actually scripted the communications into the elevator shaft itself. This means if the elevator goes up 15 floors, then even if the elevator is at top floor, and you are at bottom, instead of the call button shouting the command, it just gets passed to the shaft, which then passes the call all the way up the shaft, and where ever the elevator is, it receives the call.

Once the elevator receives its call, it shuts off all but one emergency listen channel. The emergency listen channel is for those underneath the car.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
10-21-2005 10:31
From: Kimi Anubis
I would very much like to know how to do a non physical elevator. In our businesses my family and I have had horrible problems with griefers knocking our physical elevators to kingdom come. SOmetimes we find them and sometimes not. We have been reported to lindens before because they turned up several sims away or were making noise because they wanted to go up and couldn't.

Any help at all would be very much appreciated.


There are a number of problems with nonphysical elevators, the main one being their inability to "drag" the avatars standing on top of them along for the ride. If an avatar is standing on top of an elevator heading to a floor above, the elevator will go straight through the avatar. What you need is an elevator that sets itself nonphysical when not in use, and one that ensures it is at its proper position using nonphysical functions.
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm