Space Engineers

Space Engineers

AAECS - Advanced Automatic Elevator Control Script
159 Comments
DocBrown86 15 Feb @ 1:39pm 
@Viruz Thank you. I saw I missed the door thing on your guide... Sorry about that!

And for the timers, at that point I had removed the doors from the elevator list and ran 'setup', so it shouldn't have been seeing the doors on the script. I'll run a test again using a light rather than doors and see if I can make it work.
Viruz  [author] 14 Feb @ 1:52pm 
@DocBrown86 You can setup to open for specific floors via the Custom Data box. In the Custom Data for each cabin door, you will see [Exclude: ] (Providing you've setup the elevator already, if not, just add it).

In a comma separated list, you can add floor numbers where you want that specific door to not open. E.g. [Exclude: 1, 2, 5] means that the door will open on floors 3 and 4 but not on floors 1, 2 and 5. You will need to run the "update_settings" command again though.

And as for the timers, If i'm reading it right, you're trying to use timers to achieve the above by manually opening/closing the elevator doors. However I've set the script to always request the doors to either open/close according to the current elevator state, so the timer would trigger and ask the door to close, but the script would immediately (every tick) ask the door to open, resulting in the timer appearing to do nothing.
DocBrown86 13 Feb @ 5:39pm 
Also, attempting to resolve my last comment by having the script call timer blocks, but I can't seem to get it to trigger them. Do I need " ", or a space after the =? Just not sure what I could be missing.
DocBrown86 13 Feb @ 5:15pm 
I have an elevator cabin with 2 doors. One opens for the top floor, and the other for the bottom floor. Aside from setting them to manual, is there a way to tell each floor to use a specific cabin door?
Desert Ice 27 Jan @ 7:41am 
@Viruz Thanks, I just thought to ask. Otherwise, the script is working beautifully.
Viruz  [author] 26 Jan @ 9:39am 
@Desert Ice, Currently, there's no option to assign timers to individual floors, I opted to go for just having a single one for all floors, this was due to complexity, I did not want the setup process to be too complex. You may be able to achieve something similar with sensor blocks, even though it requires a bit more manual setup.

I do want to eventually rewrite this script, so I can add more features like that and make it a bit more robust, however with SE 2 coming, I've put this on hold. Depending on how SE 2 scripting is implemented, I might write the new script for SE 2 then backport to SE 1, but this may take a while.
Desert Ice 25 Jan @ 2:36pm 
Regarding the "trigger timer block when arriving/ departing a floor" function; can that be made to trigger different timer blocks at different floors? As I read this it seems to say that there is one set of TB's being triggered at every floor?
darksouls 25 Oct, 2024 @ 12:11pm 
for the juggernaught ship that this mod needs i couldn't get the elevator to load in properly
Cicis 25 Sep, 2024 @ 9:11am 
Is it possible to use with workshop pistons? Like ganymede, etc.? Can't get it working. Thanks for good work
03dfa 16 Sep, 2024 @ 11:55am 
well,I had tried for 5 hours and just succeed once ,dont know whats wrong
03dfa 16 Sep, 2024 @ 5:33am 
I followed the instructions,however it keeps telling me "less than two floors".why does that happend?
C4PTRAMPAGE 27 Aug, 2024 @ 4:25am 
"level block offset" only understands ints and not floats.

no one would ever build an elevator out of panels or half blocks and then need precise adjustment of the floor offset right?
Viruz  [author] 20 Jun, 2024 @ 12:58pm 
@Unreal, I can't seem to recreate the issue, can you provide more details about your elevator setup or provide a blueprint so I can take a look? If I had to guess, it'd be a physics issue, does turning up the force of the elevator pistons or enabling share inertia tensor fix it?
Unreal 19 Jun, 2024 @ 9:31am 
Every time i spawn a grid with the elevator script the elevator spawns between the door L1 and L2 and then will not work unless i wipe out the script and start over.. then it works fine..
Symyr 16 Nov, 2023 @ 9:22am 
Deleted my previous posts about the script not working since i figured out what the problem is. I use a piston to offset the blocks just a tiny amount to avoid collisions. Even though that piston isn't part of the Elevator group (i tired to make it part of the group once too to test, didn't work either) the script seems to be unable to descend to other floors. Made a blueprint of the setup so you could see it and hopefully have an idea to fix it.

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3085328542
Viruz  [author] 9 Aug, 2023 @ 8:08am 
@Cronyx VCZ Doors for the outer doors and Flat Door for the elevator cabin.
Cronyx 8 Aug, 2023 @ 5:56pm 
What door is used in the video?
Viruz  [author] 27 Jun, 2023 @ 1:58pm 
That can also work, I might go with that approach then.
InertialMage 26 Jun, 2023 @ 11:17pm 
@viruz im not sure how you do all the calculations, but would you be able to input how many stacks of pistons you have, and maybe then scale down the numbers you have by a factor of the piston stacks?
Viruz  [author] 26 Jun, 2023 @ 1:04pm 
@InertialMage, Yeah this was something which I attempted to do beforehand with the same results, I am considering implementing a feature to allow multiple piston stacks where you have one main stack which is totalled by the script and extra supporting stacks which aren't considered apart of the current position but will still move with the elevator.
InertialMage 25 Jun, 2023 @ 10:11pm 
okay, so im using multiple pistons for one platform, not one big pillar, but 5 pillars of pistons, and i suspect its counting them all up, cause it only goes up a tiny bit between the floors, and will open the door as if it reached it
Shoku 'Jetwash' Silverfall 29 May, 2023 @ 10:32pm 
Okay after playing around some, I've found 2 bugs. 1, the program will freeze if you travel to a floor where the door is not functional (damaged or incomplete). Recompiling doesn't fix, you actually need to edit the program to fix this (I just add a space on a comment line).

2, a system with many pistons has an increasing amount of error on each floor. My elevator shaft is about 70 meters tall. The elevator is aligned perfectly at the top and off by about 0.4 meters at the bottom.
Shoku 'Jetwash' Silverfall 29 May, 2023 @ 5:52pm 
I can probably handle the changes myself, but I'd like to suggest support for basement and ground levels. The way I'd see it working is that basement levels are negative level numbers (B or B1 is higher up than B2, B3 etc), and ground (G) counts as level 0.

Okay I just looked up the Wikipedia article on elevator floor numbers and.... well it's about as long as the entire AACS script. I have a headache now :-(
WesternSpace 7 May, 2023 @ 3:15pm 
Thanks for finding the issue, I had not noticed the space, so thanks for picking that up.
Viruz  [author] 7 May, 2023 @ 10:56am 
@WesternGamer, I've found the issue, you've included a space at the start of the name of each floors gate. The gate has " [L2] Gate" when it should be "[L2] Gate" with no space at the start. I probably should have thought about this a while ago but I guess I didn't, but i'll fix it in the next update.
Viruz  [author] 5 May, 2023 @ 4:20pm 
Ok thanks, i'll take a look tomorrow. :selike:
Viruz  [author] 5 May, 2023 @ 1:39pm 
Sorry, but I think you're gonna have to make the elevator its own separate blueprint so I can look at it. The world is way too big and slow for me to do anything.
WesternSpace 5 May, 2023 @ 12:50pm 
Here is the world: https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2971829773

There are two elevators in this world on separate grids, look for the large elevator that goes underground. The programmable block is under the elevator.
Viruz  [author] 5 May, 2023 @ 12:13pm 
Just as an uploaded workshop blueprint or world would be fine, thanks.
WesternSpace 5 May, 2023 @ 12:10pm 
The floor numbering is correct. Where should I send the world file?
Viruz  [author] 5 May, 2023 @ 10:39am 
This script does support all kinds of door blocks (including gates) so my best guess would be that the numbering is wrong. My best guess is that you've set the "first" floor to something like [L0] or [L2] and the second floor to [L1] or [L3]. All elevators have to start from [L1] and cannot start from any other number. The script might be cutting off [L0].

They also have to increment up in the exact ordering (e.g. L1, L2, L3, L6, L7), the floors 6, 7 will be cut off.

Otherwise, I could've broke something in the latest update, if you can, after checking the above, could you please send me a blueprint of the elevator or an example one and i'll take a look. Thanks :)
WesternSpace 4 May, 2023 @ 2:56pm 
So I am encountering an issue where the script claims that it detected less than two floors. The issue is that there are two doors and they are both in the correct order. Note that I am using the gate block as the elevator doors on both floors. I am wondering if the script does not consider the gate blocks as doors.
Davetiger 24 Apr, 2023 @ 9:05am 
Thank you very much!
WesternSpace 24 Apr, 2023 @ 9:00am 
Thanks!
Viruz  [author] 23 Apr, 2023 @ 1:49pm 
@WesternGamer, @Davetiger, Update has been released!
Viruz  [author] 22 Apr, 2023 @ 3:15am 
Sure, sounds easy enough, i'll do that today and i'll have it out by the end of today or tomorrow.
WesternSpace 21 Apr, 2023 @ 6:22pm 
Like this mod! I wonder if you can add a feature to change how a floor number is displayed. For example, I have an elevator in a basement. I want level 1 to be displayed as B2 and level 2 to be displayed as B1 on a LCD.
Viruz  [author] 21 Apr, 2023 @ 4:52pm 
Thank you :)
Davetiger 21 Apr, 2023 @ 4:51pm 
Wow thank you that is amazing, this is one of the best scripts I've used the elevator setup was so super easy :)
Viruz  [author] 21 Apr, 2023 @ 4:48pm 
At the moment, no it isn't an option, however i'll add it as an option in the next update, which should come out sometime this weekend, or i'll just release a small patch with that change exclusively if I can't finish it in time. :steamthumbsup:
Davetiger 21 Apr, 2023 @ 4:41pm 
I just removed it from the code, but if that is an option I would like to know how :)
Davetiger 21 Apr, 2023 @ 4:31pm 
i'm good with doors auto closing but the doors can't be opened from the other side is a problem. I'm building a "office" building if you will and the refinery room has it's own elevator but if I'm ON floor 2 I can't get in the room to get to the elevator for the call button
Davetiger 21 Apr, 2023 @ 4:24pm 
Hey love this script is but is there a way to remove the "door on/off" I'm putting the elevator in a room and each floor has an exit door but that goes to another room that can also be used as an entrance door where the elevator call button would get used....
Criminal Muffin 10 Feb, 2023 @ 9:21am 
Awesome, thank you 🙂

Inverting the layers works fine, thats why i thougt it may be related to the piston beeing on top
Viruz  [author] 10 Feb, 2023 @ 7:21am 
@Criminal Muffin, This is actually a bug at the moment, it should just work by default with no config option however it doesn't. I'll try and fix this and hopefully have a patch out this weekend. :steamthumbsup:

For now however, you could try to invert the floor numbers, so instead of L4, L3, L2, L1, do L1, L2, L3, etc.
Criminal Muffin 9 Feb, 2023 @ 4:18pm 
Hi, @Viruz
thx for the amazing script, really awesome!
I only have one problem.. I have an elevator where i placed my pistons on the top and it kinda works but the elevator gets confused with the levels.

My setup:
Pistons
L4
L3
L2
L1

If I now tell the elevator "goto L1" it moves to the L4 and opends door L1.

I wonder it would be possible to have a config option in the elevator config sections to tell the script that the pistons sits at the top of the elevator?

Thx for your help :)
DuckyToDucker 10 Jan, 2023 @ 2:17pm 
Happy to help identify bugs. :) It appears that you have fixed it. I really appreciate your time and help.
Viruz  [author] 10 Jan, 2023 @ 12:24pm 
OK, so I've found and fixed the two bugs causing the issues (of course it had to be regex related :steamfacepalm:) . Try it out and lmk if it works properly or if there are any more issues. Thanks :)
DuckyToDucker 9 Jan, 2023 @ 6:24pm 
Thank you very much, no rush at all. I really like your script and look forward to knowing if I did something wrong.