Ok this project have been a long time coming, but finally about to get it done. But decided to do this as a mini tutorial kind of thing:
Elevators using Enhanced portals 3 and CC touchscreen.
The main idea of this build is to create something that mimics an elevator/lift experiences without the actual moving parts and waiting time going up and down. This is where Enhanced Portals 3 comes into the picture. At the end of the build you will be able to step into an elevator, click your destination, have the door shut and you will then get teleported directly to that destination without any hassle.
First thing we are going to need to build is the portal that will serve as the backbone of the "elevator". You will need 15 "Portal Frame"s, 1 "Portal Controller", 1 "Dialling Device" and 1 "Redstone interface":
I suggest putting on a pair of "Glasses" when building the portals to be able to see the different components. In that respect I am also hiding the Dialling device down in a corner as it stays visible without the glasses.
Now link the portal to your Dimensional Bridge Stabilizer to activate it(use a location card).
Next you will need 6 "Advanced Monitors", 1 "Advanced Computer" and a "Disk Drive":
Now take 2 "Drawbridge"s, 3 door material blocks for each Drawbridge(I suggest glass of some sort, Strengthened glass works great) and some decoration blocks of your choosing:
Next a "Entity Detector", "Not Gate" and Framed Insulated Wire of any colour:
Set the Entity detector to 5,3,2 "Player" if your door is facing East/West, or 2,3,5 if North/South.
Red Alloy Wire, Insulated Wire(any colour) and microblock Cover:
Do not place any wires(insulated or not) in a block adjacent to the Redstone Interface. It will get confused by them for some reason. Just put one Red Alloy wire on one Drawbridge.
Last building step: More Framed Insulated Wires:
The elevator mechanism is now done and we can move on to the programming and setup of the computer:
First we are going to have to tell the computer which floor it is actually on. This have to be done in a way that it can remember even after server/computer/chunk reloads etc, so we will store that data on a Floppy Disk in the Disk Drive.
Craft a "Floppy Disk" and put it in the Disk Drive next to the computer(or a Disk Drive next to any Computer). Open the Computer and type: "edit disk/floor" and hit enter. Type in the floor number that the elevator is situated on(from 1-9. Use 1,2,3.. etc. first due to the code works. This is just for the internal use in the code, you can name the floors displayed differently later if the floor 1 isn't what you would call floor 1 in your build). Type in the number of the floor(just a single digit), hit ctrl and save, hit ctrl and exit.
I wrote this little program if you want to easily label your Disks.
http://pastebin.com/XCsgdpJk
Just DL it, run it like: "programname labelname". It will automatically do the rest.
Now install the main elevator program on the computer as "startup":
http://pastebin.com/48TbDKXX
Made a new version of the elevator program, where I have separated the core of the program into an API. This allows you to simply copy and modify the startup script only for each elevator needed.
So make a copy for the elevator in Building A and a copy for Bunker B etc. so you can individually adapt it to have the right number of floors/buttons and the proper text on on the buttons(all 1-9 floors on the same elevator uses the same startup script, you only need multiple scripts if you have multiple elevators in your world(s)). The customized scripts will then automatically download and use the current up to date elevator API.
Default startup script:
http://pastebin.com/kKdbx3Ty
Follow instructions in the header of the script on how to customize the touch screen button text.
Elevator "API" for the curious:
http://pastebin.com/1M5sgXpT
Now there is one thing left to do, and this can be a bit complicated. We need to pick "Identifiers" for all the portals and then store the other portals Identifiers in the Dialling device in the proper order.
Example: lets say we are setting up Floor 4s elevator. To make it easier for myself I would then pick the 4th Identifier symbol on the lift for this portal:
Click the Portal controller with a Wrench:
And save.
Now go to your Dialling device and start Adding stored Identifiers starting with the first one being for Floor 1 with the first Identifier and so on. (Add the identifier for the Portal itself as well just to keep the list in the right order, the computer will use redstone strength signals to dial a certain stored destination. Signal strength of 2 will dial the second on the list). Populate the list with all the portals/floors you have.
Very last thing you need to do is click the Redstone Interface with a Wrench and change the setting to:
"Input, Dial specific identifier (2)"
And you are now all done!
Step into your elevator, click your destination and see yourself transported to the destination in a stylish fashion!
Now ofc all this looks rather raw, but there are several things you can do about that. Build a nice facade up around the elevator, use some of Enhanced portals many features, like camouflage the frame as another block, make the portal invisible, remove sounds and particles etc.
A little addition:
The code is not totally fininshed yet I think, I will probably polish it along the way.
In the code there is a section where you can specify what you want the buttons on the Touchscreen to say:
Code:
local buttontext = {}
buttontext[1]="Floor 1 "
buttontext[2]="Floor 2 "
buttontext[3]="Floor 3 "
buttontext[4]="Floor 4 "
buttontext[5]="Floor 5 "
buttontext[6]="Floor 6 "
buttontext[7]="Floor 7 "
buttontext[8]="Floor 8 "
buttontext[9]="Floor 9 "
You can edit these to suit whatever you want it to say. Just make sure to keep it 16 characters long(by adding spaces) to ensure the lengths of the buttons are as they should.
Also the code by default supports 9 floors as maximum. If you want/need less just delete >buttontext[9]="Floor 9 "< for example and the code should adapt to only use 8 floors.