# $Id: Simple - Split Level.bld 1999 2010-05-09 17:22:42Z ryan $
	
#This building is a bare-bones building designed to help others learn how to
#make their own buildings in Skyscraper's scripting language.
#All of the commands and parameters used in this file are documented in the
#script guide (designguide.html) which comes with the program.

#The first thing to learn is about comments - if you put a number sign (#) anywhere
#in a line, all text after it will be ignored.  If a line starts with that sign, the whole
#line is ignored.

#What we'll do first is include some fancy elevator door functions for use later.
#This gives us access to a bunch of pre-made elevator door types
<Include data/scripts/elevator_doors.txt>

#Then the thing you'll need to do when creating a building is define the global parameters.
#These are contained inside the "Global" section.  The following code shows this building's
#basic parameters:

<Globals>
    Name = My Building
    Designer = Me
    CameraFloor = 0
    CameraPosition = 0, -60
    CameraRotation = 0, 0, 0
    Sky = noon
<EndGlobals>

#In the above code, I named the building "My Building", and set the designer as "Me".  The HorizScale
#parameter is optional, and it's there to experiment with (see the script guide for more info on that).
#I'm also telling the camera to start on the first floor with the CameraFloor parameter.  In Skyscraper,
#floor 0 is the first floor, floor 1 is the second, etc, and by setting the floor to "0" in that parameter,
#I'm setting it to the first floor.  Floors were numbered that way in order to make the numbering between
#below ground and above ground floors seamless - so they'd go from -2, -1, 0, 1, 2 instead of skipping 0.
#I also set the camera's position to be in the center of the map horizontally (0), and 60 feet to the front
#of the map (-60)

#Next you'll have to define your textures. Most of these commands simply load a texture file and give it
#a name.  At the bottom of the section you'll see code that adds text to existing textures.

<Textures>
    Load data/brick1.jpg, Brick, 0.269, 0.25
    Load data/windows11h.jpg, MainWindows, 0.05, 1
    Load data/windows11h_inside.gif, MainWindowsInt, 0.05, 1
    Load data/Carpet0013_S.jpg, Carpet1, 0.2, 0.2
    Load data/text13.jpg, Stairs, 0.269, 0.25
    Load data/cinderblocks.jpg, Concrete, 0.25, 0.25
    Load data/cinderblocks.jpg, StairsWall, 0.25, 1
    Load data/cutston.jpg, InterExt, 0.269, 0.25
    Load data/downtown.jpg, Downtown, 1, 1
    Load data/cutston.jpg, Ceiling1, 0.269, 0.25
    Load data/metal1.jpg, ElevExt, 0.25, 0.25
    Load data/door1.jpg, ElevDoors, 1, 1
    Load data/door1.jpg, ElevDoors2, -1, 1
    Load data/panel-back2.jpg, ElevExtPanels, 1, 1
    Load data/marb148.jpg, ElevPanel, 1, 1
    Load data/diamond18j.jpg, ElevWall, 1, 1
    Load data/diamond18j.jpg, ElevPanelMain, 1, 1
    Load data/elev1.jpg, ElevCeiling, 0.25, 0.25
    Load data/Carpet0006_S.jpg, ElevFloor, 0.25, 0.25
    Load data/callbutton.gif, ButtonUp, 1, 1
    Load data/callbutton_lit.gif, ButtonUpLit, 1, 1
    Load data/callbutton.gif, ButtonDown, 1, -1
    Load data/callbutton_lit.gif, ButtonDownLit, 1, -1
    Load data/marbl3.jpg, Wall1, 0.269, 0.25
    Load data/servicedoor2.jpg, StairsDoor, 1, 1
    Load data/darrow_unlit.gif, ArrowUp, 1, 1
    Load data/darrow_unlit.gif, ArrowDown, 1, -1
    Load data/darrow_lit.gif, ArrowUp_Lit, 1, 1
    Load data/darrow_lit.gif, ArrowDown_Lit, 1, -1

    Load data/black.jpg, Black, 1, 1
    Load data/black_lit.jpg, BlackLit, 1, 1
    AddText Black, ButtonOpen, nimbus_sans.ttf, 28, Open, -1, -1, -1, -1, center, center, 255, 255, 255
    AddText Black, ButtonClose, nimbus_sans.ttf, 28, Close, -1, -1, -1, -1, center, center, 255, 255, 255
    AddText Black, ButtonStop, nimbus_sans.ttf, 28, Stop, -1, -1, -1, -1, center, center, 255, 255, 255
    AddText Black, ButtonAlarm, nimbus_sans.ttf, 28, Alarm, -1, -1, -1, -1, center, center, 255, 255, 255
    AddText Black, ButtonCancelTemp, nimbus_sans.ttf, 28, Call, -1, 30, -1, 54, center, center, 255, 255, 255
    AddText ButtonCancelTemp, ButtonCancel, nimbus_sans.ttf, 28, Cancel, -1, 71, -1, 95, center, center, 255, 255, 255
    AddTextRange 1, 10, Black, Button%number%, nimbus_sans.ttf, 47, %number%, -1, -1, -1, -1, center, center, 255, 255, 255
    AddTextRange 1, 10, BlackLit, ButtonLit%number%, nimbus_sans.ttf, 47, %number%, -1, -1, -1, -1, center, center, 255, 255, 255
<EndTextures>

#Next you'll need to create the ground. The following code is the default ground code.
#The second command is needed to cut a whole in the ground for the building.  In this
#example I'm giving the building dimensions of 40x40 feet, so it needs to be cut from
#-20 to 20 horizontally, and -20 to 20 depth-wise.

AddGround Ground, Downtown, -158400, -158400, 158400, 158400, 0, 7920, 7920
Cut Landscape, -20, -1, -20, 20, 1, 20, false, true

#Now it's time to start making the building's floors.  If you're making basement levels, they must
#be specified before floor 0 and the other above-ground floors, and must also be in decending
#order (-1, -2, -3, etc).  In this example, I'm just going to make above-ground floors. The following
#code creates 10 floors (0 to 9).  Note that math can be used inside commands to make things easier.

<Floor 0>
    #The ID of a floor is it's commonly-used number or symbol - this sets floor 0 to be known as "1", etc.
    ID = %floor% + 1
    Name = Floor (%floor% + 1)
    Type = Office
    Height = 5 #This is the height in feet of the floor
    InterfloorHeight = 2.24 #This is the height in feet of the space between floors (below the floor's base)
    #Floor 0 needs to have it's altitude manually set, since it's interfloor space is below the floor's base
    Altitude = -2.24
    Group = 1
    
    #create a basic carpeted floor
    DrawWalls = false, true, false, false, false, false
    AddFloor Floor, Carpet1, 0.5, -20, -20, 20, 20, 0, 0, 0, 0, False

    #create a ceiling
    DrawWalls = true, false, false, false, false, false
    AddFloor Ceiling, Ceiling1, 0.5, -20, 6 + 4.125, 20, 20, %height% - 0.05, %height% - 0.05, 0, 0, False

    #External windows - this creates the outside versions of the windows, and also the walls outside the
    #interfloor areas
    SetAutoSize = true, false
    DrawWalls = true, false, false, false, false, false
    if[%floor% ! 0] AddWall Front, MainWindows, 0, -20, -20, 20, -20, %height% * 3, %height% * 3, %interfloorheight%, %interfloorheight%, 0, 0, True
    if[%floor% = 0] AddWall Front, MainWindows, 0, -15, -20, 20, -20, %height% * 3, %height% * 3, %interfloorheight%, %interfloorheight%, 0, 0, True
    AddWall Left, MainWindows, 0, -20, 20, -20, -20, %height% * 3, %height% * 3, %interfloorheight%, %interfloorheight%, 0, 0, True
    if[%floor% ! 0] AddWall Front, InterExt, 0, -20, -20, 20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    if[%floor% ! 0] AddWall Left, InterExt, 0, -20, 20, -20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    DrawWalls = false, true, false, false, false, false
    AddWall Right, MainWindows, 0, 20, -20, 20, 20, %height% * 3, %height% * 3, %interfloorheight%, %interfloorheight%, 0, 0, True
    AddWall Back, MainWindows, 0, 20, 20, -20, 20, %height% * 3, %height% * 3, %interfloorheight%, %interfloorheight%, 0, 0, True
    if[%floor% ! 0] AddWall Right, InterExt, 0, 20, -20, 20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    if[%floor% ! 0] AddWall Back, InterExt, 0, 20, 20, -20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    SetAutoSize = true, true

    #Internal windows - this creates the transparent windows on the inside of each floor
    SetAutoSize = true, false
    DrawWalls = false, true, false, false, false, false
    if[%floor% = 0] AddWall Front, MainWindowsInt, 0, -10, -20, 20, -20, %height% * 3, %height% * 3, 0, 0, 0, 0, False
    if[%floor% ! 0] AddWall Front, MainWindowsInt, 0, -20, -20, 20, -20, %height% * 3, %height% * 3, 0, 0, 0, 0, False
    AddWall Left, MainWindowsInt, 0, -20, 20, -20, -20, %height% * 3, %height% * 3, 0, 0, 0, 0, False
    DrawWalls = true, false, false, false, false, false
    AddWall Right, MainWindowsInt, 0, 20, -20, 20, 20, %height% * 3, %height% * 3, 0, 0, 0, 0, False
    AddWall Back, MainWindowsInt, 0, 20, 20, -20, 20, %height% * 3, %height% * 3, 0, 0, 0, 0, False
    SetAutoSize = true, true

    #Interfloor bottom
    FloorOrientation = bottom
    DrawWalls = false, true, false, false, false, false
    AddInterfloorFloor IFloor, Brick, 0.5, -20, -20, 20, 20, 0, 0, 0, 0

    #Interfloor top
    FloorOrientation = top
    DrawWalls = true, false, false, false, false, false
    AddInterfloorFloor ITop, Brick, 0.5, -20, -20, 20, 20, %interfloorheight% - 0.05, %interfloorheight% - 0.05, 0, 0

    #Interfloor walls
    WallOrientation = left
    DrawWalls = false, true, false, false, false, false
    AddInterfloorWall IFront, Brick, 0.5, -20, -20, 20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    AddInterfloorWall ILeft, Brick, 0.5, -20, 20, -20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    WallOrientation = right
    DrawWalls = true, false, false, false, false, false
    AddInterfloorWall IRight, Brick, 0.5, 20, -20, 20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    AddInterfloorWall IBack, Brick, 0.5, 20, 20, -20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    
    DrawWalls = true, true, false, false, false, false
<EndFloor>

<Floor 1>
    #The ID of a floor is it's commonly-used number or symbol - this sets floor 0 to be known as "1", etc.
    ID = %floor% + 1
    Name = Floor (%floor% + 1)
    Type = Office
    Height = 9 #This is the height in feet of the floor
    InterfloorHeight = 1 #This is the height in feet of the space between floors (below the floor's base)
    Group = 0
    
    #create a basic carpeted floor
    DrawWalls = false, true, false, false, false, false
    AddFloor Floor, Carpet1, 0.5, -20, 6 + 4.125, 20, 20, 0, 0, 0, 0, False

    #create a ceiling
    DrawWalls = true, false, false, false, false, false
    AddFloor Ceiling, Ceiling1, 0.5, -20, -20, 20, 20, %height% - 0.05, %height% - 0.05, 0, 0, False

    DrawWalls = true, false, false, false, false, false
    AddWall Front, Ceiling1, 0, -20, 6 + 4.125, 20, 6 + 4.125, %interfloorheight%, %interfloorheight%, -%interfloorheight%, -%interfloorheight%, 0, 0, False

    DrawWalls = true, true, false, false, false, false
<EndFloor>

<Floors 2 to 9>
    #The ID of a floor is it's commonly-used number or symbol - this sets floor 0 to be known as "1", etc.
    ID = %floor% + 1
    Name = Floor (%floor% + 1)
    Type = Office
    Height = 10 #This is the height in feet of the floor
    InterfloorHeight = 2.24 #This is the height in feet of the space between floors (below the floor's base)
    #Floor 0 needs to have it's altitude manually set, since it's interfloor space is below the floor's base
    if[%floor% = 0] Altitude = -2.24
    
    #create a basic carpeted floor
    DrawWalls = false, true, false, false, false, false
    AddFloor Floor, Carpet1, 0.5, -20, -20, 20, 20, 0, 0, 0, 0, False

    #create a ceiling
    DrawWalls = true, false, false, false, false, false
    AddFloor Ceiling, Ceiling1, 0.5, -20, -20, 20, 20, %height% - 0.05, %height% - 0.05, 0, 0, False

    #External windows - this creates the outside versions of the windows, and also the walls outside the
    #interfloor areas
    SetAutoSize = true, false
    DrawWalls = true, false, false, false, false, false
    if[%floor% ! 0] AddWall Front, MainWindows, 0, -20, -20, 20, -20, %height%, %height%, %interfloorheight%, %interfloorheight%, 0, 0, True
    if[%floor% = 0] AddWall Front, MainWindows, 0, -15, -20, 20, -20, %height%, %height%, %interfloorheight%, %interfloorheight%, 0, 0, True
    AddWall Left, MainWindows, 0, -20, 20, -20, -20, %height%, %height%, %interfloorheight%, %interfloorheight%, 0, 0, True
    if[%floor% ! 0] AddWall Front, InterExt, 0, -20, -20, 20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    if[%floor% ! 0] AddWall Left, InterExt, 0, -20, 20, -20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    DrawWalls = false, true, false, false, false, false
    AddWall Right, MainWindows, 0, 20, -20, 20, 20, %height%, %height%, %interfloorheight%, %interfloorheight%, 0, 0, True
    AddWall Back, MainWindows, 0, 20, 20, -20, 20, %height%, %height%, %interfloorheight%, %interfloorheight%, 0, 0, True
    if[%floor% ! 0] AddWall Right, InterExt, 0, 20, -20, 20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    if[%floor% ! 0] AddWall Back, InterExt, 0, 20, 20, -20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0, True
    SetAutoSize = true, true

    #Internal windows - this creates the transparent windows on the inside of each floor
    SetAutoSize = true, false
    DrawWalls = false, true, false, false, false, false
    if[%floor% = 0] AddWall Front, MainWindowsInt, 0, -10, -20, 20, -20, %height%, %height%, 0, 0, 0, 0, False
    if[%floor% ! 0] AddWall Front, MainWindowsInt, 0, -20, -20, 20, -20, %height%, %height%, 0, 0, 0, 0, False
    AddWall Left, MainWindowsInt, 0, -20, 20, -20, -20, %height%, %height%, 0, 0, 0, 0, False
    DrawWalls = true, false, false, false, false, false
    AddWall Right, MainWindowsInt, 0, 20, -20, 20, 20, %height%, %height%, 0, 0, 0, 0, False
    AddWall Back, MainWindowsInt, 0, 20, 20, -20, 20, %height%, %height%, 0, 0, 0, 0, False
    SetAutoSize = true, true

    #Interfloor bottom
    FloorOrientation = bottom
    DrawWalls = false, true, false, false, false, false
    AddInterfloorFloor IFloor, Brick, 0.5, -20, -20, 20, 20, 0, 0, 0, 0

    #Interfloor top
    FloorOrientation = top
    DrawWalls = true, false, false, false, false, false
    AddInterfloorFloor ITop, Brick, 0.5, -20, -20, 20, 20, %interfloorheight% - 0.05, %interfloorheight% - 0.05, 0, 0

    #Interfloor walls
    WallOrientation = left
    DrawWalls = false, true, false, false, false, false
    AddInterfloorWall IFront, Brick, 0.5, -20, -20, 20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    AddInterfloorWall ILeft, Brick, 0.5, -20, 20, -20, -20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    WallOrientation = right
    DrawWalls = true, false, false, false, false, false
    AddInterfloorWall IRight, Brick, 0.5, 20, -20, 20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    AddInterfloorWall IBack, Brick, 0.5, 20, 20, -20, 20, %interfloorheight%, %interfloorheight%, 0, 0, 0, 0
    
    DrawWalls = true, true, false, false, false, false
<EndFloors>

#Finally create the roof (11th floor), and add a square brick floor on it.
<Floor 10>
    ID = R
    Name = Roof
    Type = Roof
    Height = 10
    InterfloorHeight = 2.24
    DrawWalls = false, true, false, false, false, false
    AddFloor Roof, Brick, 0.5, -20, -20, 20, 20, 0, 0, 0, 0, True #roof
    DrawWalls = true, true, false, false, false, false
<EndFloor>

#Now since the main portion of the building is done, it would be nice to have an elevator.
#First we'll have to create an elevator shaft:

AddShaft 1, 2, 0, 6, 0, 9
ShaftCut 1, -4, -4.125 + 0.33, 4, 4.125, 0, 5

#in the above code, I added a regular shaft with the number of "1" at the position (0, 6), and told it to
#span floors 0 to 9 (1 to 10).  The second command cuts a hole for the shaft in all the levels below, and
#in that command the whole size of the shaft needs to be specified. You'll see that it spans horizontally
#from -4 to 4 (it's 8 feet wide), and depth-wize from -4.125 + 0.33 to 4.125 (the 0.33 is there to provide
#some floor area in front of the elevator door, and is the width of the external wall around the shaft.

#Now for the walls inside and outside of the shaft.  A floor and ceiling will also need to be made inside
#the shaft.  Notice that the commands such as AddShaftWall are based on the shaft's central position, while
#AddWall is not.

<Floor 0>
	FloorOrientation = top
	DrawWalls = false, true, false, false, false, false
	if[%floor% = 0] AddShaftFloor 1, Shaft1Base, Brick, 0.5, -4, -4.125, 4, 4.125, 0, 0, 0, 0
	DrawWalls = true, false, false, false, false, false
	if[%floor% = 9] AddShaftFloor 1, Shaft1Top, Brick, 0.5, -4, -4.125, 4, 4.125, %fullheight%, %fullheight%, 0, 0
	DrawWalls = true, true, false, false, false, false
	WallOrientation = left
	AddShaftWall 1, Shaft1Left, Brick, 0.33, -4, -4.125, -4, 4.125, %fullheight% + 10, %fullheight% + 10, 0, 0, 0, 0
	AddShaftWall 1, Shaft1Front, Brick, 0.33, -4, -4.125, 4, -4.125, %fullheight% + 10, %fullheight% + 10, 0, 0, 0, 0
	WallOrientation = right
	AddShaftWall 1, Shaft1Right, Brick, 0.33, 4, -4.125, 4, 4.125, %fullheight% + 10, %fullheight% + 10, 0, 0, 0, 0
	AddShaftWall 1, Shaft1Back, Brick, 0.33, -4, 4.125, 4, 4.125, %fullheight%, %fullheight%, 0, 0, 0, 0
	
	WallOrientation = right
	DrawWalls = true, false, false, false, false, false
	AddWall Shaft1LeftE, Wall1, 0.33, -4, -4.125 + 6 - 0.33, -4, 4.125 + 6 + 0.33, %height% + 10, %height% + 10, 0, 0, 0, 0, False
	AddWall Shaft1FrontE, Wall1, 0.33, -4 - 0.33, -4.125 + 6, 4 + 0.33, -4.125 + 6, %height% + 10, %height% + 10, 0, 0, 0, 0, False
	WallOrientation = left
	DrawWalls = false, true, false, false, false, false
	AddWall Shaft1RightE, Wall1, 0.33, 4, -4.125 + 6 - 0.33, 4, 4.125 + 6 + 0.33, %height% + 10, %height% + 10, 0, 0, 0, 0, False
	AddWall Shaft1BackE, Wall1, 0.33, -4 - 0.33, 4.125 + 6, 4 + 0.33, 4.125 + 6, %height%, %height%, 0, 0, 0, 0, False
<EndFloor>

<Floor 1>
	DrawWalls = true, true, false, false, false, false
	WallOrientation = right
	AddShaftWall 1, Shaft1Back, Brick, 0.33, -4, 4.125, 4, 4.125, %fullheight%, %fullheight%, 0, 0, 0, 0
	
	WallOrientation = left
	DrawWalls = false, true, false, false, false, false
	AddWall Shaft1BackE, Wall1, 0.33, -4 - 0.33, 4.125 + 6, 4 + 0.33, 4.125 + 6, %height%, %height%, 0, 0, 0, 0, False
<EndFloor>

<Floors 2 to 9>
	FloorOrientation = top
	DrawWalls = false, true, false, false, false, false
	if[%floor% = 0] AddShaftFloor 1, Shaft1Base, Brick, 0.5, -4, -4.125, 4, 4.125, 0, 0, 0, 0
	DrawWalls = true, false, false, false, false, false
	if[%floor% = 9] AddShaftFloor 1, Shaft1Top, Brick, 0.5, -4, -4.125, 4, 4.125, %fullheight%, %fullheight%, 0, 0
	DrawWalls = true, true, false, false, false, false
	WallOrientation = left
	AddShaftWall 1, Shaft1Left, Brick, 0.33, -4, -4.125, -4, 4.125, %fullheight%, %fullheight%, 0, 0, 0, 0
	AddShaftWall 1, Shaft1Front, Brick, 0.33, -4, -4.125, 4, -4.125, %fullheight%, %fullheight%, 0, 0, 0, 0
	WallOrientation = right
	AddShaftWall 1, Shaft1Right, Brick, 0.33, 4, -4.125, 4, 4.125, %fullheight%, %fullheight%, 0, 0, 0, 0
	AddShaftWall 1, Shaft1Back, Brick, 0.33, -4, 4.125, 4, 4.125, %fullheight%, %fullheight%, 0, 0, 0, 0
	
	WallOrientation = right
	DrawWalls = true, false, false, false, false, false
	AddWall Shaft1LeftE, Wall1, 0.33, -4, -4.125 + 6 - 0.33, -4, 4.125 + 6 + 0.33, %height%, %height%, 0, 0, 0, 0, False
	AddWall Shaft1FrontE, Wall1, 0.33, -4 - 0.33, -4.125 + 6, 4 + 0.33, -4.125 + 6, %height%, %height%, 0, 0, 0, 0, False
	WallOrientation = left
	DrawWalls = false, true, false, false, false, false
	AddWall Shaft1RightE, Wall1, 0.33, 4, -4.125 + 6 - 0.33, 4, 4.125 + 6 + 0.33, %height%, %height%, 0, 0, 0, 0, False
	AddWall Shaft1BackE, Wall1, 0.33, -4 - 0.33, 4.125 + 6, 4 + 0.33, 4.125 + 6, %height%, %height%, 0, 0, 0, 0, False
<EndFloors>

#The numbers can get complex, but for the Shaft1LeftE (external left wall), the X position is at -4,
#and the Z starting position is -4.125 (negative half of the width of the shaft) plus 6 (central Z position
#of the shaft) minus 0.33 (the width of the wall), and the Z ending position is 4.125 (positive
#half of the shaft's width) plus 6 (central Z position again) plus 0.33 (the width of the wall again)

#reset drawwalls
DrawWalls = true, true, false, false, false, false

#Now we create an elevator.  When creating one, first some basic parameters are defined and then
#the CreateElevator command is used to create it.  After that, the floors/walls are created, and then
#other objects such as panels, buttons, indicators, etc.

<Elevator 1>
    #standard elevator; 7 feet wide, 6 feet deep
    
    #First specify parameters
    Speed = 5
    Acceleration = 0.2
    Deceleration = 0.2
    AccelJerk = 0.2
    DecelJerk = 0.2
    ServicedFloors = 0 - 9
    AssignedShaft = 1
    LevelingOpen = 0.2
    Doors = 2
    
    #then create the elevator at position (0, 5.706) on the first floor (0)
    CreateElevator false, 0, 5.706, 0

    #elevator's floor
    FloorOrientation = top
    DrawWalls = true, true, true, true, true, true
    TextureOverride ElevExt, ElevFloor, ElevExt, ElevExt, ElevExt, ElevExt
    AddFloor Floor, ElevFloor, 0.2, -3.5, -3, 3.5, 3, 0, 0, 0, 0
    
    #elevator's ceiling
    FloorOrientation = bottom
    TextureOverride ElevCeiling, ElevExt, ElevExt, ElevExt, ElevExt, ElevExt
    AddFloor Ceiling, ElevCeiling, 0.2, -3.5, -3, 3.5, 3, 8, 8, 0, 0 #ceiling
    
    #elevator's back and right walls
    WallOrientation = right
    DrawWalls = true, true, false, false, false, false
    TextureOverride ElevWall, ElevExt, ElevExt, ElevExt, ElevExt, ElevExt
    AddWall Right, ElevWall, 0.2, 3.5, -3, 3.5, 3, 8, 8, 0, 0, 0, 0 #right wall
    
    #elevator's left wall
    WallOrientation = left
    TextureOverride ElevExt, ElevWall, ElevExt, ElevExt, ElevExt, ElevExt
    AddWall Left, ElevWall, 0.2, -3.5, -3, -3.5, 3, 8, 8, 0, 0, 0, 0 #left wall

    #elevator's panels
    DrawWalls = true, true, false, true, false, false
    TextureOverride ElevExt, ElevPanelMain, ElevExt, ElevExt, ElevExt, ElevExt
    AddWall Left Panel, ElevPanelMain, 0.2, -3.5, -3, -1.75, -3, 8, 8, 0, 0, 0, 0 #left panel
    DrawWalls = true, true, true, false, false, false
    TextureOverride ElevExt, ElevPanelMain, ElevExt, ElevExt, ElevExt, ElevExt
    AddWall Right Panel, ElevPanelMain, 0.2, 1.75, -3, 3.5, -3, 8, 8, 0, 0, 0, 0 #right panel

    WallOrientation = right
    DrawWalls = true, true, false, true, false, false
    TextureOverride ElevPanelMain, ElevExt, ElevExt, ElevExt, ElevExt, ElevExt
    AddWall Left Panel, ElevPanelMain, 0.2, -3.5, 3, -1.75, 3, 8, 8, 0, 0, 0, 0 #left panel
    DrawWalls = true, true, true, false, false, false
    TextureOverride ElevPanelMain, ElevExt, ElevExt, ElevExt, ElevExt, ElevExt
    AddWall Right Panel, ElevPanelMain, 0.2, 1.75, 3, 3.5, 3, 8, 8, 0, 0, 0, 0 #right panel
    
    #now the doors - this calls one of the functions defined in the data/scripts/elevator_doors.txt file
    #that we included at the beginning.  That file provides a number of pre-made door styles, and for this
    #we're going to use the standard center-open style.
    #shaft doors can also be created later in the floor section for them to be made on a per-floor basis
    
    WallOrientation = right
    AddDoorComponent 1, Left, ElevDoors, Black, 0.2, left, 0.3, -1.75, -3.01, 0, -3.01, 8, 0, 0, 0, 0, 0
    AddDoorComponent 1, Right, ElevDoors, Black, 0.2, right, 0.3, 0, -3.01, 1.75, -3.01, 8, 0, 0, 0, 0, 0
    FinishDoors 1
    WallOrientation = left
    AddDoorComponent 2, Left, ElevDoors, Black, 0.2, left, 0.3, -1.75, 3.01, 0, 3.01, 8, 0, 0, 0, 0, 0
    AddDoorComponent 2, Right, ElevDoors, Black, 0.2, right, 0.3, 0, 3.01, 1.75, 3.01, 8, 0, 0, 0, 0, 0
    FinishDoors 2
        
    SetAutoSize = true, true

    #The positioning of the doors is the tricky part.  You'll see that I placed the car doors at position
    #(0, -3.01) and the shaft doors at (0, -3.301).  If you look above at the panels, you'll notice that
    #they're Z position is -3, so I made sure to place to car doors immediately after that (-3.01) so that
    #they don't overlap the panels.  Since I gave them a depth size of 0.2, I need to place the shaft doors
    #0.2 feet beyond them, at -3.301.
    
    #I made the positioning more obvious in that one using math.  I positioned it horizontally (X) at -3, and
    #for the depth (Z) position, I took the shaft door position from above (-3.301), subtracted 0.2 from that
    #(the depth of the shaft doors), subtracted 0.66 from that (the size of the shaft interior and exterior
    #walls combined since each is 0.33), and finally subtracted an extra 0.001 to prevent it from interfering
    #with the wall.
    0.75 + (0.3 * 6)
    
    #panel
    #for the panel, the depth (Z) position is the front edge of the elevator (-3), plus the depth of the
    #panels (0.2), plus an extra 0.001 to prevent overlapping interference.
    #For the horizontal position, since it's supposed to be on the left panel (right when you're turned around
    #inside the elevator), I first put -1.75 (the right side of the left panel specified above), then subtracted
    #0.875 from that (half of the panel's width, or 1.75 / 2), and added 0.1 to that to pull it closer to the
    #door just a tiny bit.
    
    CreatePanel ElevPanel, 15, 5, back, -1.75 - 0.875 + 0.1, -3 + 0.2 + 0.001, 0.15, 0.15, 0.3, 0.45, 4, 0, 0
    AddFloorButton 1, switch.wav, Button10, ButtonLit10, 2, 3, 9, 1, 1
    AddFloorButton 1, Button9, ButtonLit9, 3, 3, 8, 1, 1
    AddFloorButton 1, Button8, ButtonLit8, 4, 3, 7, 1, 1
    AddFloorButton 1, Button7, ButtonLit7, 5, 3, 6, 1, 1
    AddFloorButton 1, Button6, ButtonLit6, 6, 3, 5, 1, 1
    AddFloorButton 1, Button5, ButtonLit5, 7, 3, 4, 1, 1
    AddFloorButton 1, Button4, ButtonLit4, 8, 3, 3, 1, 1
    AddFloorButton 1, Button3, ButtonLit3, 9, 3, 2, 1, 1
    AddFloorButton 1, Button2, ButtonLit2, 10, 3, 1, 1, 1
    AddFloorButton 1, Button1, ButtonLit1, 11, 3, 0, 1, 1
    AddControlButton 1, switch.wav, ButtonOpen, ButtonOpen, 13, 2, open, 1, 1
    AddControlButton 1, ButtonClose, ButtonClose, 13, 4, close, 1, 1
    AddControlButton 1, ButtonCancel, ButtonCancel, 14, 2, cancel, 1, 1
    AddControlButton 1, ButtonStop, ButtonStop, 14, 3, stop, 1, 1
    AddControlButton 1, ButtonAlarm, ButtonAlarm, 14, 4, alarm, 1, 1

    #Floor Indicator
    AddFloorIndicator back, -1.75 - 0.875 + 0.1, -3 + 0.2 + 0.001, 0.7, 0.5, 6.5
   
<EndElevator>

<Floor 0>
    WallOrientation = right
    AddShaftDoorComponent 1, 1, Left, ElevDoors, Black, 0.2, left, 0.3, -1.75, -3.301, 0, -3.301, 8, 0, 0, 0, 0, 0
    AddShaftDoorComponent 1, 1, Right, ElevDoors, Black, 0.2, right, 0.3, 0, -3.301, 1.75, -3.301, 8, 0, 0, 0, 0, 0
    FinishShaftDoor 1, 1
<EndFloor>

<Floor 1>
    WallOrientation = left
    AddShaftDoorComponent 1, 2, Left, ElevDoors, Black, 0.2, left, 0.3, -1.75, 3.301, 0, 3.301, 8, 0, 0, 0, 0, 0
    AddShaftDoorComponent 1, 2, Right, ElevDoors, Black, 0.2, right, 0.3, 0, 3.301, 1.75, 3.301, 8, 0, 0, 0, 0, 0
    FinishShaftDoor 1, 2
<EndFloor>

<Floors 2 to 9>
    WallOrientation = right
    AddShaftDoorComponent 1, 1, Left, ElevDoors, Black, 0.2, left, 0.3, -1.75, -3.301, 0, -3.301, 8, 0, 0, 0, 0, 0
    AddShaftDoorComponent 1, 1, Right, ElevDoors, Black, 0.2, right, 0.3, 0, -3.301, 1.75, -3.301, 8, 0, 0, 0, 0, 0
    FinishShaftDoor 1, 1
<EndFloor>

#Finally create some call buttons for the elevator, or you'll have a hard time getting into it (unless
#of course you use the elevator editor, but that's not very realistic).
#This code centers the buttons at the horizontal position of 3 feet.  The depth/Z position is figured out
#using other values from above - first I took 6, which is the central Z position of the shaft. Then I
#subtracted 4.125 (half of the shaft's depth) from that, then subtracted 0.33 (the shaft's external wall depth)
#and then subtracted an extra 0.1 to keep it away from the wall itself to prevent interference.

<Floor 0>
    CallButtonElevators = 1
    CreateCallButtons ElevExtPanels, ButtonUp, ButtonUpLit, ButtonDown, ButtonDownLit, 3, 6 - 4.125 - 0.33 - 0.1, 4, front, 0.5, 1, true, 0, 0

    AddDirectionalIndicator 1, true, false, true, ElevExtPanels, ArrowUp, ArrowUp_Lit, ArrowDown, ArrowDown_Lit, -3, -3.301 - 0.2 - 0.66 - 0.001, 6, front, 0.5, 1, true, 0, 0    
<EndFloor>

<Floor 1>
    CallButtonElevators = 1
    CreateCallButtons ElevExtPanels, ButtonUp, ButtonUpLit, ButtonDown, ButtonDownLit, -3, 6 + 4.125 + 0.33 + 0.1, 4, back, 0.5, 1, true, 0, 0

    AddDirectionalIndicator 1, true, false, true, ElevExtPanels, ArrowUp, ArrowUp_Lit, ArrowDown, ArrowDown_Lit, 3, 3.301 + 0.2 + 0.66 + 0.001, 6, front, 0.5, 1, true, 0, 0    
<EndFloor>

<Floors 2 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

    AddDirectionalIndicator 1, true, false, true, ElevExtPanels, ArrowUp, ArrowUp_Lit, ArrowDown, ArrowDown_Lit, -3, -3.301 - 0.2 - 0.66 - 0.001, 6, front, 0.5, 1, true, 0, 0    
<EndFloors>

