Skyscraper 1.1
Building Design Guide
Copyright (C)2005-2009 Ryan Thoryk
This document describes how to create your own buildings for the Skyscraper simulator, and also describes all of the available commands. Please note that the commands and syntax will change frequently during the simulator's development, and formatting will be cleaned up to make the code more readable. A graphical building designer is planned, which will generate these script files based on simplified CAD-like floorplan layouts, and will also allow the user to view the building in 3D as it's being created.
1. Starting a new building
Buildings are stored in text files in Skyscraper's buildings folder, usually at c:\program files\skyscraper\buildings on Windows, or in the "buildings" directory on Unix. The filenames end in BLD, and so you need to make sure your text file ends with ".bld" and not ".txt". To create a new building, first open up a text editor, and read the instructions below. When you're finished, save it into the buildings folder shown above, as something like "mybuilding.bld". The building will appear in Skyscraper's buildings list the next time you run it. A simplistic building is included for you to get a good idea of the overall format of a typical building data file. You might also want to open one of the other buildings that come with Skyscraper ("Triton Center.bld", "Glass Tower.bld", etc) for examples on the more advanced functions. Please note that the script syntax will change in the future.
2. General Stuff
1. Comments
To add a comment to your file, simply put the # symbol right
before your comment. For example:
# This is a comment
It's a good idea to use comment markers to add a title header
at the top of your building file. The Triton Center file has this header:
#The Triton Center
#Copyright ©2003-2009 Ryan Thoryk
2. Variables
Variables are marked with percent signs (%), and most system
variables will be described later. There are 256 user variables (0-255) which
can be set using the Set command:
Set 2 = 100
and then can be used later:
Height = %2%
3. IF statements
Basic IF statements can be made, with the following syntax:
if[expression] command
Available signs are = (equals), > (greater than), < (less than), ! (is not), & (and) and | (or). Expressions can also be enclosed in parenthesis. Note that the IF statement only works with the current line, and does not currently support multiple lines within an IF block, an "else" statement, or nesting.
For example, to set the height to 9.5 if the floor number is
less than 82:
if[%floor% < 82] Height
= 9.5
This example shows a complex expression:
if[%floor% < 82 &
(%height% = 3 | %height% = 5)] Height = 9.5
In the above example, the statement will be true if the floor
value is less than 82 and if the height value is either 3 or 5.
4. Inline calculations
Values can be calculated inline by using the following math
operators:
+ (plus), - (minus), / (divide), and * (multiply).
They can be used anywhere in the data file. Here's an example
of one being used with the Set command:
Set 1 = %floorheight% + 10
Parenthesis are also supported, for grouped operations. Here's
an example of a complex math expression:
Set 5 = %height% + (%interfloorheight%
* (4 / %altitude%))
5. Object parameters from outside floor sections
Information about a certain floor can be obtained elsewhere in the script, by referencing the floor in this manner:
Floor(number).parameter
Available parameters are Altitude, FullHeight and InterfloorHeight. Note that this function must only be called after the specified floor has been created.
Example:
Set 1 = Floor(5).Altitude
6. Global commands or functions that can be used anywhere in the script
In this section, Destobject refers to the destination object to create other objects in. It can be either floor (only available within a Floor section), external, landscape, or buildings (more will come soon). When the command is used inside a Floor section, and Destobject is not floor, the altitude of the current floor will be used, and altitude/y values specified in these commands will be offsets of that altitude.
a. AddTriangleWall - adds a textured triangular wall
Syntax: AddTriangleWall destobject,
name, texturename, x1, y1, z1, x2,
y2, z2, x3, y3, z3, tw,
th
Example: AddTrianglewall
external, My Triangle, brick, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0
b. AddWall - adds a textured wall
Syntax: AddWall destobject,
name, texturename, thickness, x1, z1, x2,
z2, height1, height2, altitude1, altitude2,
tw, th
Example: AddWall buildings,
Wall1, brick, 0.5, -10, -10, 10, 10, 15, 15, Floor(2).Altitude, Floor(2).Altitude,
0, 0
The command's parameters are the same as the Floor section's AddWall command.
c. AddFloor - adds a textured floor
Syntax: AddFloor destobject,
name, texturename, thickness, x1, z1, x2,
z2, altitude1, altitude2, tw, th
The command's parameters are the same as the Floor section's AddFloor command.
d. CreateWallBox - creates 4 walls (box) at
the specified coordinate locations
Syntax: CreateWallBox destobject,
name, texturename, x1, x2, z1, z2,
height, voffset, tw, th, inside, outside, top,
bottom
Example: CreateWallBox external,
My Box, brick, -10, 10, -10, 10, 15, 0, 0, 0, true, true, true, true
The parameters in this command are very similar to the ones in the AddWall command shown below in the Floor section, except that a box is created instead of a single wall. Inside and outside determine if the wall should be visible from the inside/outside, and top and bottom determine if the top and bottom walls should be drawn.
e. CreateWallBox2 - creates 4 walls (box) at
a specified central location
Syntax: CreateWallBox2 destobject,
name, texturename, centerx, centerz, widthx,
lengthz, height, voffset, tw, th,
inside, outside, top, bottom
Example: CreateWallBox2 external,
My Box, brick, 0, 0, 10, 10, 15, 0, 0, 0, false, true, false, false
The parameters are the same as the above command, except that
centerx and centerz define the center of the box, and widthx
and lengthz specify the width and length off of the center.
f. AddCustomWall - creates a custom polygon (wall, floor,
etc) with any number of vertex points. For example, a triangular wall has
3 vertex points, and a standard wall has 4. This function allows at least
3 vertices.
Syntax: AddCustomWall destobject,
name, texturename, x1, y1, z1, x2, y2, z2, x3, y3, z3, ..., tw, th, revx,
revy, revz
Example: AddCustomWall external,
My Wall, brick, 0, 0, 0, 0, 10, 0, 10, 10, 0, 10, 0, 10, 0, 0, false, false,
false
Revx, revy, and revz are either true or false, and determine if the texture mapping data should be reversed, per axis. If the texture looks strange in the simulator, mess around with the revx and revz values (revy flips the texture upside down).
g. AddShaft - creates a shaft at a specified
location and floor range
Syntax: AddShaft number,
type, centerx, centerz, startfloor, endfloor
Example: AddShaft 1, 2, 10,
10, 0, 9
The number parameter specifies the shaft number to create. Type is either 1 for a pipe/utility shaft, 2 for an elevator shaft, and 3 for a stairwell shaft. This command just tells the simulator the area that the shaft will take up, and does not create the actual shaft walls. Later on when you create the walls/floors for the shaft, make sure that you make a floor at the very bottom and very top of the shaft (they can extend beyond the walls).
h. CreateStairwell - creates a stairwell at
a specified location and floor range
Syntax: CreateStairwell number,
centerx, centerz, startfloor, endfloor
Example: CreateStairwell
1, 10, 10, 0, 9
The number parameter specifies the stairwell number to create. This command just tells the simulator the area that the stairwell will take up, and does not create the actual walls.
i. WallOrientation - changes the internal wall
orientation parameter, which is used for determining the wall thickness boundaries
in relation to their coordinates.
Syntax: WallOrientation =
direction
Example: WallOrientation
= left
The direction parameter can either be left, center, or right. Center is default. For example, if center is used, than half of the wall's thickness is to the right (positive) of it's x1/x2 or z1/z2 coordinates, and half is to the left (negative) of the coordinates. If left is used, than the coordinates define the wall's left (negative) edge, and the full thickness is to the right (positive) of those. If right is used, then again the coordinates define the wall's right (positive) edge, and the full thickness is to the left (negative) of those. See this graphic for a good example:
In the graphic above, the large box at the top shows what the X and Z coordinates correspond to. The lower examples show the wall orientation as left or right, and if either the difference in x values or z values is larger.
j. FloorOrientation - changes the internal
floor orientation parameter, which is used for determining the floor thickness
boundaries in relation to their coordinates.
Syntax: FloorOrientation
= direction
Example: FloorOrientation
= bottom
The direction parameter can either be bottom, center, or top. Top is default. For example, if center is used, than half of the floor's thickness is above (positive) it's x1/x2 or z1/z2 coordinates, and half is below (negative) the coordinates. If bottom is used, than the coordinates define the floor's bottom edge, and the full thickness is the top (positive). If top is used, then again the coordinates define the floor's top edge, and the full thickness is the bottom (negative).
k. DrawWalls - specifies which parts of a wall
or floor should be drawn.
Syntax: DrawWalls = MainNegative,
MainPositive, SideNegative, SidePositive, Top, Bottom
Example: DrawWalls = true,
true, false, false, false, false
The example shown is the default setting. This can seem complex, but I'll provide a graphic soon to explain it more easily. MainNegative is the main (that makes up the length if a wall, or the main area if a floor) face on the negative side, MainPositive is the main face on the positive side, SideNegative is the side (the part that is along the thickness) face on the negative side, SidePositive is the side face on the positive side; Top refers to either the top side if a wall, or to the positive X face if a floor; Bottom refers to either the bottom side if a wall, or the negative X face if a floor. In the graphic above in the WallOrientation section, let's say that the large box's difference in x values are larger (meaning that it is horizontal from the left to the right), and that it has the same z values. With that, MainNegative would be the front wall, MainPositive the back, SideNegative the left, SidePositive the right, etc.
l. ReverseExtents - reverses texture mapping
per axis
Syntax: ReverseExtents =
x, y, z
Example: ReverseExtents =
true, false, false
X, y, and z are either true or false, and determine if the texture mapping data should be reversed, per axis. If the texture looks strange in the simulator, mess around with the x and z values (y flips the texture upside down).
m. ReverseAxis - reverses the axis that the
difference in altitude/voffset for walls and floors corresponds to. If this
is set to false (default), then it corresponds to the Z axis; otherwise use
the X axis.
Syntax: ReverseAxis = value
n. ShaftCut - used in conjunction with a shaft
object - performs a vertical box cut on all floor objects (floors, ceilings,
interfloor, etc) in the specified range.
Syntax: ShaftCut number,
startx, startz, endx, endz, start_voffset, end_voffset
Example: ShaftCut 1, -4,
-3.5, 4, 3.5, 0, 5
Number is the number of the shaft object to work with. Startx, startz, endx, and endz are two sets of coordinates that specify the cut box's start position and end position, relative to the shaft's central position. Start_voffset is the position above the starting floor's altitude to start the cut at, and end_voffset is the position above the ending floor's altitude to end the cut at. The example cuts a box for shaft 1, with a width from -4 to 4, and a length from -3.5 to 3.5, starting at the starting floor's altitude, and ending at 5 feet above the ending floor's altitude.
o. CutStairwell - used in conjunction with
a stairwell object - performs a vertical box cut on all floor objects (floors,
ceilings, interfloor, etc) in the specified range. For the parameters, see
the ShaftCut command.
Syntax: CutStairwell
number, startx, startz, endx, endz, start_voffset, end_voffset
Example: CutStairwell 1,
-4, -3.5, 4, 3.5, 0, 5
p. Isect - the Isect function calculates the
position that a line intersects with a certain object, such as a floor. This
is mainly used with angled walls that span multiple floors, to find the edge
location of the wall at each level without doing any manual calculations.
Since this is a function, it can be used in-line anywhere.
Syntax: isect(destobject,
objectname, startx, starty, startz, endx, endy, endz)
Example: isect(external,
wall1, 10, 10, 0, -10, 10, 0)
Destobject is the destination object to get the object from (floor, external, landscape, or buildings). Startx, starty, and startz make up the position of the starting position, and endx, endy and endz make up the ending position. The first intersection of the named object is the return value, in "X, Y, Z" format (for example, "10, 1, 3").
q. SetAutoSize - enables or disables texture
autosizing
Syntax: SetAutoSize = AutoWidth,
AutoHeight
Example: SetAutoSize = true,
true
This command will determine if the simulator should automatically size texture appropriately when applied to an object, such as a wall or floor. By default, both are enabled. The AutoWidth and AutoHeight parameters correspond to the "tw" and "th" parameters of the AddWall, AddFloor, etc commands. If any are false, then the parameters specified in the AddWall etc commands multiply the texture values stored with with the Load or LoadRange commands (see below); those values relate to the number of times a texture is tiled; so if AutoHeight is set to False, "2" is specified in the "th" value of AddWall, and the texture's stored "th" value is 1, then the texture will be tiled twice vertically. If either are true, the specified value will me multiplied by the related stored texture value and then autoadjusted.
r. TextureOverride - overrides textures for
the next command. Currently only works with the different AddWall, AddFloor
and AddInterFloor commands.
Syntax: TextureOverride MainNegativeTex,
MainPositiveTex, SideNegativeTex, SidePositiveTex, TopTex, BottomTex
Example: TextureOverride
Metal1, ElevFloor, Metal1, Metal1, Metal1, Metal1
This command will allow you to specify multiple textures for a single command such as AddWall. It will only work on the command immediately after this one. In the above example, the Main Positive side of the object will have the texture "ElevFloor", but all other sides will use "Metal1".
7. END command
The End command tells the software to stop processing the current
script and start the simulation. This is optional.
Example: <end>
8. BREAK command
The Break command triggers a break section in the script processor,
and is used when running the simulator in debug mode. A debugger breakpoint
can be set on the associated line in fileio.cpp, and when this command is
called, the debugger will hit the breakpoint.
Example: <break>
3. The Globals Section
The Globals section contains the general information
about your building. The section starts with this header:
<Globals>
and ends with this footer:
<EndGlobals>
Parameters are placed between those two markers, and look like
this:
Parameter = value
Example:
Name = Triton Center
Parameters:
1. Name - building name, required
Example: Name = My Building
2. Designer - name of building's designer,
optional
Designer = Me
3. Location - location of the building, optional
Location = 100 Main Street
4. Description - Brief description of the
building, optional
Description = A really average
building
5. Version - Version of the building (can be text), optional
Version = 1
6. HorizScale - horizontal scaling modifier; default is 1,
optional
HorizScale = 2 (makes
each horizontal foot become 2 feet, keeping vertical feet at the default)
7. CameraAltitude - camera's normal altitude in feet above
the floor, required
CameraAltitude = 3.2
8. CameraFloor - camera's starting floor, starting with 0
(like Floors command), required
CameraFloor = 0
9. CameraPosition - camera's starting position in X (left/right)
and Z (in/out) feet coordinates, required
Syntax: CameraPosition =
X, Z
CameraPosition = 0, -10
10. CameraDirection - direction the camera's facing on startup,
in X (left/right), Y (up down), and Z (in/out) feet coordinates, required
CameraDirection = 0, 10,
28.8
11. CameraRotation - rotation of the camera
on startup, required
CameraRotation = 0, 0, 0
12. Sky - which skybox texture pack to use.
In the following example, the chosen pack is "noon", and the file
"sky-noon.zip" will be loaded.
Sky = noon
4. The Textures Section
The Textures section loads textures into the simulation and
assigns names to them, for use in the rest of the sections. The section starts
with this header:
<Textures>
and ends with this footer:
<EndTextures>
1. Load - loads a texture
Syntax: Load filename,
name, tile_x,
tile_y
Example: Load data\brick1.jpg,
Brick, 1, 1
2. LoadRange - loads a numeric range of textures,
and the current number is available in the number variable (%number%)
Syntax: LoadRange startnumber,
endnumber, filename, name,
tile_x, tile_y
Example: LoadRange 2, 138,
data\floorindicators\%number%.jpg, Button%number%, 1, 1
This example will load the file 2.jpg and name it Button2, 3.jpg as Button3, and so on. The values tile_x and tile_y are per-texture multipliers. For example, if you set tile_x to 2, and you specify a texture width (tw) of 2 during an AddFloor command later, the tiling value will be 4 (2 times 2), and the texture will be repeated 4 times horizontally.
5. The Floor Sections
There are 2 Floor sections available - Floor
and Floors. Floor specifies a single floor, while Floors
specifies a range of floors.
For a single floor, the section would start with this:
<Floor number>
and end with this:
<EndFloor>
For example, a floor section for a lobby would use this:
<Floor 0>
For multiple floors, the section would start with this:
<Floors start
to finish>
and end with this:
<EndFloors>
For example, to work with floors 5-10, you would type:
<Floors 5 to 10>
Floors above ground start with 0 (so a 15-story building would have floors 0-14). Also, floors must be made in the proper order: basement levels must be made first in decending order (-1, -2, -3 etc), and then above-ground floors in ascending order (0, 1, 2, etc).
Variables:
%floor%
- contains the current floor number
%height%
- contains the current floor's ceiling height
%interfloorheight%
- contains the current floor's interfloor height (spacing between floors)
%fullheight%
- contains the current floor's total height, including the interfloor height
Parameters:
1. Name - the name of the current floor, required
Example: Name = Floor %floor%
2. ID - the floor indicator name for the current
floor, such as L (for Lobby), LL (lower level), M (Mezzanine), etc. This is
also used to determine what texture should be loaded for the elevator floor
indicators and floor signs. The texture name would be "Button[ID]"
- so if the ID is 10, the texture name would be "Button10".
ID = %floor%
3. Type - the type of floor the current floor
is. The types are still being defined, but the currently used ones are Basement,
Lobby, Mezzanine, Conference, Office, Service, Skylobby, Hotel, Apartment,
Condominium, Restaurant, Observatory, Recreation, Ballroom, Communications,
and Roof. (Required)
Type = Office
4. Description - description of the current
floor, optional
Description = Offices
5. Height - the floor-to-ceiling height of
the current floor, required
Height = 9.5
6. InterfloorHeight - the height in feet of
the space between floors (below each floor), starting at the floor's altitude,
and ending right below the level's floor; required.
InterfloorHeight = 2.24
7. Altitude - this parameter is optional and
is only recommended if the first level has an interfloor area that needs to
be below ground. If this parameter is not used, the altitude will be calculated
automatically.
Altitude = -2.24
8. Group - group floors together. This is a
list of comma-separated floor numbers (or a range specified with the - symbol)
that should be enabled along with this floor when the user arrives at this
floor. For example, if a 2-story room has a balcony, and the room base and
balcony are separate floors, you would specify the other floor's number in
this parameter.
Examples:
Group = 5
Group = 4, 5
Group = 4 - 10
Commands:
1. Exit - exits the current floor section
2. AddFloor - adds a textured floor with the
specified dimensions to the current floor/level
Syntax: AddFloor name,
texturename, thickness, x1, z1, x2, z2,
voffset1, voffset2, tw, th, isexternal
Example: AddFloor My Floor,
brick, 0.5, -10, -10, 10, 10, 0, 0, 0, 0, False
Voffset1 and voffset2 are the height in feet above the current floor's altitude; tw and th are to size/tile the texture (0 lets the app autosize them), and isexternal determines if the floor is part of the building's external framework, or is part of the current floor (is either True or False). Name is a user-defined name for the object.
3. AddWall - adds a textured wall with the
specified dimensions to the current floor/level
Syntax: AddWall name,
texturename, thickness, x1, z1, x2, z2,
height1, height2, voffset1, voffset2,
tw, th, isexternal
Example: AddWall My Wall,
brick, 0.5, -10, -10, 10, 10, 10, 10, 0, 0, 0, 0, False
Height1 is the wall height in feet at the first coordinate set (x1 and z1), and height2 is for the second set (x2, and z2). Voffset1 is the vertical offset in feet (from the floor's altitude) for the first coordinate set, and voffset2 is for the second set. Tw and th are the texture sizing/tiling multipliers, and isexternal determines if the wall is part of the building's external framework (true) or if it's part of the current floor (false).
4. AddInterfloorFloor - adds a textured floor
below the floor of the current floor/level
Syntax: AddInterfloorFloor
name, texturename, thickness, x1, z1, x2,
z2, voffset1, voffset2, tw, th
Example: AddInterfloorFloor
My IFloor, brick, 0.5, -10, -10, 10, 10, 0, 0, 0, 0
The parameters are the same as the AddFloor command, except the voffset values are the height offset in feet above the current floor's altitude, and not above the base floor level.
5. AddInterfloorWall - adds a textured wall
below the floor of the current floor/level
Syntax: AddInterfloorWall
name, texturename, thickness, x1, z1, x2,
z2, height1, height2, voffset1, voffset2,
tw, th
The parameters are the same as the AddWall command, and the voffset values are the same as the AddInterfloorFloor command.
6. AddShaftFloor - adds a textured floor to
the specified shaft, on the current floor
Syntax: AddShaftFloor number,
name, texturename, thickness, x1, z1, x2,
z2, voffset1, voffset2, tw, th
Example: AddShaftFloor 1,
My Floor, brick, 0.5, -10, -10, 10, 10, 0, 0, 0, 0
The parameters are the same as the AddFloor command, and the number value is the shaft number to use. The x1, z1, x2, and z2 parameters are offsets of the shaft's origin (similar to creating elevator walls and floors)
7. AddShaftWall - adds a textured wall to the
specified shaft, on the current floor
Syntax: AddShaftWall number,
name, texturename, thickness, x1, z1, x2,
z2, height1, height2, voffset1, voffset2,
tw, th
The parameters are the same as the AddWall command, and the number value is the shaft number to use. Also, the x1, z1, x2, and z2 parameters are offsets of the shaft's origin (similar to creating elevator walls and floors)
8. AddStairsFloor - adds a textured floor to
the specified stairwell, on the current floor
Syntax: AddStairsFloor number,
name, texturename, thickness, x1, z1, x2,
z2, voffset1, voffset2, tw, th
Example: AddStairsFloor 1,
My Floor, brick, 0.5, -10, -10, 10, 10, 0, 0, 0, 0
The parameters are the same as the AddFloor command, and the number value is the stairwell number to use
9. AddStairsWall - adds a textured wall to
the specified stairwell, on the current floor
Syntax: AddStairsWall number,
name, texturename, thickness, x1, z1, x2,
z2, height1, height2, voffset1, voffset2,
tw, th
The parameters are the same as the AddWall command, and the number value is the stairwell number to use. Also, the x1, z1, x2, and z2 parameters are offsets of the stairwell's origin (similar to creating elevator walls and floors)
10. ColumnWallBox - creates 4 walls (box) at
the specified coordinate locations, as part of the current floor's columnframe
mesh
Syntax: CreateWallBox destobject,
name, texturename, x1, x2, z1, z2,
height, voffset, tw, th, inside, outside, top,
bottom
Example: CreateWallBox external,
My Box, brick, -10, 10, -10, 10, 15, 0, 0, 0, true, true, true, true
For parameter information, see the CreateWallBox command above. In this command, the default voffset is the floor's altitude.
11. ColumnWallBox2 - creates 4 walls (box)
at a specified central location, as part of the current floor's columnframe
mesh
Syntax: CreateWallBox2 destobject,
name, texturename, centerx, centerz, widthx,
lengthz, height, voffset, tw, th,
inside, outside, top, bottom
Example: CreateWallBox2 external,
My Box, brick, 0, 0, 10, 10, 15, 0, 0, 0, false, true, false, false
For parameter information, see the CreateWallBox2 command above. In this command, the default voffset is the floor's altitude.
12. CallButtonElevators - comma-separated list
of elevators the next created call button set will work with (this must be
specified before CreateCallButtons)
Example: CallButtonElevators
= 1, 2, 3, 4
13. CreateCallButtons - creates a call button
set
Syntax: CreateCallButtons
BackTexture, UpButtonTexture, DownButtonTexture, CenterX,
CenterZ, voffset, direction, BackWidth, BackHeight, ShowBack, tw, th
Example:
Create Marble, CallButtonsTex, CallButtonsTex, -10, 0, 4, right, 0.5,
1, true, 1, 1
BackTexture is the texture of the wall plate behind the buttons
UpButtonTexture and DownButtonTexture are the textures used for the buttons themselves
CenterX and CenterZ are the central location of the call button set object
voffset is the altitude offset that the object is above each floor
direction determines the direction the call buttons
face:
'front' means they face towards the front of the building
'back' means they face towards the back of the building
'left' means they face left
'right' means they face right
BackWidth and BackHeight are the width and height of the wall plate
ShowBack determines if the wall plate should be shown, and is either true or false
tw and th are the texture scaling for the wall plate.
The up and down buttons will be automatically created based on the range of the first specified elevator in the CallButtonElevators command (above).
14. AddStairs - creates a custom staircase
at the specified location.
Syntax: AddStairs number,
name, texture, direction, CenterX, CenterZ, width, risersize, treadsize, num_stairs,
voffset, tw, th
Example: AddStairs 1, TestStairs,
Brick, left, 10, 15, 5, 0.5, 0.5, 10, 0, 0, 0
The direction parameter specifies the direction the staircase faces (where the bottom step is), and so if a staircase goes up from left to right, the direction would be left. Width specifies the step width; risersize specifies the height of each step riser (vertical portion); treadsize specifies the length of each step tread/run (horizontal portion); num_stairs specifies the total number of steps to create (including the above landing platform, but not including the base platform). To calculate the length of the staircase, simply multiply num_stairs with treadsize. To determine the height of the staircase, multiply num_stairs with risersize, and add the voffset value. Note that the tread of the top step is not drawn (the top step is the landing platform); therefore for a staircase containing 10 steps, the total staircase width would be comprised of 9 treads. The height is simply num_stairs times risersize.
15. AddDoor - adds a textured door in the specified
location, and performs a wall cut on that area (this must be called after
the associated wall is created)
Syntax: AddDoor texturename,
thickness, direction, CenterX, CenterZ, width,
height, voffset, tw, th
Direction specifies the direction the door faces (the side in
which the handle is on the left) and also the direction it opens. These are
the values:
1 - faces left, opens left
2 - faces left, opens right
3 - faces right, opens right
4 - faces right, opens left
5 - faces front, opens front
6 - faces front, opens back
7 - faces back, opens back
8 - faces back, opens front
16. AddStairsDoor - adds a textured door for
the specified stairwell, in a location relative to the stairwell's center.
This also performs a wall cut on that area (this must be called after the
associated wall is created)
Syntax: AddStairsDoor
number, texturename, thickness, direction, CenterX, CenterZ,
width, height, voffset, tw, th
Number specifies the stairwell number. Direction specifies the direction the door faces and also the direction it opens. For values of this, look at the AddDoor command above.
17. Cut - performs a manual box cut on an area
within the current floor
Syntax: Cut x1, y1, z1, x2,
y2, z2, cutwalls, cutfloors
Example: Cut -5, -5,
-5, 5, 5, 5, false, true
The x, y and z values specify the start and end coordinates of the box cut. The Y values are relative to the current floor. If cutwalls is true, the function will cut walls; if cutfloors is true, it'll cut floors.
6. The Elevator Section
The Elevator section allows you to create elevators for your building. Elevators are numbered, starting with 1.
The section headers and footers are similar to the ones in the
Floor section.
To specify a single elevator, you would type something like:
<Elevator 1>
and end it with:
<EndElevator>
For a range of elevators, you would use something like:
<Elevators 2 to 10>
and end with:
<EndElevators>
Variables:
%elevator% - number of the current elevator
Parameters:
1. Speed - maximum speed of the elevator, in
feet per second
Example: Speed = 20
2. Acceleration - acceleration speed of the
elevator, in feet per second
Example: Acceleration = 0.015
3. Deceleration - deceleration speed of the
elevator, in feet per second
Example: Deceleration = 0.0075
4. OpenSpeed - open/close speed of the elevator
doors
Example: OpenSpeed = 0.2
5. ServicedFloors - a comma-separated list
of floors this elevator services. Ranges can also be specified by putting
a "-" between the numbers
Example: ServicedFloors =
0, 5, 6, 7-30, 31
6. AssignedShaft - the shaft number this elevator
is in
Example: AssignedShaft =
1
7. DoorTimer - the length of time (in milliseconds)
that the elevator doors should stay open before automatically closing. The
default is 5000, or 5 seconds.
Example: DoorTimer = 10000
Commands:
1. CreateElevator - creates an elevator at
the specified location
Syntax: CreateElevator x,
y, floor
Example:
CreateElevator 0, 10, 0
X and Y are the coordinates to place the center of the elevator at, and Floor is the floor to place the elevator on.
2. AddFloor - adds a textured floor with the
specified dimensions for the elevator
Syntax: AddFloor name,
texturename, thickness, x1, z1, x2, z2,
voffset1, voffset2, tw, th
Example: AddFloor Floor1,
Wood2, 0.5, -3.5, -3, 3.5, 3, 0, 0, 0, 0
3. AddWall - adds a textured wall for the elevator
Syntax: AddWall name,
texturename, thickness, x1, z1, x2, z2, height1,
height2, voffset1, voffset2, tw,
th
Example: AddWall Wall1, Wood1,
0.5, -3.5, 3, 3.5, 3, 8, 8, 0, 0, 2, 2
The elevator's AddWall command is similar to the other AddWall commands.
4. AddDoors - creates elevator doors
Syntax: AddDoors texturename,
thickness, CenterX, CenterZ, width, height, direction, tw, th
The AddDoors command creates working elevator doors at the central location specified by CenterX and CenterZ, with width and height specifiying the width and height of each door, and Direction specifying the direction that the doors face (currently there are only 2: false if the doors are on the left or right sides, and true if the doors are on the front or back sides)
5. AddShaftDoors - creates shaft elevator doors
Syntax: AddShaftDoors texturename,
thickness, CenterX, CenterZ, tw, th
The AddShaftDoors command creates working shaft elevator doors at the central location specified by CenterX and CenterZ. Other parameters such as width, height, and direction are taken from the AddDoors command (so the regular elevator doors need to be created first). These doors should be moved slightly away from the elevator doors (to separate them both). Also, this command creates doors at all the floors specified in the ServicedFloors value, and cuts any shaft walls that are within the door area (and so this must be called after the shaft walls are created).
6. CreatePanel - creates a button panel
Syntax: CreatePanel texturename,
rows, columns, direction, CenterX, CenterZ, buttonwidth, buttonheight,
spacingX, spacingY, voffset, tw, th
Example:
CreatePanel Wall1, 5,
5, right, -3, -3, 0.15, 0.15, 0.3, 0.45, 4.5, 0, 0
The CreatePanel command creates a button panel at a position relative to the elevator's center position (origin). Rows and Columns define the grid size of the panel. Direction is either "front", "back", "left" or "right", defining which direction the panel faces. SpacingX is the space (percent of a button's width) horizontally between each button, and spacingY is the space (percent of a button's height) vertically between each button. Not all positions need to be used; this is simply to provide a grid layout for the panel. This command also determines the width and height of the panel based on the spacing and button sizes. A simple formula for determining panel width or height is this - for width, it's (columns * buttonwidth) + (spacingX * (columns + 1)); for height, just swap columns with rows and spacingX with spacingY.
7. AddFloorButton - creates a floor button
on the panel
Syntax: AddFloorButton panel_number,
texturename, row, column, floor, width, height
The AddFloorButton command creates a floor button on the button panel created with CreatePanel. Panel_number specifies the number of the panel to add the button to; the number can be either 1 or 2. Row and Column specify the position on the grid where the button should be. Floor specifies the floor number that this button calls. Width and Height specify the width and height of the button, as a percentage of a single grid unit size (1 being 100%, 0.5 being 50%). If both values are 0, the default of 1 is used for both values. If only one of the values is 0, then the exact size other is used; for example, if width is 0 and height is 1 (or any other number), then the width will end up being the same size as the height.
8. AddControlButton - creates a control button
on the panel
Syntax: AddControlButton
panel_number, texturename, row, column, type, width, height
The AddControlButton command creates a command button on the panel created with CreatePanel. Row and Column are the same as the AddFloorButton command, and Type can be either "open", "close", "cancel", "stop" or "alarm". See the above command for a description of the Width and Height values.
9. AddFloorIndicator - creates a floor indicator
Syntax: AddFloorIndicator
direction, CenterX, CenterZ, width, height, voffset
The AddFloorIndicator command creates a floor indicator at the position (relative to the elevator) specified by CenterX and CenterZ. Direction is the direction the indicator faces, and can be either "left", "right", "front" or "back".
8. Small Example Building
To see an example of a small simplistic building in code, look at the Simple.bld file in Skyscraper's buildings directory. It's also available online here.