Re: Automatic Elevator Script
Posted: Thu Oct 18, 2012 8:27 pm
Oh that is really cool! I love it! A locked out virtual floor that the elevator skips until the floor is enabled! I'm going to add that to my list of things to support in version 2.1crisman wrote:Those ideas are great!
For now I personally managed to get my 7 1/2 floor, in a stack of floor from 1 to 10, my 7 1/2 floor is the 10th, until you use a key on a special lock, the elevator will ignore the 10th. Then, the elevator will travel from 7th floor to 10th, to 10th floor to 8th. Originally when I said "skip 3 levels" I meant this, but now I realize it could be interesting if in a stack there are some floor not served by the elevator!
Still have to work on the button and the leds, in these days I don't have so much time
For the space I'll try to place an opened prison portcullis on prison-level I'm not sure if their height is enough to cover the hole But I'll give it a try later!
I'll wait for your next update!
I've already completed the LED display color enhancement where you can define a different color on each floor. I think I'll add a function that will let you change the color dynamically on a given level too. If the car is on that level, the color will change immediately, otherwise when the car arrives. Would you like support for displays such as 7.5? I can't do 17.5 in the given space currently, but dropping in a decimal point shouldn't be hard. I can also add special symbols for numbers greater than 99...
I have a function that will disable and enable the whole elevator stack which I will probably keep just for grins, but I'm going to add levelDisable() and levelEnable() functions that will let you turn off a floor. Like I said, that's very cool! The elevator will ignore these floors if disabled therefore skipping or refusing to go to them as if they don't exist.
To accommodate your requirement for a hidden floor, I'm going to redefine the floor definition table yet again. I think I can add sequencing to the table so that the elevator need not traverse the floors in actual level order. This would let you service floors 1 through 8 normally, for example, yet if the secret floor was enabled, you could insert it between floors 7 and 8 just like you want. This will take a little doing, but I already have a concept in mind. If you wanted, you could service floor 1, 12, 4, 6, 2, and 10 in that order. Weird, but why not?!
To support this, I think I'll add a virtual floor number which will be used to determine actual service order and travel times. For your application, this would be {1, 2, 3, 4, 5, 6, 7, 7.5, 8} corresponding to the real level numbers of {1,2,3,4,5,6,7,10,8}. Initially, floor 7.5 would be disabled and, therefore, skipped. The definition would be something like {1,1,1,1,1,1,0,1}. The lower travel time to and from virtual floor 7.5 would be only half as floors traveled would only be calculated between virtual floors, not real ones.
I'm hoping for generic code that will handle all needs that is parameter driven. If so, you could drop this new code in (if you wanted to), set a few parameters, and go. The parameters would be arranged by either floor or type of function (as in the examples above). I’m leaning towards floor and using something like:
Code: Select all
levels = {{floor-1-definition},{floor-2-definition},…{floor-n-definition}}
each floor definition would be something like {level, virtual-level, {call_location}, {color}, enabled, ...}
Thank you, -Lark