I thought of making a tutorial on how to make Destination Dispatch code for your building's elevators. It's not that hard to switch existing call buttons over to destination dispatch call stations.
Steps to convert an existing building to Destination Dispatch:
- Add new textures
- Add elevator ID parameters
- Create Dispatch Controllers
- Comment out Call Buttons
- Create Call Stations (either with a floor panel, or keypad) in place of Call Buttons
- Add letter indicators above each elevator (this is still under development, but you can use directional indicators for now)
To switch Call Buttons to regular DD Call Stations (with floor numbers)
First, add the indicator textures. You'll need to create letter textures for each elevator ID that you're using, In the Simple building, only "A" is used. The textures that need to be created are "A left", "A right", "back left A" and "back right A", finally "XX" is the error texture:
AddText Black, Button<A, nimbus_sans.ttf, 47, <A, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, ButtonA>, nimbus_sans.ttf, 47, A>, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, Button[]A, nimbus_sans.ttf, 47, []A, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, ButtonA[], nimbus_sans.ttf, 47, A[], -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, ButtonXX, nimbus_sans.ttf, 47, XX, -1, -1, -1, -1, center, center, 255, 255, 255
Next, prepare your elevator by adding an ID parameter to it, for identification by the controller. Put this into your Elevator section for your first elevator:
ID = A
Other elevators should be B, C, D, etc.
After the elevator is created, you'll need to make a Dispatch Controller. This replaces the "CallButtonElevators" command. This is how it appears in the Simple building DD demo.
#Create a new Dispatch Controller
<Controller 1>
Name = Dispatch Controller %controller%
DestinationDispatch = true #turn on Destination Dispatch mode
Hybrid = true #use hybrid mode (allow both regular and destination routes)
Range = 5
MaxPassengers = 10
Elevators = 1 #assign elevator 1 to controller 1
<EndController>
Once the controller is created, find your Call Button code. This is what the Simple building has:
<Floors 0 to 9>
CallButtonElevators = 1
CreateCallButtons , ElevExtPanels, ButtonUp, ButtonUpLit, ButtonDown, ButtonDownLit, 3, 6 - 4.125 - 0.33 - 0.1, 4, front, 0.5, 1, true, 0, 0
<EndFloors>
Comment out the "CallButtonElevators" and "CreateCallButtons" commands. You can delete them later, but there's a couple things you need from them.
Put the contents of the "CallButtonElevators" into the "Elevators =" list of Controller 1 (shown above). So if you have 3 elevators, Controller 1 should have a line like this:
Elevators = 1 - 3
That finishes your controller. For the CreateCallButtons command, keep in mind the positioning information, and maybe the background texture (ElevExtPanels).
This next part is what the Simple building has to create the call station. Make a button panel for the floors of your building similar to the inside of an elevator. The only real unique change is that you need to set the old call button's position in the SetPosition command, so take it from the call button and put it in there. Note that in this example, the position in CreateCallButtons above and SetPosition below are the same. This code also assigns Call Station 1 to Controller 1.
SetAutoSize = false, false
<Floors 0 to 9>
<CallStation 1>
Name = Call Station %callstation%
Controller = 1 #assign to Dispatch Controller 1
#create a button panel and controls
CreatePanel ElevExtPanels, 6, 5, front, 0.15, 0.15, 0.3, 0.45, 0, 0
AddControl switch.wav, 2, 2, 0, 0, 0, 0, 1, 7, Button8
AddControl switch.wav, 2, 3, 0, 0, 0, 0, 1, 8, Button9
AddControl switch.wav, 2, 4, 0, 0, 0, 0, 1, 9, Button10
AddControl switch.wav, 3, 2, 0, 0, 0, 0, 1, 4, Button5
AddControl switch.wav, 3, 3, 0, 0, 0, 0, 1, 5, Button6
AddControl switch.wav, 3, 4, 0, 0, 0, 0, 1, 6, Button7
AddControl switch.wav, 4, 2, 0, 0, 0, 0, 1, 1, Button2
AddControl switch.wav, 4, 3, 0, 0, 0, 0, 1, 2, Button3
AddControl switch.wav, 4, 4, 0, 0, 0, 0, 1, 3, Button4
AddControl switch.wav, 5, 3, 0, 0, 0, 0, 1, 0, Button1
#set position of call station
SetPosition 3, 4, 6 - 4.125 - 0.33 - 0.1
AddIndicator mechchime9.wav, Button, Black, front, 0, 0, 0.5, 0.5, 1, 5
<EndCallStation>
<EndFloors>
Once that's finished, your call station should be working!
To create keypads, use the same steps as above, but in your Textures section, add the Keypad textures. This is what the Simple building has, textures for 0-99, A (all directions), XX, ?? (invalid floor), minus and star.
#Create text for keypad
AddTextRange 0, 99, Black, Button%number%, nimbus_sans.ttf, 47, %number%, -1, -1, -1, -1, center, cente
r, 255, 255, 255
AddTextRange 0, 99, BlackLit, ButtonLit%number%, nimbus_sans.ttf, 47, %number%, -1, -1, -1, -1, center,
center, 255, 255, 255
AddText Black, Button<A, nimbus_sans.ttf, 47, <A, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, ButtonA>, nimbus_sans.ttf, 47, A>, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, Button[]A, nimbus_sans.ttf, 47, []A, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, ButtonA[], nimbus_sans.ttf, 47, A[], -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, ButtonXX, nimbus_sans.ttf, 47, XX, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, Button??, nimbus_sans.ttf, 47, ??, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, Button-, nimbus_sans.ttf, 47, -, -1, -1, -1, -1, center, center, 255, 255, 255
AddText Black, Button*, nimbus_sans.ttf, 47, *, -1, -1, -1, -1, center, center, 255, 255, 255
You might also need to create negative floor textures (such as -1, -2, -3, etc), or textures for floors higher than 99.
Follow the previous steps, but for the CallStation section, make a keypad instead of a floor panel. This panel maps buttons to the Call Station actions.
SetAutoSize = false, false
<Floors 0 to 9>
<CallStation 1>
Name = Call Station %callstation%
Controller = 1 #assign to Dispatch Controller 1
#create a button panel and controls
CreatePanel ElevExtPanels, 6, 5, front, 0.15, 0.15, 0.3, 0.45, 0, 0
AddControl switch.wav, 2, 2, 0, 0, 0, 0, 1, Input7, Button7
AddControl switch.wav, 2, 3, 0, 0, 0, 0, 1, Input8, Button8
AddControl switch.wav, 2, 4, 0, 0, 0, 0, 1, Input9, Button9
AddControl switch.wav, 3, 2, 0, 0, 0, 0, 1, Input4, Button4
AddControl switch.wav, 3, 3, 0, 0, 0, 0, 1, Input5, Button5
AddControl switch.wav, 3, 4, 0, 0, 0, 0, 1, Input6, Button6
AddControl switch.wav, 4, 2, 0, 0, 0, 0, 1, Input1, Button1
AddControl switch.wav, 4, 3, 0, 0, 0, 0, 1, Input2, Button2
AddControl switch.wav, 4, 4, 0, 0, 0, 0, 1, Input3, Button3
AddControl switch.wav, 5, 2, 0, 0, 0, 0, 1, InputStar, Button*
AddControl switch.wav, 5, 3, 0, 0, 0, 0, 1, Input0, Button0
AddControl switch.wav, 5, 4, 0, 0, 0, 0, 1, InputMinus, Button-
#set position of call station
SetPosition 3, 4, 6 - 4.125 - 0.33 - 0.1
AddIndicator mechchime9.wav, Button, Black, front, 0, 0, 0.5, 0.5, 1, 5
<EndCallStation>
<EndFloors>
You can also change the "mechchime9.wav" to something like "indicatorsound*.wav" and when the indicator shows something like "XX", it'll play "indicatorsoundXX.wav", or "indicatorsoundA.wav" for elevator A.
For letter indicators above the elevator, I'm still developing that, but for now you can use a Directional Indicator above each elevator. This is one of the Triton Center's current ones:
AddDirectionalIndicator 1, true, true, true, ElevExtPanels, ButtonA, ButtonLitA, ButtonA, ButtonLitA, 3.426 + 0.2 + 0.66 + 0.02, 0, 8.2, right, 0.5, 0.5, true, 0, 0
Basically it just displays the "ButtonA" texture for Up and Down, and the "ButtonLitA" when lit. Make sure you load the "ButtonA" and "ButtonLitA" textures.