We have multiple kinds of elevators and at their core they are some of our older legacy code. It worked, but there were some issues. I've (hopefully) resolved those issues as well as extended their abilities to support future code such as 'NPCs knowing how to take an elevator'.
1. When someone calls the elevator from an elevator lobby, the button will light up in the elevator.
2. You can push multiple buttons (or say multiple floors in elevators that support speech) and the floors will queue up. Currently, it is not like a real elevator where if you push 3 and then 2 from floor 1, you get 2 first then 3. I did it like this on purpose so whomever pushes a button first, gets to their destination first.
3. I totally forgot about Xpress Heights and Arborian and those elevators have different code, so I had to scramble to fix them. They should be working now without much issue. If you find problems please let me know ASAP.
4. Numerous fixes that will make elevators work better. The doors won't open/close weirdly, and you shouldn't get the multiple movement messages that sometimes cropped up. We've moved from using forked tasks to close doors to using the scheduler, which is a big improvement.
5. It should be much harder to accidentally get locked in an elevator that is stuck. If it does happen, please xhelp. The code refactors I've done have been tested pretty thoroughly but you never know. If something weird happens you should be able to (unless it is SUPER broken) push open or push close to get it going again.
6. Better messaging. More verbose, more clear.
7. Better help for voice elevators: 'say help'
8. Cleaned up a lot of the code! It was kinda messy in there. Some of it was really old. So, now it's cleaner and more up to date with our current coding standards.
9. If you look in the elevator, you'll see which buttons are already pressed.
10. When you get to your floor, the elevator will tell you what floor it is!
Like I mentioned at the start, one of the main reasons for doing this was to better support things like NPCs taking the elevator. Previously, we could have made it work but it would have been hacky.
Now, we can hook in notifications for NPCs when they arrive at the floor they were looking for, instead of just hoping that they would get into an empty elevator that no other NPC or player were trying to use and get to the floor they pushed. Since, as you all know, elevators only supported one floor at a time, if a PC were to enter with the NPC and hit a different floor before the NPC could, the NPC would basically be stuck forever or it would get off at the wrong floor and not know what to do.
Now we can better plan NPCs using elevators and you guys get a (hopefully) less hassle when using the elevators!
Thanks to Johnny and Malice for helping me work through the refactor, reviewing the code and for testing!
Have fun. Feedback welcome. Bugs very welcome.