Help:Design Guide: Difference between revisions
Elevator1512 (talk | contribs) |
Elevator1512 (talk | contribs) |
||
(21 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
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. | 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. | ||
== Starting a new building == | == 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 when you choose "Other buildings..." in Skyscraper's main menu 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. | 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 when you choose "Other buildings..." in Skyscraper's main menu 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. | ||
== General Stuff == | == General Stuff == | ||
=== Comments === | === Comments === | ||
To add a comment to your file, simply put the # symbol right before your comment. For example:<br><code><nowiki># This is a comment</nowiki></code> | |||
To add a comment to your file, simply put the # symbol right before your comment. For example: | |||
<code><nowiki># This is a comment</nowiki></code> | |||
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:<br> | 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:<br> | ||
<code><nowiki>#The Triton Center</nowiki></nowiki></code><br> | <code><nowiki>#The Triton Center</nowiki></nowiki></code><br> | ||
<code><nowiki>#Copyright | <code><nowiki>#Copyright ©2002-2013 Ryan Thoryk</nowiki></code> | ||
=== Variables === | === Variables === | ||
Variables are marked with percent signs (%), and most system variables will be described later. Variables can be set using the <code>Set</code> command: | Variables are marked with percent signs (%), and most system variables will be described later. Variables can be set using the <code>Set</code> command: | ||
<code><nowiki>Set myvariable = 100</nowiki></code><br> | <code><nowiki>Set myvariable = 100</nowiki></code><br> | ||
Line 27: | Line 22: | ||
=== IF/While statements === | === IF/While statements === | ||
Basic IF and While statements can be made, with the following syntax: | Basic IF and While statements can be made, with the following syntax: | ||
*<code><nowiki>if[expression] command</nowiki></code> | *<code><nowiki>if[expression] command</nowiki></code> | ||
*<code><nowiki>while[expression] command</nowiki></code> | |||
Available signs are <code>=</code> (equals), <code>></code> (greater than), <code><</code> (less than), <code>!</code> (is not), <code>&</code> (and) and <code>|</code> (or). Expressions can also be enclosed in parenthesis. Note that IF/While statements only work with the current line, and do not currently support multiple lines within an IF/While block, an "else" statement, or nesting. A While statement will loop the current line until the expression is false, so be careful with this because it can create an infinite loop if the expression is always true. See the ''[[#Functions|Functions]]'' section below for an example of a While statement. | Available signs are <code>=</code> (equals), <code>></code> (greater than), <code><</code> (less than), <code>!</code> (is not), <code>&</code> (and) and <code>|</code> (or). Expressions can also be enclosed in parenthesis. Note that IF/While statements only work with the current line, and do not currently support multiple lines within an IF/While block, an "else" statement, or nesting. A While statement will loop the current line until the expression is false, so be careful with this because it can create an infinite loop if the expression is always true. See the ''[[#Functions|Functions]]'' section below for an example of a While statement. | ||
Line 143: | Line 137: | ||
* rnd(''limit'') - generate random number from 0 to limit | * rnd(''limit'') - generate random number from 0 to limit | ||
* round(''number, decimals'') - round number to nearest value; the ''decimals'' parameter is optional | * round(''number, decimals'') - round number to nearest value; the ''decimals'' parameter is optional | ||
=== For Loops === | |||
For loops can be created by specifying an iterator variable, and the range to use, with the following syntax:<br> | |||
<code><For iterator start To end><br> | |||
''(code)''<br> | |||
<EndFor></code> | |||
The For loop will loop until it completes the "end" value, and can iterate up or down. The value of the iteration is stored in the iterator variable and the variable name must be unique. | |||
In the following example, the iterator variable will be printed out on each iteration: | |||
<code><For i 1 to 3><br> | |||
Print %i%<br> | |||
<EndFor></code> | |||
When the code is run, this is the result: | |||
<code>1<br> | |||
2<br> | |||
3</code> | |||
For loops can be nested, like this: | |||
<code><For i 1 to 3><br> | |||
<For j 1 to 4><br> | |||
Print %i% : %j%<br> | |||
<EndFor><br> | |||
<EndFor></code> | |||
When the code is run, this is the result:<br> | |||
<code>1 : 1<br> | |||
1 : 2<br> | |||
1 : 3<br> | |||
1 : 4<br> | |||
2 : 1<br> | |||
2 : 2<br> | |||
2 : 3<br> | |||
2 : 4<br> | |||
3 : 1<br> | |||
3 : 2<br> | |||
3 : 3<br> | |||
3 : 4</code> | |||
== The Globals Section == | == The Globals Section == | ||
Line 190: | Line 226: | ||
#Load - loads a texture<br>Syntax: <code>Load filename, name, tile_x, tile_y[, force]</code><br>Example: <code>Load data\brick1.jpg, Brick, 1, 1</code><br>This example will load the file <code>brick.jpg</code> and name it <code>Brick</code>. 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. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. | #Load - loads a texture<br>Syntax: <code>Load filename, name, tile_x, tile_y[, force]</code><br>Example: <code>Load data\brick1.jpg, Brick, 1, 1</code><br>This example will load the file <code>brick.jpg</code> and name it <code>Brick</code>. 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. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. | ||
# | #LoadRange - loads a numeric range of textures, and the current number is available in the number variable (%number%)<br>Syntax:<code>LoadRange startnumber, endnumber, filename, name, tile_x, tile_y[, force]</code><br>Example: <code>LoadRange 2, 138, data\floorindicators\%number%.jpg, Button%number%, 1, 1</code><br>This example will load the file <code>2.jpg</code> and name it <code>Button2</code>, <code>3.jpg</code> as <code>Button3</code>, and so on. The values <code>tile_x</code> and <code>tile_y</code> are per-texture multipliers. For example, if you set <code>tile_x</code> to 2, and you specify a texture width (tw) of 2 during an <code>AddFloor</code> command later, the tiling value will be 4 (2 times 2), and the texture will be repeated 4 times horizontally. The ''force'' value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. | ||
#LoadAnimated - loads a set of textures to use as a single animated texture<br>Syntax: <code>LoadAnimated filename1, filename2, ..., name, duration, tile_x, tile_y[, force]</code><br>Example: <code>LoadAnimated data/pic1.jpg, data/pic2.jpg, data/pic3.jpg, myanimation, 2, 1, 1</code><br>This example will load the files pic1.jpg, pic2.jpg and pic3.jpg and associate them with the texture material "myanimation". When "myanimation" is used, those three images will automatically be displayed in order, in a loop. <code>Duration</code> refers to the length of the animation in seconds. The values <code>tile_x</code> and <code>tile_y</code> are per-texture multipliers. For example, if you set <code>tile_x</code> 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. The ''force'' value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. | #LoadAnimated - loads a set of textures to use as a single animated texture<br>Syntax: <code>LoadAnimated filename1, filename2, ..., name, duration, tile_x, tile_y[, force]</code><br>Example: <code>LoadAnimated data/pic1.jpg, data/pic2.jpg, data/pic3.jpg, myanimation, 2, 1, 1</code><br>This example will load the files pic1.jpg, pic2.jpg and pic3.jpg and associate them with the texture material "myanimation". When "myanimation" is used, those three images will automatically be displayed in order, in a loop. <code>Duration</code> refers to the length of the animation in seconds. The values <code>tile_x</code> and <code>tile_y</code> are per-texture multipliers. For example, if you set <code>tile_x</code> 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. The ''force'' value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. | ||
#LoadAlphaBlend - loads a texture with a specular mask texture and blending texture, used to make things like reflection effects<br>Syntax: <code>LoadAlphaBlend filename, specular_filename, blend_filename, name, spherical, tile_x, tile_y[, force]</code><br>Example: <code>LoadAlphaBlend data/windows.jpg, data/windows_spec.png, data/sky.jpg, mywindows, true, 1, 1</code><br>This example will load the texture windows.jpg normally, and will load windows_spec.png as a specular mask (which needs to be a file that contains an alpha blended image that is used to determine how the blending texture applies to the original texture), and loads a texture to blend as sky.jpg (see Skyscraper's data folder for examples of this). The ''spherical'' parameter determines if the texture is spherically mapped (true) or planar mapped (false). 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. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. | #LoadAlphaBlend - loads a texture with a specular mask texture and blending texture, used to make things like reflection effects<br>Syntax: <code>LoadAlphaBlend filename, specular_filename, blend_filename, name, spherical, tile_x, tile_y[, force]</code><br>Example: <code>LoadAlphaBlend data/windows.jpg, data/windows_spec.png, data/sky.jpg, mywindows, true, 1, 1</code><br>This example will load the texture windows.jpg normally, and will load windows_spec.png as a specular mask (which needs to be a file that contains an alpha blended image that is used to determine how the blending texture applies to the original texture), and loads a texture to blend as sky.jpg (see Skyscraper's data folder for examples of this). The ''spherical'' parameter determines if the texture is spherically mapped (true) or planar mapped (false). 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. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. | ||
Line 204: | Line 240: | ||
#Scale - sets a texture's scaling factor. This can be used with other texture modifiers.<br>Syntax: <code>Scale name, x_scale, y_scale</code><br>Example: <code>Scale Brick1, 30</code><br>In the example, the Brick1 texture is scaled to half the size, in both width and height. | #Scale - sets a texture's scaling factor. This can be used with other texture modifiers.<br>Syntax: <code>Scale name, x_scale, y_scale</code><br>Example: <code>Scale Brick1, 30</code><br>In the example, the Brick1 texture is scaled to half the size, in both width and height. | ||
#Transform - sets an advanced transformation method on the texture. This can be used with other texture modifiers, and also can be used multiple times to create multiple transformations.<br>Syntax: <code>Transform name, type, wave_type, base, frequency, phase, amplitude</code><br>Example: <code>Transform Brick1, rotate, sine, 0.2, 0.2, 0.1, 1.0</code><br>This command applies an advanced transformation method on the texture. Type is the animation type modified, and can either be ''scroll_x'', ''scroll_y'', ''rotate'', ''scale_x'', or ''scale_y''. ''Wave_type'' defines the type of waveform applied to the transformation, which creates a variable speed of the animation. The values are ''sine'' (a typical sine wave which smoothly loops between min and max values), ''triangle'' (an angled wave which increases & decreases at constant speed, changing instantly at the extremes), ''square'' (max for half the wavelength, min for the rest with instant transition between), ''sawtooth'' (gradual steady increase from min to max over the period with an instant return to min at the end), ''inverse_sawtooth'' (gradual steady decrease from max to min over the period, with an instant return to max at the end), or ''pwm'' (Pulse Width Modulation; like square, except the high to low transition is controlled by duty cycle). ''Base'' is the base value of the wave (base value, the minimum if amplitude > 0, the maximum if amplitude < 0), ''frequency'' is the number of wave iterations per second (speed), ''phase'' is the offset of the wave start, and ''amplitude'' is the size of the wave. | #Transform - sets an advanced transformation method on the texture. This can be used with other texture modifiers, and also can be used multiple times to create multiple transformations.<br>Syntax: <code>Transform name, type, wave_type, base, frequency, phase, amplitude</code><br>Example: <code>Transform Brick1, rotate, sine, 0.2, 0.2, 0.1, 1.0</code><br>This command applies an advanced transformation method on the texture. Type is the animation type modified, and can either be ''scroll_x'', ''scroll_y'', ''rotate'', ''scale_x'', or ''scale_y''. ''Wave_type'' defines the type of waveform applied to the transformation, which creates a variable speed of the animation. The values are ''sine'' (a typical sine wave which smoothly loops between min and max values), ''triangle'' (an angled wave which increases & decreases at constant speed, changing instantly at the extremes), ''square'' (max for half the wavelength, min for the rest with instant transition between), ''sawtooth'' (gradual steady increase from min to max over the period with an instant return to min at the end), ''inverse_sawtooth'' (gradual steady decrease from max to min over the period, with an instant return to max at the end), or ''pwm'' (Pulse Width Modulation; like square, except the high to low transition is controlled by duty cycle). ''Base'' is the base value of the wave (base value, the minimum if amplitude > 0, the maximum if amplitude < 0), ''frequency'' is the number of wave iterations per second (speed), ''phase'' is the offset of the wave start, and ''amplitude'' is the size of the wave. | ||
#SetCulling - sets the culling value for a specified texture. This determines which sides of the object the texture should be displayed.<br>Syntax: <code>SetCulling name, value</code><br>Example: <code>SetCulling Brick1, 0</code><br>Values are 0 for no culling (show both sides), 1 to cull anticlockwise (SBS default), or 2 to cull clockwise (Ogre default, used for models).<br>In the example, the Brick1 texture is now showing both sides of the texture. | |||
== The Floor Sections == | == The Floor Sections == | ||
Line 461: | Line 498: | ||
#AddActionControl - creates a custom control that uses a specific action defined by AddAction.<br>Syntax: <code>AddActionControl ''name, sound, direction, centerx, centerz, width, height, voffset, selection_position, action_name(s), texture_name(s)''</code><br>Example: <code>AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit</code><br>AddActionControl command creates an advanced control similar to elevator button panel controls, but assigned to an action created with the AddAction command. The ''action_name(s)'' and ''texture_name(s)'' parameters allow you to specify a list of actions, and a list of textures to go along with those actions. There needs to be a texture for every action; if you specify 3 actions and only 2 textures, you will get an error. The control starts up in the first action, and switches to the next actions in sequence when it's clicked. ''Direction'' is the direction the control itself will face in 3D space (front, left, right, back). ''Voffset'' is relative of the elevator car's base. Leave the sound field blank for no sound to be played. ''Selection_position'' is the starting selection position, which is normally 1. | #AddActionControl - creates a custom control that uses a specific action defined by AddAction.<br>Syntax: <code>AddActionControl ''name, sound, direction, centerx, centerz, width, height, voffset, selection_position, action_name(s), texture_name(s)''</code><br>Example: <code>AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit</code><br>AddActionControl command creates an advanced control similar to elevator button panel controls, but assigned to an action created with the AddAction command. The ''action_name(s)'' and ''texture_name(s)'' parameters allow you to specify a list of actions, and a list of textures to go along with those actions. There needs to be a texture for every action; if you specify 3 actions and only 2 textures, you will get an error. The control starts up in the first action, and switches to the next actions in sequence when it's clicked. ''Direction'' is the direction the control itself will face in 3D space (front, left, right, back). ''Voffset'' is relative of the elevator car's base. Leave the sound field blank for no sound to be played. ''Selection_position'' is the starting selection position, which is normally 1. | ||
#AddTrigger - creates a trigger that is used to signal an action when the user's camera enters or leaves the defined area.<br>Syntax: <code>AddTrigger ''name, sound, start_x, start_y, start_z, end_x, end_y, end_z, action_names(s)''</code><br>Example: <code>AddTrigger MyTrigger, switch.wav, -30, 0, -30, -20, 10, -20, UndoMyAction, MyAction</code><br>AddTrigger creates a trigger similar to action controls (AddActionControl) and elevator controls. The ''action_names(s)'' parameter allows you to specify a list of actions that this trigger will call when the camera enters or exits the area. The trigger starts in the first action, and will switch to each consecutive action when the users enters/leaves. The ''X'', ''Y'' and ''Z'' parameters specify the 3D box that defines the trigger area, and are relative of the elevator car's location. Leave the ''sound'' field blank for no sound to be played. | #AddTrigger - creates a trigger that is used to signal an action when the user's camera enters or leaves the defined area.<br>Syntax: <code>AddTrigger ''name, sound, start_x, start_y, start_z, end_x, end_y, end_z, action_names(s)''</code><br>Example: <code>AddTrigger MyTrigger, switch.wav, -30, 0, -30, -20, 10, -20, UndoMyAction, MyAction</code><br>AddTrigger creates a trigger similar to action controls (AddActionControl) and elevator controls. The ''action_names(s)'' parameter allows you to specify a list of actions that this trigger will call when the camera enters or exits the area. The trigger starts in the first action, and will switch to each consecutive action when the users enters/leaves. The ''X'', ''Y'' and ''Z'' parameters specify the 3D box that defines the trigger area, and are relative of the elevator car's location. Leave the ''sound'' field blank for no sound to be played. | ||
#AddKeypadIndicator - creates a keypad indicator for this car.<br>Syntax: <code>AddKeypadIndicator ''sound, texture_prefix, blank_texture, direction, CenterX, CenterZ, width, height, voffset, timer_duration''</code><br>Example: <code>AddKeypadIndicator mechchime9.wav, Button, Black, right, 0, 0, 0.5, 0.5, 1, 5</code><br>The ''AddKeypadIndicator'' command creates a keypad indicator for the associated car. ''Sound'' is the sound played when displaying that a call has been requested and the different errors relating to the keypad, and if an asterisk is specified, the asterisk is replaced with the message shown on the screen, so "Sound*.wav" would change to "SoundRequested.wav". ''Texture_prefix'' specifies the base name of the texture used, so if "Button" is specified, the texture "ButtonRequested" would load when a call is requested. ''Blank_texture'' is the texture to use when off. ''CenterX'' and ''CenterZ'' are the center locations of the indicator. ''Timer_duration'' specifies how long the indicator message should be displayed, in seconds. The error text used is both "??" and "XX", so make sure to load textures for those (such as "Button??"). The "??" value is displayed when a floor entry is invalid, and the "XX" entry means "error". For error sounds, since the "??" characters sometimes can't be used in filenames, the simulator will expand it to "Invalid", and "XX" to "Error", so as an example the sounds will be "SoundInvalid.wav" and "SoundError.wav", if "Sound*.wav" is used for the sound parameter. | |||
#AddElevatorIDSigns - creates elevator ID signs on all floors serviced by the elevator car<br>Syntax: <code>''AddElevatorIDSigns door_number, relative, texture_prefix, direction, CenterX, CenterZ, width, height, voffset''</code><br>The AddElevatorIDSigns command creates elevator ID signs on all the floors serviced by the current elevator car. ''Direction'' is the direction the signs face, and can be either "left", "right", "front" or "back". ''Texture_prefix'' is the base name of the texture to load when displaying an elevator ID; for example if the sign is for an elevator with an ID of A, and you specify a prefix of "Button", it'll load the "ButtonA" texture. ''Door_number'' specifies the door number to check against, meaning if shaft doors don't exist on a certain floor for the specified door, the sign won't be created on that floor. This can be bypassed by setting ''door_number'' to 0. | |||
== The Controller Section == | == The Controller Section == | ||
Line 544: | Line 583: | ||
#AddShaft - creates a shaft at a specified location and floor range<br>Syntax: <code>AddShaft ''number, centerx, centerz, startfloor, endfloor''</code><br>Example: <code>AddShaft 1, 10, 10, 0, 9</code><br>The ''number'' parameter specifies the shaft number to create. 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). | #AddShaft - creates a shaft at a specified location and floor range<br>Syntax: <code>AddShaft ''number, centerx, centerz, startfloor, endfloor''</code><br>Example: <code>AddShaft 1, 10, 10, 0, 9</code><br>The ''number'' parameter specifies the shaft number to create. 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). | ||
#CreateStairwell - creates a stairwell at a specified location and floor range<br>Syntax: <code>CreateStairwell ''number, centerx, centerz, startfloor, endfloor''</code><br>Example: <code>CreateStairwell 1, 10, 10, 0, 9</code><br>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. | #CreateStairwell - creates a stairwell at a specified location and floor range<br>Syntax: <code>CreateStairwell ''number, centerx, centerz, startfloor, endfloor''</code><br>Example: <code>CreateStairwell 1, 10, 10, 0, 9</code><br>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. | ||
#WallOrientation - changes the internal wall orientation parameter, which is used for determining the wall thickness boundaries in relation to their coordinates.<br>Syntax: <code>WallOrientation = ''direction''</code><br>Example: <code>WallOrientation = left</code><br>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. | #WallOrientation - changes the internal wall orientation parameter, which is used for determining the wall thickness boundaries in relation to their coordinates.<br>Syntax: <code>WallOrientation = ''direction''</code><br>Example: <code>WallOrientation = left</code><br>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: [[File:Wall info.jpg]]<br>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. | ||
#FloorOrientation - changes the internal floor orientation parameter, which is used for determining the floor thickness boundaries in relation to their coordinates.<br>Syntax: <code>FloorOrientation = ''direction''</code><br>Example: <code>FloorOrientation = bottom</code><br>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). | #FloorOrientation - changes the internal floor orientation parameter, which is used for determining the floor thickness boundaries in relation to their coordinates.<br>Syntax: <code>FloorOrientation = ''direction''</code><br>Example: <code>FloorOrientation = bottom</code><br>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). | ||
#DrawWalls - specifies which parts of a wall or floor should be drawn.<br>Syntax: <code>DrawWalls = ''MainNegative, MainPositive, SideNegative, SidePositive, Top, Bottom''</code><br>Example: <code>DrawWalls = true, true, false, false, false, false</code><br>The example shown is the default setting. ''MainNegative'' is the main (that makes up the front of a wall lengthwise, or the top area of a floor) face on the negative side, ''MainPositive'' is the main face on the positive side (back of a wall, or the bottom area of a floor), ''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 front face if a floor; ''Bottom'' refers to either the bottom side if a wall, or the back face if a floor. | #DrawWalls - specifies which parts of a wall or floor should be drawn.<br>Syntax: <code>DrawWalls = ''MainNegative, MainPositive, SideNegative, SidePositive, Top, Bottom''</code><br>Example: <code>DrawWalls = true, true, false, false, false, false</code><br>The example shown is the default setting. ''MainNegative'' is the main (that makes up the front of a wall lengthwise, or the top area of a floor) face on the negative side, ''MainPositive'' is the main face on the positive side (back of a wall, or the bottom area of a floor), ''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 front face if a floor; ''Bottom'' refers to either the bottom side if a wall, or the back face if a floor. The following graphic explains the sides in detail:<br>[[File:Sides.jpg]] | ||
#SetPlanarMapping - sets the planar texture mapper's parameters.<br>Syntax: <code>SetPlanarMapping ''Flat, FlipX, FlipY, FlipZ, Rotate''</code><br>Example: <code>SetPlanarMapping false, false, false, true, false</code><br>''FlipX, FlipY'' and ''FlipZ'' reverse the texture mapping per axis, and ''Flat'' has it ignore depth., Skyscraper by default uses a simple planar texture mapper, which in simple terms draws the texture in a box around the object. With a basic wall, the top-left of the texture image is mapped to the top left of the wall, the top-right is mapped to the top-right of the wall, etc. If you want the top-right of the texture mapped to the top-left of the wall for example (to flip or change alignment), you'd set ''FlipX'' to false. This command is mainly used to change alignment - since the top-left of the texture is mapped to the top-left of the object, that means that textures have a left/top alignment by default. If you change ''FlipX'' to true, it'll be right-aligned. If you change ''FlipY'' to true, it'll be bottom-aligned. ''Rotate'' has it rotate the texture mapping 90 degrees counterclockwise, so instead of the texture being mapped from the top left to bottom right, if ''Rotate'' is true, it'll be mapped from the bottom left to top right. | #SetPlanarMapping - sets the planar texture mapper's parameters.<br>Syntax: <code>SetPlanarMapping ''Flat, FlipX, FlipY, FlipZ, Rotate''</code><br>Example: <code>SetPlanarMapping false, false, false, true, false</code><br>''FlipX, FlipY'' and ''FlipZ'' reverse the texture mapping per axis, and ''Flat'' has it ignore depth., Skyscraper by default uses a simple planar texture mapper, which in simple terms draws the texture in a box around the object. With a basic wall, the top-left of the texture image is mapped to the top left of the wall, the top-right is mapped to the top-right of the wall, etc. If you want the top-right of the texture mapped to the top-left of the wall for example (to flip or change alignment), you'd set ''FlipX'' to false. This command is mainly used to change alignment - since the top-left of the texture is mapped to the top-left of the object, that means that textures have a left/top alignment by default. If you change ''FlipX'' to true, it'll be right-aligned. If you change ''FlipY'' to true, it'll be bottom-aligned. ''Rotate'' has it rotate the texture mapping 90 degrees counterclockwise, so instead of the texture being mapped from the top left to bottom right, if ''Rotate'' is true, it'll be mapped from the bottom left to top right. See this picture for an example:<br>[[File:Extents.jpg]]<br>In the above picture, I tiled a texture (a black box with yellow around it) 2.5 times on width and height. The bottom floor shows the default texture mapping (SetPlanarMapping false, false, false, false, false); you'll notice that it's aligned to the top-left. In the middle one, I set the ''FlipX'' value to true (SetPlanarMapping false, true, false, false, false). In the top one, I set the ''FlipY'' value to true (SetPlanarMapping false, false, true, false, false). | ||
#SetTextureMapping - manually sets UV texture mapping for all polygons generated after this command; ResetTextureMapping restores the values to the defaults or previous<br>Syntax: <code>SetTextureMapping ''vertex1, u1, v1, vertex2, u2, v2, vertex3, u3, v3</code><br>''Example: <code>SetTextureMapping 0, 0, 0, 1, 1, 0, 2, 1, 1</code><br>The example shown above is the default value used by the simulator. This command maps the texture coordinates to the specified 3 vertex indices - normally a side of a wall will have 4 vertices/sets of coordinates (0 to 3), and by default the first three are used (top left, top right and bottom right respectively), with the UV coordinates representing the size percentage of the texture (with 1 being 100%, 0.5 being 50%, etc; normally this would relate to absolute texture coordinates) - so in the example, texture coordinate 0,0 (top left) is mapped at the first vertex (top left); texture coordinate 1,0 (really "width, 0") being mapped at the second vertex (top right), and texture coordinate 1,1 (really "width, height") being mapped to the bottom right. For a standard wall, the valid vertex values are from 0 to 3. If a wall or floor is created with AddCustomWall, and if it has for example 7 vertex points, the valid values for this command would then be 0 to 6 (but only 3 vertices can be used for mapping purposes). One caveat with manual texture mapping is that sometimes the simulator will automatically reverse the vertices to keep the wall faces oriented properly, so if you set your texture mapping this way and notice issues, try reversing the coordinates (u3 would be u1 for a 3-point triangular wall, etc) and see if that helps. Textures can also be cropped with this command - for example, to map only a central square of a texture, you'd use:<br><code>SetTextureMapping 0, 0.25, 0.25, 1, 0.75, 0.25, 2, 0.75, 0.75</code><br>Here's an easier way to see the example above:<br><code>0 -> 0, 0<br>1 -> 1, 0<br>2 -> 1, 1<br></code> | #SetTextureMapping - manually sets UV texture mapping for all polygons generated after this command; ResetTextureMapping restores the values to the defaults or previous<br>Syntax: <code>SetTextureMapping ''vertex1, u1, v1, vertex2, u2, v2, vertex3, u3, v3</code><br>''Example: <code>SetTextureMapping 0, 0, 0, 1, 1, 0, 2, 1, 1</code><br>The example shown above is the default value used by the simulator. This command maps the texture coordinates to the specified 3 vertex indices - normally a side of a wall will have 4 vertices/sets of coordinates (0 to 3), and by default the first three are used (top left, top right and bottom right respectively), with the UV coordinates representing the size percentage of the texture (with 1 being 100%, 0.5 being 50%, etc; normally this would relate to absolute texture coordinates) - so in the example, texture coordinate 0,0 (top left) is mapped at the first vertex (top left); texture coordinate 1,0 (really "width, 0") being mapped at the second vertex (top right), and texture coordinate 1,1 (really "width, height") being mapped to the bottom right. For a standard wall, the valid vertex values are from 0 to 3. If a wall or floor is created with AddCustomWall, and if it has for example 7 vertex points, the valid values for this command would then be 0 to 6 (but only 3 vertices can be used for mapping purposes). One caveat with manual texture mapping is that sometimes the simulator will automatically reverse the vertices to keep the wall faces oriented properly, so if you set your texture mapping this way and notice issues, try reversing the coordinates (u3 would be u1 for a 3-point triangular wall, etc) and see if that helps. Textures can also be cropped with this command - for example, to map only a central square of a texture, you'd use:<br><code>SetTextureMapping 0, 0.25, 0.25, 1, 0.75, 0.25, 2, 0.75, 0.75</code><br>Here's an easier way to see the example above:<br><code>0 -> 0, 0<br>1 -> 1, 0<br>2 -> 1, 1<br></code>The following diagram shows the mapping described above. Texture location 0,0 is mapped to wall vertex 0, location 1,0 is mapped to vertex 1, etc:<br>[[File:Texture mapping.jpg]] | ||
#SetTextureMapping2 - advanced version of SetTextureMapping - manually sets UV texture mapping for all polygons generated after this command; ResetTextureMapping restores the values to the defaults or previous<br>Syntax: <code>SetTextureMapping2 ''v1x, v1y, v1z, u1, v1, v2x, v2y, v2z, u2, v2, v3x, v3y, v3z, u3, v3''</code><br>Example: <code>SetTextureMapping2 x0, y0, z0, 0, 0, x1, y1, z1, 1, 0, x2, y2, z2, 1, 1</code><br>See the above description of SetTextureMapping for a detailed description on texture mapping in general. This command mostly does the same as that command, and the example given is the default command (and is equivalent to the SetTextureMapping example). Instead of just choosing which vertex indices to use like SetTextureMapping, this command lets you create your own texture vertices (sets of coordinates) using coordinates of already-existing vertices. The vertex values that can be used start with an "x", "y" or "z", followed by the vertex index. In the example, the X, Y and Z values of the first vertex are mapped to UV coordinate 0,0 - this is because "x0, y0, z0" was specified. A specification of "x0, y2, z0" will use the X and Z values from vertex 0, but the Y value from vertex 2. This way you can specify coordinates outside of the wall/polygon's range. Here's an easier way to see the example:<br><code>x0, y0, z0 -> 0, 0<br>x1, y1, z1 -> 1, 0<br>x2, y2, z2 -> 1, 1</code> | #SetTextureMapping2 - advanced version of SetTextureMapping - manually sets UV texture mapping for all polygons generated after this command; ResetTextureMapping restores the values to the defaults or previous<br>Syntax: <code>SetTextureMapping2 ''v1x, v1y, v1z, u1, v1, v2x, v2y, v2z, u2, v2, v3x, v3y, v3z, u3, v3''</code><br>Example: <code>SetTextureMapping2 x0, y0, z0, 0, 0, x1, y1, z1, 1, 0, x2, y2, z2, 1, 1</code><br>See the above description of SetTextureMapping for a detailed description on texture mapping in general. This command mostly does the same as that command, and the example given is the default command (and is equivalent to the SetTextureMapping example). Instead of just choosing which vertex indices to use like SetTextureMapping, this command lets you create your own texture vertices (sets of coordinates) using coordinates of already-existing vertices. The vertex values that can be used start with an "x", "y" or "z", followed by the vertex index. In the example, the X, Y and Z values of the first vertex are mapped to UV coordinate 0,0 - this is because "x0, y0, z0" was specified. A specification of "x0, y2, z0" will use the X and Z values from vertex 0, but the Y value from vertex 2. This way you can specify coordinates outside of the wall/polygon's range. Here's an easier way to see the example:<br><code>x0, y0, z0 -> 0, 0<br>x1, y1, z1 -> 1, 0<br>x2, y2, z2 -> 1, 1</code> | ||
#ResetTextureMapping - resets the texture mapping parameters to either the default or previous values<br>Syntax: <code>ResetTextureMapping = ''default''</code><br>Example: <code>ResetTextureMapping = true</code><br>If ''default'' is true, the texture mapping values are reset to the default, which is shown above in the SetTextureMapping's example. If ''default'' is false, the previous values will be loaded and used. | #ResetTextureMapping - resets the texture mapping parameters to either the default or previous values<br>Syntax: <code>ResetTextureMapping = ''default''</code><br>Example: <code>ResetTextureMapping = true</code><br>If ''default'' is true, the texture mapping values are reset to the default, which is shown above in the SetTextureMapping's example. If ''default'' is false, the previous values will be loaded and used. | ||
Line 592: | Line 631: | ||
== Extended Commands/Functions == | == Extended Commands/Functions == | ||
Extended commands are global commands that use a newer method of specifying objects to use. | Extended commands are global commands that use a newer method of specifying objects to use. The previous Global Commands have an older method of specifying Mesh objects, these newer commands allow you to specify raw SBS objects. Some commands are broken out, so that you can specify parameters for an object with separate commands for each type of parameter. This also introduces Levels, which are the floors used in Shafts and Stairwells.<br> | ||
In this section, ''Parent'' refers to the destination SBS object to use as the object's parent, such as if you create a Light object named "Light1" within Floor 3, the Floor 3 object would be the parent, and the full SBS name would be "Floor 3:Light1".<br> | In this section, ''Parent'' refers to the destination SBS object to use as the object's parent, such as if you create a Light object named "Light1" within Floor 3, the Floor 3 object would be the parent, and the full SBS name would be "Floor 3:Light1".<br> | ||
Current examples:<br> | Current examples:<br> | ||
Line 601: | Line 640: | ||
''Stairwell 5:Level 6''<br> | ''Stairwell 5:Level 6''<br> | ||
''DoorManager'' (used for creating global/external Doors) | ''DoorManager'' (used for creating global/external Doors) | ||
#AddLight - adds a light, the parameters of the light can be changed later. | #AddLight - adds a light, the parameters of the light can be changed later. Note that lights only work if Lighting is enabled in the INI file.<br>Syntax: <code>AddLight ''parent, name, type''</code><br>Example: <code>AddLight Floor 0, My Light, 0</code><br>The example will create "My Light" on floor 0. Type is 0 for a point light, 1 for a directional light, and 2 for a spotlight. The related Action commands that lights use are ''On'' and ''Off'', these can be used to create a lightswitch for example. | ||
#SetLightColor - sets the color of a light. | #SetLightColor - sets the color of a light. The default is white.<br>Syntax: <code>SetLightColor parent, name, ''ColorR, ColorG, ColorB''</code><br>Example: <code>SetLightColor Floor 0, My Light, 0.5, 0, 1</code><br>The example will set the color of "My Light" to a shade of purple. | ||
#SetLightSpecular - sets the specular color of a light. | #SetLightSpecular - sets the specular color of a light. The default is black.<br>Syntax: <code>SetLightSpecular ''parent, name, ColorR, ColorG, ColorB''</code><br>Example: <code>SetLightSpecular Floor 0, My Light, 1, 1, 1</code><br>The example will set the specular color of My Light to white. | ||
#SetLightAttenuation - sets the attenuation of the specified light. | #SetLightAttenuation - sets the attenuation of the specified light. This has no effect on directional lights.<br>Syntax: <code>SetLightAttenuation ''parent, name, range, constant, linear, quadratic''</code><br>Example: <code>SetLightAttenuation Floor 0, My Light, 100000, 1, 0, 0</code><br>The example shows the default for this. ''Range'' is the upper range of the light in world units. A ''constant'' of 1 means never attenuate, 0 means always attenuate. A ''linear'' of 1 means evenly attenuate over the distance. ''Quadratic'' adds a curvature to the attenuation formula. | ||
#SetSpotlightRange - sets the range of a spotlight. | #SetSpotlightRange - sets the range of a spotlight. This is only applicable to spotlights (type 2).<br>Syntax: <code>SetSpotlightRange ''parent, name, inner_angle, outer_angle, falloff''</code><br>Example: <code>SetSpotlightRange Floor 0, My Light, 30, 40, 1</code><br>The example shows the defaults. ''Inner_angle'' is the angle covered by the bright inner cone. ''Outer_angle'' is the angle covered by the outer cone. ''Falloff'' is the rate of falloff between the inner and outer cones, 1 means linear, less means slower, higher means faster. | ||
#SetLightDirection - sets the direction of a light, not applicable to point lights.<br>Syntax: <code>SetLightDirection ''parent, name, X, Y, Z''</code><br>Example: <code>SetLightDirection Floor 0, My Light, 10, 50, 20</code> | #SetLightDirection - sets the direction of a light, not applicable to point lights.<br>Syntax: <code>SetLightDirection ''parent, name, X, Y, Z''</code><br>Example: <code>SetLightDirection Floor 0, My Light, 10, 50, 20</code> | ||
#MoveLight - moves a light.<br>Syntax: <code>MoveLight ''parent, name, X, Y, Z''</code><br>Example: <code>MoveLight Floor 0, My Light, 0, 10, 0</code><br>The example will move "My Light" up 10 feet. | #MoveLight - moves a light.<br>Syntax: <code>MoveLight ''parent, name, X, Y, Z''</code><br>Example: <code>MoveLight Floor 0, My Light, 0, 10, 0</code><br>The example will move "My Light" up 10 feet. | ||
#AddCameraTexture - creates a CameraTexture in the specified object. | #AddCameraTexture - creates a CameraTexture in the specified object. CameraTextures are turned off by default, but can be turned on with Actions, used in conjunction with a trigger object. See the demo building "[[Simple - CameraTexture]]".<br>Syntax: <code>AddCameraTexture ''parent, name, quality, fov, position_x, position_y, position_z, use_rotation, rotation_x, rotation_y, rotation_z''</code><br>Example: <code>AddCameraTexture Floor 0, Camera1, 1, 71, 10, 10, 0, true, 0, 90, 0</code><br>The example will create Camera1 on Floor 0, with a default FOV. Quality can either be 1, 2, or 3, and determines the resolution of the image. If ''use_rotation'' is false, the specified rotation will be a LookAt position. A light will also move with it's parent object, such as if you put a light in an elevator, it'll move as the elevator goes up.<br>The related Action commands that CameraTextures use are ''Enable'' and ''Disable'', see the Triton Center building for an example of why this is needed, the framerate drops when the cameratexture is active, so it is only enabled in a small range near the TV screen.<br>''Name'' will create a texture with that name, there can only be one texture with that name in the simulator instance, so make it unique. Once the CameraTexture is created, use another command such as AddWall to create a TV screen, and use the CameraTexture's name as the wall's texture. When the CameraTexture is enabled, you'll see a live video feed on your wall. | ||
#AddSlidingDoor - creates a sliding door object, which is a door with the rotation setting turned off.<br>Syntax: <code>AddSlidingDoor parent, name, open_sound, close_sound, open_state, texture, side_texture, thickness, face_direction, open_direction, open_speed, close_speed, CenterX, CenterZ, width, height, voffset, tw, th, side_tw, side_th</code><br>Example: <code>AddSlidingDoor Floor 0, MyDoor, open.wav, close.wav, false, Door, Brick, 0.2, left, right, 10, 5, 5, 3.5, 8, 0, 1, 1</code><br>The example will create a sliding door on Floor 0. | #AddSlidingDoor - creates a sliding door object, which is a door with the rotation setting turned off.<br>Syntax: <code>AddSlidingDoor parent, name, open_sound, close_sound, open_state, texture, side_texture, thickness, face_direction, open_direction, open_speed, close_speed, CenterX, CenterZ, width, height, voffset, tw, th, side_tw, side_th</code><br>Example: <code>AddSlidingDoor Floor 0, MyDoor, open.wav, close.wav, false, Door, Brick, 0.2, left, right, 10, 5, 5, 3.5, 8, 0, 1, 1</code><br>The example will create a sliding door on Floor 0. Open_state determines if the door is open on startup. Side_texture defines the texture used on the sides of the door. Face_direction is the direction the door faces, such as "left", "right", "front" or "back". Open_direction is either "up", "down", "left"/"front" or "right"/"back". | ||
#AddStdDoor - creates a standard door object, which is a door with the rotation setting turned on. | #AddStdDoor - creates a standard door object, which is a door with the rotation setting turned on. This command replaces the older ''AddDoor'' and related commands.<br>Syntax: <code>AddStdDoor parent, name, open_sound, close_sound, open_state, texture, side_texture, thickness, face_direction, open_direction, open_speed, close_speed, CenterX, CenterZ, width, height, voffset, tw, th, side_tw, side_th</code><br>Example: <code>AddStdDoor Floor 0, MyDoor, open.wav, close.wav, false, Door, Brick, 0.2, left, right, 10, 10, 5, 5, 3.5, 8, 0, 1, 1, 1, 1</code><br>The example will create a standard door on Floor 0. Open_state determines if the door is open on startup. Side_texture defines the texture used on the sides of the door. Face_direction is the direction the door faces, such as "left", "right", "front" or "back". Open_direction is either "left", "right", "front" or "back". | ||
#CreateCustomDoor - starts a manually-created (custom) door. | #CreateCustomDoor - starts a manually-created (custom) door. The commands CustomDoorComponent and FinishDoor need to be used after this command.<br>Syntax: <code>CreateCustomDoor parent, name, open_sound, close_sound, rotate</code><br>Example: <code>CreateCustomDoor Floor 0, My Custom Door, open.wav, close.wav, false</code><br>The example will create a sliding door "My Custom Door" on floor 0. | ||
#CustomDoorComponent - creates a door component in the specified custom door.<br>Syntax: <code>''CustomDoorComponent parent, name, component_name, texture, side_texture, thickness, face_direction, open_direction, OpenClockwise, OpenSpeed, CloseSpeed, x1, z1, x2, z2, height, voffset, tw, th, side_tw, side_th''</code><br>Example: <code>CustomDoorComponent Floor 0, My Custom Door, RightDoor, StairsDoor, Brick, 0.2, front, front, false, 10, 10, -5, -5, 0, -5, 8, 0, 0, 0, 0, 0</code><br>The example will create a custom door component on floor 0's door "My Custom Door" named "RightDoor". | #CustomDoorComponent - creates a door component in the specified custom door.<br>Syntax: <code>''CustomDoorComponent parent, name, component_name, texture, side_texture, thickness, face_direction, open_direction, OpenClockwise, OpenSpeed, CloseSpeed, x1, z1, x2, z2, height, voffset, tw, th, side_tw, side_th''</code><br>Example: <code>CustomDoorComponent Floor 0, My Custom Door, RightDoor, StairsDoor, Brick, 0.2, front, front, false, 10, 10, -5, -5, 0, -5, 8, 0, 0, 0, 0, 0</code><br>The example will create a custom door component on floor 0's door "My Custom Door" named "RightDoor". Face_direction can either be "left", "right", "front" or "back", open_direction can be "up", "down", "left"/"front", or "right"/"back". OpenClockwise is used when door rotation is on, it determines if the door opens clockwise or not. | ||
#FinishDoor - finishes a manually-created (custom) door.<br>Syntax: <code>FinishDoor ''parent, name, open_state''</code><br>Example: <code>FinishDoor Floor 0, My Custom Door, true</code><br>The example will finish the custom door, and open it on startup. | #FinishDoor - finishes a manually-created (custom) door.<br>Syntax: <code>FinishDoor ''parent, name, open_state''</code><br>Example: <code>FinishDoor Floor 0, My Custom Door, true</code><br>The example will finish the custom door, and open it on startup. | ||
#MoveDoor - changes a door's position<br>Syntax: <code>MoveDoor ''parent, name, X, Y, Z''</code><br>Example: <code>MoveDoor Floor 0, My Custom Door, -5, 0, 0</code> | #MoveDoor - changes a door's position<br>Syntax: <code>MoveDoor ''parent, name, X, Y, Z''</code><br>Example: <code>MoveDoor Floor 0, My Custom Door, -5, 0, 0</code> | ||
#SetAutoClose - enables or disables the autoclose timer on a door<br>Syntax: <code>SetAutoClose ''parent, name, interval''</code><br>Example: <code>SetAutoClose Floor 0, My Custom Door, 5</code><br>The example will automatically close "My Custom Door" after being open for 5 seconds. | #SetAutoClose - enables or disables the autoclose timer on a door<br>Syntax: <code>SetAutoClose ''parent, name, interval''</code><br>Example: <code>SetAutoClose Floor 0, My Custom Door, 5</code><br>The example will automatically close "My Custom Door" after being open for 5 seconds. Set interval to 0 to turn off the timer. | ||
#CreatePrim - creates a new primitive object and shape<br>Syntax: <code>CreatePrim parent, name, type, [shape parameters...]</code><br>Example: <code>CreatePrim Floor 0, MyPrim, Sphere, 2.0, 5.0, 5.0, 16, 16</code><br>The ''Type'' parameter determines the type of shape to create, with the shape parameters following it:<br>-Plane, <code>SizeX, SizeY, SegmentsX, SegmentsY, UTile, VTile</code><br>-Sphere, <code>Radius, UTile, VTile, Rings, Segments</code><br>-Cylinder, <code>Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight, Capped</code><br>-Torus, <code>Radius, SectionRadius, UTile, VTile</code><br>-Cone, <code>Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight</code><br>-Tube, <code>InnerRadius, OuterRadius, Height, UTile, VTile, SegmentsBase, SegmentsHeight</code><br>-Box, <code>SizeX, SizeY, SizeZ, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ</code><br>-Capsule, <code>Radius, Height, Rings, UTile, VTile, Segments, SegmentsHeight, Capped</code><br>-TorusKnot, <code>Radius, SectionRadius, UTile, VTile, SegmentsCircle, SegmentsSection, P, Q</code><br>-IcoSphere, <code>Radius, UTile, VTile, Iterations</code><br>-RoundedBox, <code>SizeX, SizeY, SizeZ, ChamferSize, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ, Capped</code><br>-Spring, <code>RadiusCircle, RadiusHelix, Height, Round, UTile, VTile, SegmentsCircle, SegmentsPath, Capped</code><br>-Prism, <code>Radius, Height, Sides, SegmentsHeight, Capped</code><br>The command creates a new prim on the specified parent object, making it available for use by future commands.<br>The example creates a primitive named "MyPrim" on floor 0. | |||
#PrimShape - creates a new shape for the specified primitive<br>Syntax: <code>PrimShape parent, name, type, [shape parameters...]</code><br>Example: <code>PrimShape Floor 0, MyPrim, Sphere, 2.0, 5.0, 5.0, 16, 16</code><br>The ''Type'' parameter determines the type of shape to create, with the shape parameters following it:<br>-Plane, <code>SizeX, SizeY, SegmentsX, SegmentsY, UTile, VTile</code><br>-Sphere, <code>Radius, UTile, VTile, Rings, Segments</code><br>-Cylinder, <code>Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight</code><br>-Torus, <code>Radius, SectionRadius, UTile, VTile</code><br>-Cone, <code>Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight</code><br>-Tube, <code>InnerRadius, OuterRadius, Height, UTile, VTile, SegmentsBase, SegmentsHeight</code><br>-Box, <code>SizeX, SizeY, SizeZ, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ</code><br>-Capsule, <code>Radius, Height, Rings, UTile, VTile, Segments, SegmentsHeight, Capped</code><br>-TorusKnot, <code>Radius, SectionRadius, UTile, VTile, SegmentsCircle, SegmentsSection, P, Q</code><br>-IcoSphere, <code>Radius, UTile, VTile, Iterations</code><br>-RoundedBox, <code>SizeX, SizeY, SizeZ, ChamferSize, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ, Capped</code><br>-Spring, <code>RadiusCircle, RadiusHelix, Height, Round, UTile, VTile, SegmentsCircle, SegmentsPath, Capped</code><br>-Prism, <code>Radius, Height, Sides, SegmentsHeight, Capped</code><br>The example creates a sphere shape on the prim "MyPrim", on floor 0. | |||
#PrimAttach - attaches the specified primitive to the parent object<br>Syntax: <code>PrimAttach parent, name, X, Y, Z, rotation_x, rotation_y, rotation_z</code><br>Example: <code>PrimAttach Floor 0, MyPrim, 0, 5, 0, 0, 0, 0</code><br>The example places the prim at the center of floor 0, at a height of 5 feet. | |||
#PrimTexture - assigns a texture to a primitive<br>Syntax: <code>PrimTexture parent, name, texture</code><br>Example: <code>PrimTexture Floor 0, MyPrim, Default</code><br>The example assigns the system texture "Default" to the prim MyPrim. | |||
#PrimVisible - determines if a primitive should always be visible or not.<br>Syntax: <code>PrimVisible parent, name, value</code><br>Example: <code>PrimVisible Floor 0, MyPrim, true</code><br>The example makes the prim "MyPrim" always visible. | |||
#CreateObject - creates a custom object. The command ''FinishObject'' needs to be used after this command.<br>Syntax: <code>CreateObject ''parent, name, X, Y, Z, RotationX, RotationY, RotationZ, max_render_distance, scale_multiplier''</code><br>Example: <code>CreateObject Floor 0, My Custom Object, 0, 0, 0, 0, 0, 0, 100, 1</code><br>The example will create a custom object "My Custom Object" on floor 0, at the center of the building. | |||
#FinishObject - finishes a custom object. This needs to be run after the CreateObject command, and after working on the object such as adding walls.<br>Syntax: <code>FinishObject ''parent, name[, restitution, friction, mass]''</code><br>Example: <code>FinishObject Floor 0, My Custom Object</code><br>Example 2: <code>FinishObject Floor 0, My Custom Object, 1, 1, 1</code><br>The first example will finish the custom object "My Custom Object" on floor 0, and set it to non-physical. The second example is the same but enables physics on the object. | |||
#ObjectWall - adds a wall to the specified custom object. This needs to be run after the CreateObject command.<br>Syntax: <code>ObjectWall ''parent, name, texture, thickness, x1, z1, x2, z2, height1, height2, altitude1, altitude2, tw, th''</code><br>Example: ObjectWall <code>Floor 0, My Custom Object, Brick, 0, -10, 0, 10, 0, 10, 10, 0, 0, 1, 1</code><br>The example will create a wall on custom object "My Custom Object" on floor 0. | |||
#ObjectFloor - adds a floor to the specified custom object. This needs to be run after the CreateObject command.<br>Syntax: <code>ObjectFloor ''parent, name, texture, thickness, x1, z1, x2, z2, altitude1, altitude2, reverse_axis, texture_direction, tw, th''</code><br>Example: <code>ObjectFloor Floor 0, My Custom Object, Brick, 0, -10, -10, 10, 10, 0, 0, false, false, 1, 1</code><br>The example will create a floor on custom object "My Custom Object" on floor 0. | |||
#ObjectWallBox - adds a wall box to the specified custom object. This needs to be run after the CreateObject command.<br>Syntax: <code>ObjectWallBox ''parent, name, texture, x1, x2, z1, z2, height, voffset, tw, th, inside, outside, top, bottom, autosize''</code><br>Example: <code>ObjectWallBox Floor 0, My Custom Object, Brick, -10, 10, -10, 10, 10, 0, 1, 1, true, true, true, true, true</code><br>The example will create a box on custom object "My Custom Object" on floor 0. | |||
#ObjectWallBox2 - adds a centered wall box to the specified custom object. This needs to be run after the CreateObject command.<br>Syntax: <code>ObjectWallBox ''parent, name, texture, CenterX, CenterZ, WidthX, WidthZ, height, voffset, tw, th, inside, outside, top, bottom, autosize''</code><br>Example: <code>ObjectWallBox Floor 0, My Custom Object, Brick, 0, 0, 10, 10, 10, 0, 1, 1, true, true, true, true, true</code><br>The example will create a centered box on custom object "My Custom Object" on floor 0. | |||
#ObjectVisible - determines if the object should always be visible or not.<br>Syntax: <code>ObjectVisible ''parent, name, value''</code><br>Example: <code>ObjectVisible Floor 0, My Custom Object, true</code> | |||
#EnablePhysics - an experimental feature that enables physics on SBS mesh objects<br>Syntax: <code>EnablePhysics parent, meshname, value, restitution, friction, mass</code><br>Example: <code>EnablePhysics Floor 0, Level 0, true, 0.1, 0.5, 0.1</code><br>The example turns physics on for Floor 0's mesh, which is a pretty crazy effect. | |||
#END command<br>The End command tells the software to stop processing the current script and start the simulation. This is optional.<br>Example: <code><end></code> | #END command<br>The End command tells the software to stop processing the current script and start the simulation. This is optional.<br>Example: <code><end></code> | ||
#BREAK command<br>The Break command triggers a break section in the script processor, and is used when running a debug build of the simulator, with a debugger attached. A breakpoint can be set on the associated line in fileio.cpp, and when this command is called, the debugger will hit the breakpoint.<br>Example: <code><break></code> | #BREAK command<br>The Break command triggers a break section in the script processor, and is used when running a debug build of the simulator, with a debugger attached. A breakpoint can be set on the associated line in fileio.cpp, and when this command is called, the debugger will hit the breakpoint.<br>Example: <code><break></code> | ||
Line 623: | Line 675: | ||
There are a number of script functions provided by the simulator. Currently there's only a single script for elevator doors - see the Simple building (noted at the bottom of this page) for an example. These functions can be used by putting this line in your script: | There are a number of script functions provided by the simulator. Currently there's only a single script for elevator doors - see the Simple building (noted at the bottom of this page) for an example. These functions can be used by putting this line in your script: | ||
<Include data/scripts/elevator_doors.txt> | <code><Include data/scripts/elevator_doors.txt></code> | ||
You'll then be able to use some predefined door functions: | You'll then be able to use some predefined door functions: | ||
#elevdoor_single - creates a single-slide elevator door.<br>Syntax: <code>elevdoor_single(''door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, movement_direction, speed, is_shaft_door'')</code><br>''Door_Direction'' is either "left", "right", "front" or "back" and is the direction the doors face (torwards the outside of the elevator). ''Movement_direction'' is the direction the door should move. | |||
Syntax: elevdoor_single(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, movement_direction, speed, is_shaft_door) | #elevdoor_center - creates a center-open elevator door.<br>Syntax: <code>elevdoor_center(''door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door'')</code><br> | ||
#elevdoor_center_classic - creates a center-open elevator door with a partially open interior door.<br>Syntax: <code>elevdoor_center_classic(''door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door'')</code><br> | |||
Door_Direction is either "left", "right", "front" or "back" and is the direction the doors face (torwards the outside of the elevator). Movement_direction is the direction the door should move. | #elevdoor_dualspeed_left - creates a dual-speed door that opens to the left<br>Syntax: <code>elevdoor_dualspeed_left(''door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door'')</code><br> | ||
#elevdoor_dualspeed_right - creates a dual-speed door that opens to the right<br>Syntax: <code>elevdoor_dualspeed_right(''door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door'')</code><br> | |||
#elevdoor_center_dualspeed - creates a dual-speed center-open door<br>Syntax: <code>elevdoor_center_dualspeed(''door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door'')</code> | |||
Syntax: elevdoor_center(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door) | |||
Syntax: elevdoor_center_classic(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door) | |||
Syntax: elevdoor_dualspeed_left(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door) | |||
Syntax: elevdoor_dualspeed_right(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door) | |||
Syntax: elevdoor_center_dualspeed(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door) | |||
== The Buildings Section == | == The Buildings Section == | ||
The Buildings section allows you to load additional buildings, into separate simulation engines, and have them all be visible and usable in the same scene. This section is small, and mainly exists to provide clarity in scripts. Additional buildings also have their own script interpreters, so their scripts (and things such as includes) are completely isolated from each other. Note that this section is skipped when reloading the building (Ctrl-R). This section should be placed at the beginning of the script file, so that the progress bar during load can be accurate. When the script is finished loading, the primary building (the one included in the main script) will be automatically cut for each child building (using the section's Cut parameters), making it easy to integrate new buildings into existing spaces with large landscapes, or even city blocks. Nesting of this section is also supported, so that if a child building also has a buildings section, it'll process it, and the parent building will be cut for each child building. | The ''Buildings'' section allows you to load additional buildings, into separate simulation engines, and have them all be visible and usable in the same scene. This section is small, and mainly exists to provide clarity in scripts. Additional buildings also have their own script interpreters, so their scripts (and things such as includes) are completely isolated from each other. Note that this section is skipped when reloading the building (Ctrl-R). This section should be placed at the beginning of the script file, so that the progress bar during load can be accurate. When the script is finished loading, the primary building (the one included in the main script) will be automatically cut for each child building (using the section's Cut parameters), making it easy to integrate new buildings into existing spaces with large landscapes, or even city blocks. Nesting of this section is also supported, so that if a child building also has a buildings section, it'll process it, and the parent building will be cut for each child building. | ||
The section starts with this header: | The section starts with this header:<br> | ||
<Buildings> | <code><Buildings></code> | ||
and ends with this footer: | and ends with this footer:<br> | ||
<EndBuildings> | <code><EndBuildings></code> | ||
Parameters | === Parameters === | ||
All of the parameters below are optional. | |||
#ConcurrentLoads - if this is set to true, load all buildings simultaneously. Default is false, which loads each building in order.<br>Example: <code>ConcurrentLoads = true</code> | |||
Example: ConcurrentLoads = true | #CutLandscape - if this is set to true, cut the Landscape mesh of buildings, discarding the area outside of the building's set boundaries. Default is true<br><code>CutLandscape = true</code> | ||
#CutBuildings - if this is set to true, cut the Buildings mesh of buildings, discarding the area outside of the building's set boundaries. Default is true<br><code>CutBuildings = true</code> | |||
#CutExternal - if this is set to true, cut the External mesh of buildings, discarding the area outside of the building's set boundaries. Default is false, since this may have an unnecessary performance impact<br><code>CutExternal = true</code> | |||
CutLandscape = true | #CutFloors - if this is set to true, cut the Floors meshes of buildings, discarding the area outside of the building's set boundaries. Default is false, since this may have an unnecessary performance impact<br><code>CutFloors = true</code> | ||
=== Commands === | |||
CutBuildings = true | *Load - load a building, creating a new Engine Context (script interpreter and sim engine pair) for it. This command requires a building filename to be specified, and optionally allows the position to be set (which overrides the Position value in that building's Globals section), the rotation (Y axis, which is left/right) in degrees to be set, and the bounds values to be set (which also overrides the building's Bounds value). For the rotation value, if "90" is specified, the building is rotated so that it faces the right. If the value is "270" or "-90", the building faces the left. The Bounds values are used to determine the position limits of what are considered that building, where if a building has a position X value of 200, and the MinX is -100 and MaxX is 100, the global positions of 100X to 300X are "inside" that building's space (200 - 100, and 200 + 100). Subfolders are supported, so a filename of "myfolder/mybuilding.bld" will load the building file at "buildings/myfolder/mybuilding.bld".<br>Syntax: <code>Load filename['', X, Y, Z, Rotation'']['', MinX, MinY, MinZ, MaxX, MaxY, MaxZ'']</code> | ||
**Example 1: <code>Load Simple.bld</code> | |||
CutExternal = true | **Example 2: <code>Load Simple.bld, 200, 0, 200, 0</code> | ||
**Example 3: <code>Load Simple.bld, 200, 0, 200, 0, -100, 0, -100, 100, 0, 100</code> | |||
CutFloors = true | **Example 4: <code>Load myfolder/mybuilding.bld</code> | ||
Commands | |||
Syntax: Load filename[, X, Y, Z, Rotation][, MinX, MinY, MinZ, MaxX, MaxY, MaxZ] | |||
Example 1: Load Simple.bld | |||
Example 2: Load Simple.bld, 200, 0, 200, 0 | |||
Example 3: Load Simple.bld, 200, 0, 200, 0, -100, 0, -100, 100, 0, 100 | |||
Example 4: Load myfolder/mybuilding.bld | |||
== The Vehicles Section == | == The Vehicles Section == | ||
The Vehicles section allows you to create vehicles for your building. Vehicles are numbered, starting with 1. | The ''Vehicles'' section allows you to create vehicles for your building. Vehicles are numbered, starting with 1. | ||
The section headers and footers are similar to the ones in the Floor section. | The section headers and footers are similar to the ones in the ''Floor'' section. | ||
To specify a single vehicle, you would type something like: | To specify a single vehicle, you would type something like:<br><code><Vehicle 1></code><br>and end it with:<br><code><EndVehicle></code> | ||
<Vehicle 1> | |||
and end it with: | |||
<EndVehicle> | |||
For a range of vehicles, you would use something like: | For a range of vehicles, you would use something like:<br><code><Vehicles 2 to 10></code><br>and end with:<br><code><EndVehicles></code> | ||
<Vehicles 2 to 10> | === Variables === | ||
and end with: | <code>%vehicle%</code> - number of the current vehicle | ||
< | === Parameters === | ||
#Name - sets the name of the vehicle.<br>Example: <code>Name = Car</code> | |||
#MaxEngineForce - sets the maximum engine force. Default is 3000 | |||
#SteeringIncrement - sets the steering increment. Default is 0.04 | |||
#SteeringClamp - sets the steering clamp, which is the maximum steering value. Default is 0.8. | |||
#WheelFriction - sets the wheel friction value. Default is 1e30 | |||
#SuspensionStiffness - sets the suspension stiffness value. Default is 20 | |||
#SuspensionDamping - sets the suspension damping value. Default is 2.3 | |||
#SuspensionCompression - sets the suspension compression. Default is 4.4 | |||
#RollInfluence - sets the roll influence value. Default is 0.1 | |||
#SuspensionRestLength - sets the suspension rest length. Default is 0.6 | |||
#MaxSuspensionTravelCm - sets the maximum suspension travel. Default is 500 | |||
#FrictionSlip - sets the friction slip value. Default is 10.5 | |||
#ChassisShift - sets the vehicle's chassis offset, in X, Y and Z values.<br><code>ChassisShift = 0, 1, 0</code> | |||
#ChassisMesh - defines the mesh file to use for the chassis<br><code>ChassisMesh = ogrebullet/models/chassis.mesh</code> | |||
#WheelMesh - defines the mesh file to use for the wheels<br><code>ChassisMesh = ogrebullet/models/wheel.mesh</code> | |||
#ChassisScale - sets the scaling factor for the chassis mesh<br><code>ChassisScale = 4</code> | |||
#WheelScale - sets the scaling factor for the wheel mesh<br><code>WheelScale = 4</code> | |||
=== Commands === | |||
#CreateVehicle - creates the vehicle at the specified location. Use this command after the CreateChassis and AddWheel commands.<br>Syntax: <code>CreateVehicle ''X, Y, Z''</code><br>Example: <code>CreateVehicle -50, 0, 0</code> | |||
#CreateChassis - creates the vehicle's cahssis. The parameters are physics options that are used when creating the rigid body<br>Syntax: <code>CreateChassis ''restitution, friction, mass, linear_dampening, angular_dampening''</code><br>Example: <code>CreateChassis 0.6, 0.6, 800, 0.2, 0.2</code> | |||
#AddWheel - adds a wheel to this vehicle. If ''engine'' is true, the wheel is powered by the engine. If ''steerable'' is true, the wheel is controlled by the steering wheel. The ConnectionPoint values specify the point at which to connect the wheel to the chassis. The Direction and Axle values are optional, and the defaults for those are "0, 01, 0" for the Direction, and "-1, 0, 0" for the Axle.<br>Syntax: <code>AddWheel ''engine, steerable, IsFrontWheel, radius, ConnectionPointX, ConnectionPointY, ConnectionPointZ[, DirectionX, DirectionY, DirectionZ, AxleX, AxleY, AxleZ]''</code><br>Example: <code>AddWheel true, true, true, 0.3, -1, 0, 0</code> | |||
== Example Building == | |||
There is an example of a small simplistic building in the code. Check out the [[Simple]] building code in the Skyscraper buildings directory. It's also available online [https://github.com/eventhorizon5/skyscraper/blob/master/buildings/Simple.bld here]. | |||
== See also == | == See also == | ||
* [[Help:HowTos|HowTos]] | * [[Help:HowTos|HowTos]] | ||
[[Category: | [[Category:Design Guide|*]] |
Latest revision as of 22:21, 6 November 2024
It contains good-faith information, such as an existing building or content. |
All of the text below was created by eventhorizon.
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.
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 when you choose "Other buildings..." in Skyscraper's main menu 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.
General Stuff
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</nowiki>
#Copyright ©2002-2013 Ryan Thoryk
Variables
Variables are marked with percent signs (%), and most system variables will be described later. Variables can be set using the Set
command:
Set myvariable = 100
and then can be used later:
Height = %myvariable%
IF/While statements
Basic IF and While statements can be made, with the following syntax:
if[expression] command
while[expression] command
Available signs are =
(equals), >
(greater than), <
(less than), !
(is not), &
(and) and |
(or). Expressions can also be enclosed in parenthesis. Note that IF/While statements only work with the current line, and do not currently support multiple lines within an IF/While block, an "else" statement, or nesting. A While statement will loop the current line until the expression is false, so be careful with this because it can create an infinite loop if the expression is always true. See the Functions section below for an example of a While statement.
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.
Inline calculations
Values can be calculated inline by using the following math operators:
+
(plus), -
(minus), /
(divide), *
(multiply), and ^
(power of)
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%))
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 Base, Altitude, Height, FullHeight and InterfloorHeight. Note that this function must only be called after the specified floor has been created.
If the InterfloorOnTop parameter in the globals section is set to 'false' (the default), then Base (slab height) refers to the floor's altitude plus interfloor height; otherwise it refers to the altitude.
Example:
Set 1 = Floor(5).Altitude
Includes
Other script files can be included (inserted) anywhere in the current script by using the <Include>
command. Scripts can be included multiple times, and included scripts can include other scripts.
Syntax:
<Include filename>
To include a file called test.txt that's in the data folder, you would enter:
<Include data/test.txt>
Functions
Functions can be created to share code between sections of scripts, and also between entire scripts when used in conjunction with includes. An unlimited number of parameters can be specified for each function. If a function is specified with the same name as a previously defined function, the function will be skipped and a warning will be printed. This can only be used outside of any section, such as <Floor>
.
Syntax:
<Function name>
(code)
<EndFunction>
The above is a function definition, and must be used before the function call. Functions can be called from anywhere in the script, and can also call other functions, resulting in nested functions. To call the function later in your code, use the function name followed by a list of parameters contained within parenthesis, or just parenthesis if you're not passing any parameters:
Syntax:
name(parameter1, parameter2, ...)
or
name()
The parameters appear as variables inside the function in the form of %param#%
- so the first parameter passed is %param1%
, the second is %param2%
, etc. For an example, I'll create a function called Test
with a single SetAutoSize
command within it, and call that function:
<Function test>
SetAutoSize = %param1%, %param2%
<EndFunction>
test(false, false)
In the above example, the command that ends up being performed is "SetAutoSize = false, false"
. Here is an example of using a While
statement to loop a function:
set a = 0
<Function testing>
set a = %a% + 1
print %a%
<EndFunction>
while [%a% < 5] testing()
print finished
The console output of that ends up being:
1
2
3
4
5
finished
Advanced Math Functions
Several built-in advanced math functions are provided, mostly for trigonometric calculations.
Syntax and descriptions:
- cos(x) - calculate cosine, x is angle in radians
- sine(x) - calculate sine, x is angle in radians
- tan(x) - calculate tangent, x is angle in radians
- acos(x) - calculate arc cosine, x is a value from -1 to 1
- asin(x) - calculate arc sine, x is a value from -1 to 1
- atan(x) - calculate arc tangent
- atan2(y, x) - calculate arc tangent with two values, one for the y-coordinate and one for the x
- sqrt(x) - calculate square root
- abs(x) - calculate absolute value
- exp(x) - calculate exponential function
- log(x) - calculate natural logarithm
- log2(x) - calculate binary logarithm
- log10(x) - calculate common logarithm
- mod(number, denominator) - calculate modulo (remainder) of a division
- hypot(x, y) - calculate hypotenuse
- ceil(number) - calculate ceiling (round up)
- flr(number) - calculate floor (round down)
- rnd(limit) - generate random number from 0 to limit
- round(number, decimals) - round number to nearest value; the decimals parameter is optional
For Loops
For loops can be created by specifying an iterator variable, and the range to use, with the following syntax:
<For iterator start To end>
(code)
<EndFor>
The For loop will loop until it completes the "end" value, and can iterate up or down. The value of the iteration is stored in the iterator variable and the variable name must be unique. In the following example, the iterator variable will be printed out on each iteration:
<For i 1 to 3>
Print %i%
<EndFor>
When the code is run, this is the result:
1
2
3
For loops can be nested, like this:
<For i 1 to 3>
<For j 1 to 4>
Print %i% : %j%
<EndFor>
<EndFor>
When the code is run, this is the result:
1 : 1
1 : 2
1 : 3
1 : 4
2 : 1
2 : 2
2 : 3
2 : 4
3 : 1
3 : 2
3 : 3
3 : 4
The Globals Section
The Globals section contains the general information about your building. This section is required, since it determines if a building file is valid. 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
All of the listed parameters below are optional.
- Name - building name
Example:Name = My Building
- Designer - name of building's designer
Designer = Me
- Location - location of the building
Location = 100 Main Street
- Description - Brief description of the building
Description = A really average building
- Version - Version of the building (can be text)
Version = 1
- CameraFloor - camera's starting floor, starting with 0 (like Floors command) - default is 0
CameraFloor = 0
- CameraPosition - camera's starting position in X (left/right) and Z (forward/backward) feet coordinates - default is "0, 0"
Syntax:CameraPosition = X, Z
CameraPosition = 0, -10 - CameraDirection - specifies a 3D point that the camera is looking at on startup (instead of specifying rotation), in X (left/right), Y (up down), and Z (forward/backward) feet coordinates.
CameraDirection = 0, 10, 28.8
- CameraRotation - axis rotation of the camera on startup - X is degrees up/down, Y is degrees left/right, and Z is spin. Default is "0, 0, 0", and the example makes the camera face right.
Syntax:CameraRotation = X, Y, Z
CameraRotation = 0, 90, 0 - Sky - which skybox texture pack to use, if the Caelum sky system is off. In the following example, the chosen pack is "noon", and the file "sky-noon.zip" will be loaded. Default is "noon".
Sky = noon
- DynamicSky - which Caelum sky script to use. In the following example, the script is "RainWind", which is listed in the data/caelum/sky.os resource file. Default is "DefaultSky".
DynamicSky = RainWind
Available sky types in data/caelum/sky.os file:
DefaultBase
DefaultSky
Cloudy
Overcast
BigPuffyStars
BigPuffyStarsWithFogComposer
MidnightSun
Eclipse
FogSky
RainWind
RainUp
ShadowDebug
HugeAmbientFactor
BasicCloud
OverrideCloud
CloudMesh
CloudFade
SkyDomeOverrideHazeTest
GroundFogNoise
SandStormTest - InterfloorOnTop - determines if the interfloor area should be located at the bottom or top of each floor. Interfloor areas represent the area used by floor trusses (supports), between a level's ceiling and the next level. Since each floor needs supports below it, the default is false.
InterfloorOnTop = true
- Collisions - enables/disables collisions (default is true)
Collisions = false
- Gravity - enables/disables gravity (default is true)
Gravity = false
- Coordinates - set latitude and longitude of building (for sky system)
Coordinates = 41.883, -87.629
- DateTime - set UTC date/time on startup (in Julian value), for sky system, or set to "now" to use the current system time
DateTime = 2457197.1254
DateTime = now - TimeScale - sets the time multiplier for the sky system. The default is 25. Set to 1 for real-time.
TimeScale = 1
- Position - set the 3D position of this building, used when loading multiple buildings. See the Load command in the Buildings section for more information.
Syntax: Position = X, Y, Z
Example: Position = 100, 0, 100 - Rotation - set the 3D rotation (Y axis, which is left/right), in degrees, of this building, used when loading multiple buildings. See the
Load
command in the Buildings section for more information.
Syntax:Rotation = value
Example:Rotation = 90
- Bounds - set the 3D boundaries of this building, which is only used if loading multiple buildings, and if this building is not the first (primary) building. If both Y values are 0, the Y values are set to be unlimited. See the Load command in the Buildings section for more information.
Syntax:Bounds = MinX, MinY, MinZ, MaxX, MaxY, MaxZ
Example:Bounds = -100, 0, -100, 100, 0, 100
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>
- Load - loads a texture
Syntax:Load filename, name, tile_x, tile_y[, force]
Example:Load data\brick1.jpg, Brick, 1, 1
This example will load the filebrick.jpg
and name itBrick
. 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. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. - 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[, force]
Example:LoadRange 2, 138, data\floorindicators\%number%.jpg, Button%number%, 1, 1
This example will load the file2.jpg
and name itButton2
,3.jpg
asButton3
, and so on. The valuestile_x
andtile_y
are per-texture multipliers. For example, if you settile_x
to 2, and you specify a texture width (tw) of 2 during anAddFloor
command later, the tiling value will be 4 (2 times 2), and the texture will be repeated 4 times horizontally. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. - LoadAnimated - loads a set of textures to use as a single animated texture
Syntax:LoadAnimated filename1, filename2, ..., name, duration, tile_x, tile_y[, force]
Example:LoadAnimated data/pic1.jpg, data/pic2.jpg, data/pic3.jpg, myanimation, 2, 1, 1
This example will load the files pic1.jpg, pic2.jpg and pic3.jpg and associate them with the texture material "myanimation". When "myanimation" is used, those three images will automatically be displayed in order, in a loop.Duration
refers to the length of the animation in seconds. The valuestile_x
andtile_y
are per-texture multipliers. For example, if you settile_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. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. - LoadAlphaBlend - loads a texture with a specular mask texture and blending texture, used to make things like reflection effects
Syntax:LoadAlphaBlend filename, specular_filename, blend_filename, name, spherical, tile_x, tile_y[, force]
Example:LoadAlphaBlend data/windows.jpg, data/windows_spec.png, data/sky.jpg, mywindows, true, 1, 1
This example will load the texture windows.jpg normally, and will load windows_spec.png as a specular mask (which needs to be a file that contains an alpha blended image that is used to determine how the blending texture applies to the original texture), and loads a texture to blend as sky.jpg (see Skyscraper's data folder for examples of this). The spherical parameter determines if the texture is spherically mapped (true) or planar mapped (false). 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. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. - LoadMaterial - loads a custom OGRE material, used for advanced/specific texture definitions
Syntax:LoadMaterial material_name, name, tile_x, tile_y[, force]
Example:LoadMaterial testmat, mycustommaterial, 1, 1
Material definitions (and their associated textures) are stored in Skyscraper's data/materials folder, and are all automatically loaded on startup. The material definitions (the example being testmat.material) contain a material name along with the texture processing parameters. The material name specified in this command needs to match the one in the material definition you want to use; the example file is named "testmat".Name
is the standard texture name you want to map it to, to use with other commands. The other commands are the same as in previous commands. For more information on how to make material definition scripts, see the OGRE manual's "Material Scripts" section. - AddText - draws text onto a texture - this only creates a new texture during runtime (in memory), and all changes are lost when the application shuts down
Syntax:AddText texture_name, name, font_filename, font_size, text, x1, y1, x2, y2, h_align, v_align, ColorR, ColorG, ColorB[, force]
Example:AddText Black, Button100, nimbus_sans.ttf, 47, 100, -1, -1, -1, -1, center, center, 255, 255, 255
With this command,texture_name
is the name of the previously loaded texture to draw text onto (loaded with either Load or LoadRange). Name is the name to call this new texture. Font_filename is the filename of the font to use - fonts are in Skyscraper's data/fonts directory.X1
,y1
,x2
, andy2
are coordinate values mainly used to position the text in a boxed area, with the position of 0, 0 (x 0, y 0) being on the top left.. If any value is -1, the dimension of the texture will be used (so in this example, the loaded texture has a size of 128x128 pixels, and so the values are 0, 0, 128, 128). This will place the text in the center of the texture image, but to position it elsewhere, specify the pixel box to place it in.H_align
andv_align
determine the alignment of the text - for h_align, it can either be "left", "right" or "center", and for v_align either "top", "bottom" or "center".ColorR
,ColorG
andColorB
determine the color of the text, and the values range from 0 to 255. If all values are 255, the text is white, and if all values are 0, then it's black. Theforce
value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. - AddTextRange - similar to LoadRange, but draws text onto a texture
Syntax:AddText startnumber, endnumber, texture_name, name, font_filename, font_size, text, x1, y1, x2, y2, h_align, v_align, ColorR, ColorG, ColorB[, force]
Example:AddText 1, 100, Black, Button%number%, nimbus_sans.ttf, 47, %number%, -1, -1, -1, -1, center, center, 255, 255, 255
- LoadCropped - loads a cropped image.
Syntax:LoadCropped filename, name, x, y, width, height, tile_x, tile_y[, force]
Example:LoadCropped data\brick1.jpg, Brick2, 10, 10, 20, 20, 1, 1
This command is similar to the Load command, but loads only a portion of an image. In the above example, the command loads the file data\brick1.jpg as "Brick2", but only loads the portion of the image starting at pixel 10, 10, with a width of 20 pixels and a heigth of 20 pixels. Pixel 0, 0 is on the top left of the image. The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. - AddOverlay - draws an image on top of another image
Syntax:AddOverlay texture_name, overlay_texture_name, name, x, y, width, height, tile_x, tile_y[, force]
Example:AddOverlay Brick1, Brick2, NewBrick, 25, 25, 50, 50, 1, 1
This command allows multiple textures to be combined into a single texture, by drawing one on top of the other. Texture_name specifies the original source texture name to use (all textures must be loaded beforehand), overlay_texture_name specifies the texture to draw on top of the source texture, and name specifies the name of the new texture. X and Y determine the position to place the top-left of the new image at (since position 0, 0 is the top left of the image), and width and height determine the size in pixels of the overlay texture. In the above example, the "Brick2" texture is drawn on top of the "Brick1" texture, starting at pixel position 25, 25, with a width of 50 and a height of 50. The resulting texture is called "NewBrick". The force value is optional, and if set to false, autosizing will always be disabled for this texture; if set to true, autosizing will always be enabled. - Rotate - sets a texture's rotation to a set amount. This can be used with other texture modifiers.
Syntax:Rotate name, angle
Example:Rotate Brick1, 30
This command sets the texture's rotation value. In the example, the Brick1 texture's rotation is set to 30 degrees (clockwise). - RotateAnim - applies rotation animation to a texture. This can be used with other texture modifiers.
Syntax:RotateAnim name, speed
Example:RotateAnim Brick1, 0.2
This command sets the texture's animated rotation value. Speed is in rotations per second. In the example, the Brick1 texture's rotation animation is set to 0.2 rotations per second. - Scroll - set's a texture's fixed scrolling value. This can be used with other texture modifiers.
Syntax:Scroll name, x_offset, y_offset
Example:Scroll Brick1, 0.5, 0.5
This command sets the texture's scrolling value. In the example, the Brick1 texture is shifted to the right halfway, and shifted up halfway. - ScrollAnim - applies scrolling animation to a texture. This can be used with other texture modifiers.
Syntax:ScrollAnim name, x_speed, y_speed
Example:ScrollAnim Brick1, 1, 1
The speed values are the number of full scrolls per second. In the example, the Brick1 texture will scroll to the right once per second, and up once per second. - Scale - sets a texture's scaling factor. This can be used with other texture modifiers.
Syntax:Scale name, x_scale, y_scale
Example:Scale Brick1, 30
In the example, the Brick1 texture is scaled to half the size, in both width and height. - Transform - sets an advanced transformation method on the texture. This can be used with other texture modifiers, and also can be used multiple times to create multiple transformations.
Syntax:Transform name, type, wave_type, base, frequency, phase, amplitude
Example:Transform Brick1, rotate, sine, 0.2, 0.2, 0.1, 1.0
This command applies an advanced transformation method on the texture. Type is the animation type modified, and can either be scroll_x, scroll_y, rotate, scale_x, or scale_y. Wave_type defines the type of waveform applied to the transformation, which creates a variable speed of the animation. The values are sine (a typical sine wave which smoothly loops between min and max values), triangle (an angled wave which increases & decreases at constant speed, changing instantly at the extremes), square (max for half the wavelength, min for the rest with instant transition between), sawtooth (gradual steady increase from min to max over the period with an instant return to min at the end), inverse_sawtooth (gradual steady decrease from max to min over the period, with an instant return to max at the end), or pwm (Pulse Width Modulation; like square, except the high to low transition is controlled by duty cycle). Base is the base value of the wave (base value, the minimum if amplitude > 0, the maximum if amplitude < 0), frequency is the number of wave iterations per second (speed), phase is the offset of the wave start, and amplitude is the size of the wave. - SetCulling - sets the culling value for a specified texture. This determines which sides of the object the texture should be displayed.
Syntax:SetCulling name, value
Example:SetCulling Brick1, 0
Values are 0 for no culling (show both sides), 1 to cull anticlockwise (SBS default), or 2 to cull clockwise (Ogre default, used for models).
In the example, the Brick1 texture is now showing both sides of the texture.
The Floor Sections
The Floor section can either be defined as a single floor, using the Floor name, or as a range of floors, using the Floors name.
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>
Or to work with basement floors -1 to -5, you would type:
<Floors -1 to -5>
Ranges in this can be specified in either direction. 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 created in descending order (-1, -2, -3 etc), and above-ground floors in ascending order (0, 1, 2, etc).
If floor 0 is created first, and then basement levels, floor -1's altitude will be adjusted based on floor 0's altitude; otherwise if floor -1 is created first, it's altitude will be the negative full height.
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
- %base% - if the InterfloorOnTop parameter in the Globals section is set to 'false' (the default), then Base refers to the floor's altitude plus interfloor height (slab height); otherwise it's the floor's altitude
- %floorname% - the floor's name
- %floorid% - the floor's ID
- %floornumberid% - the floor's NumberID
- %floortype% - the floor's type
- %description% - the floor's description
Parameters
- Name - the name of the current floor, required
Example:Name = Floor %floor%
- 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%
- NumberID - the numeric ID for the current floor, used mainly for Destination Dispatch keypads. This is preferred instead of the floor number, because floor numbers start at 0, and are used as a floor array instead of the actual floor numbers that you would prefer. If your building has a floor 0, you would set NumberID to 1 for that floor. Floor 13 for example can be skipped by setting NumberID to 14.
NumberID = 14
- 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
- Description - description of the current floor, optional
Description = Offices
- Height - the floor-to-ceiling height of the current floor, required
Height = 9.5
- 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
- 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
- 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
- Exit - exits the current floor section
- 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, reverse_axis, texture_direction, tw, th, isexternal
Example: AddFloor My Floor, Brick, 0.5, -10, -10, 10, 10, 0, 0, False, False, 0, 0, False
Voffset1 and voffset2 are the height in feet above the current floor's base; 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. The reverse_axis parameter reverses the axis that the difference in altitude/voffset for floors corresponds to. If this is false, and the altitude values are different, the floor will angle upward/downward along the Z axis (front/back), and if set to true, the floor will angle along the X axis (left/right). If texture_direction is false, the texture will be mapped horizontally on the floor; if true, it'll be mapped vertically. If isexternal is true, the voffset values are relative of the floor's altitude, not base. - 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 base) 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). If isexternal is true, the voffset values are relative of the floor's altitude, not base. - AddInterfloorFloor - adds a textured floor below the floor of the current floor/level
Syntax:AddInterfloorFloor name, texturename, thickness, x1, z1, x2, z2, voffset1, voffset2, reverse_axis, texture_direction, 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, not above the base. - 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. - 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, reverse_axis, texture_direction, tw, th
Example:AddShaftFloor 1, My Floor, Brick, 0.5, -10, -10, 10, 10, 0, 0, false, false, 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) - 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) - 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, reverse_axis, texture_direction, tw, th
Example:AddStairsFloor 1, My Floor, Brick, 0.5, -10, -10, 10, 10, 0, 0, false, false, 0, 0
The parameters are the same as the AddFloor command, and the number value is the stairwell number to use - 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) - ColumnWallBox - creates 4 walls (box) at the specified coordinate locations, as part of the current floor's columnframe mesh
Syntax:ColumnWallBox name, texturename, x1, x2, z1, z2, height, voffset, tw, th, inside, outside, top, bottom
Example:ColumnWallBox 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. - ColumnWallBox2 - creates 4 walls (box) at a specified central location, as part of the current floor's columnframe mesh
Syntax:ColumnWallBox2 name, texturename, centerx, centerz, widthx, lengthz, height, voffset, tw, th, inside, outside, top, bottom
Example:ColumnWallBox2 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. - CallButtonElevators - list of elevators the next created call button set will work with (this must be specified before CreateCallButtons)
Example:CallButtonElevators = 1, 2, 3, 4
Example:CallButtonElevators = 1 - 4
- CreateCallButtons - creates a call button set
Syntax:CreateCallButtons SoundUp, SoundDown, BackTexture, UpButtonTexture, UpButtonTexture_Lit, DownButtonTexture, DownButtonTexture_Lit, CenterX, CenterZ, voffset, direction, BackWidth, BackHeight, ShowBack, tw, th
Example:CreateCallButtons switch.wav, switch.wav, Marble, CallButtonsUp, CallButtonsUpLit, CallButtonsDown, CallButtonsDownLit, -10, 0, 4, right, 0.5, 1, true, 1, 1
SoundUp is the filename of the sound to play when the up call button is pressed
SoundDown is the filename of the sound to play when the down call button is pressed
BackTexture is the texture of the wall plate behind the buttons
UpButtonTexture and DownButtonTexture are the textures used for the buttons themselves (unlit). UpButtonTexture_Lit and DownButtonTexture_Lit specify the lit button textures.
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 combined range of the elevators specified with the CallButtonElevators command (above).
Actions are automatically created for call buttons, and here's available action command names that can be used for custom controls:
Off (no action)
Up (perform up call)
Down (perform down call)
PressUp (press Up call button)
PressDown (press Down call button)
FireOff (set fire service phase 1 to Off for all elevators serviced by this call button)
FireOn (set fire service phase 1 to On for all elevators serviced by this call button)
FireBypass (set fire service phase 1 to Bypass for all elevators service by this call button) - AddStairs - creates a custom staircase at the specified location.
Syntax:AddStairs number, name, riser_texture, tread_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, multiply (num_stairs - 1) with treadsize; in the above example, that would be 9 * 0.5. To determine the height of the staircase, multiply num_stairs with risersize. 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 (which is why the length calculation used num_stairs minus 1). - 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 opensound, closesound, open, texturename, thickness, direction, speed, CenterX, CenterZ, width, height, voffset, tw, th
Example: AddDoor , , False, DoorTexture, 0.2, 1, 0, -8.5, 0, 3.5, 8, 0, 1, 1
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
The default door speed is 75; you can also specify 0 for the speed to use the system default. The open parameter determines if the door should be opened on start; default is false. Leave the sound fields blank for no sounds to be played. - 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, opensound, closesound, open, texturename, thickness, direction, speed, 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. Leave the sound fields blank for no sounds to be played. - AddShaftStdDoor - adds a standard textured door for the specified shaft, in a location relative to the shaft's center. This also performs a wall cut on that area (this must be called after the associated wall is created). This shouldn't be confused with the AddShaftDoor command, which creates elevator shaft doors.
Syntax:AddShaftStdDoor number, opensound, closesound, open, texturename, thickness, direction, speed, CenterX, CenterZ, width, height, voffset, tw, th
Number specifies the shaft number. Direction specifies the direction the door faces and also the direction it opens. For values of this, look at the AddDoor command above. Leave the sound fields blank for no sounds to be played. - AddExternalDoor - same as the AddDoor command, but creates an external (global) door that is always visible. With this command, the voffset parameter is relative of the floor's altitude, not base.
Syntax:AddExternalDoor opensound, closesound, open, texturename, thickness, direction, speed, CenterX, CenterZ, width, height, voffset, tw, th
Example:AddExternalDoor , , False, DoorTexture, 0.2, 1, 0, -8.5, 0, 3.5, 8, 0, 1, 1
- AddDirectionalIndicator - creates a single elevator directional indicator/lantern on the current floor (similar to the CreateCallButtons command)
Syntax:AddDirectionalIndicator Elevator:Car, Relative, ActiveDirection, Single, Vertical, BackTexture, UpTexture, UpTextureLit, DownTexture, DownTextureLit, CenterX, CenterZ, voffset, direction, BackWidth, BackHeight, ShowBack, tw, th
Example:AddDirectionalIndicator 1, true, false, false, true, Metal, UpLight, UpLightOn, DownLight, DownLightOn, -3, -4.162, 6, front, 0.5, 1, true, 0, 0
This command will create a directional indicator on the current floor (if ActiveDirection is false, then it'll only create it if the elevator serves that floor). It'll also automatically create the up and down lights depending on the floor.
Elevator:Car specifies the elevator and car to create the indicators for. The car value is optional, and if left out, either the car will be used that services the floor, or the first car will be used. For example, values can be "1" for Elevator 1 (uses default car or Car 1), or "1:1" for Elevator 1 Car 1
Relative determines if the X and Z coordinates are relative to the elevator's origin (center) or not.
ActiveDirection determines if the indicator should continuously display the active elevator direction (true), or if it should show the elevator's direction for the current call (false, default)
Single determines if a single indicator light should be created instead of two. If this is true, the unlit texture is specified in UpLight, and the DownLight value is ignored.
Vertical determines if the two lights should be vertically separated (true), or horizontally separated (false)
BackTexture is the texture of the wall plate behind the lights
UpTexture and DownTexture are the textures used for the lights themselves, and the "Lit" textures are the ones to show when the light is on.
DownTexture is ignored if Single is true.
CenterX and CenterZ are the central location of the indicators
voffset is the altitude offset that the object is above each floor
direction determines the direction the indicators 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. - AddShaftDoor - creates shaft elevator doors on the current floor only
Syntax:AddShaftDoor elevator:car, number, lefttexture, righttexture, thickness, CenterX, CenterZ, voffset, tw, th
Syntax (with old SetShaftDoors command):AddShaftDoor elevator, number, lefttexture, righttexture, tw, th
The AddShaftDoor command creates working shaft elevator doors on the current floor only - the other command, AddShaftDoors (in the elevator section) creates all shaft doors in a single command. This command is useful for specifying different textures for shaft doors depending on the floor, and also for only creating shaft doors on one side if an elevator serves a specific floor. The SetShaftDoors command in the elevator section must be used before using this command. Parameters such as width, height, and direction are taken from the AddDoors command (so the regular elevator doors need to be created first). The voffset parameter allows you to create shaft doors at a different vertical position than the base of the floor, and the elevator will automatically stop according to the shaft door's voffset for that floor. These doors should be moved slightly away from the elevator car doors (to separate them both). Also, this command cuts any shaft walls that are within the door area (and so this must be called after the shaft walls are created). Number specifies the number of the door to create (related to the Doors command) - if the elevator only has one door, or if the Doors command was not used, specify 1 here. The Elevator:Car parameter specifies both the elevator and optionally elevator car to use (see the AddDirectionalIndicator command for more information). - AddFloorIndicator - creates a floor indicator associated with a specific elevator
Syntax:AddFloorIndicator elevator:car, relative, texture_prefix, blank_texture, direction, CenterX, CenterZ, width, height, voffset
The AddFloorIndicator command creates a floor indicator at the position specified by CenterX and CenterZ, associated with the elevator and car specified by elevator:car (see the AddDirectionalIndicator command). Direction is the direction the indicator faces, and can be either "left", "right", "front" or "back". Relative determines if the CenterX and CenterZ values are relative of the elevator's center or not. This command can be given multiple times to create multiple indicators. Texture_prefix is the base name of the texture to load when displaying a floor ID; for example if the indicator is on floor 3, and you specify a prefix of "Button", it'll load the "Button3" texture. Blank_texture specifies a texture to be used when the indicator is blank. - 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's altitude. If cutwalls is true, the function will cut walls; if cutfloors is true, it'll cut floors. - CutAll - performs a manual box cut on all objects associated with the current floor (the level itself, interfloor, shafts, stairs and external)
Syntax:CutAll x1, y1, z1, x2, y2, z2, cutwalls, cutfloors
Example:CutAll -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's altitude. If cutwalls is true, the function will cut walls; if cutfloors is true, it'll cut floors. - AddFillerWalls - helper function to add fillers around a door's cut location. When a door is created, the wall in it's location is cut to provide space; after the cut, the sides are open (if the wall has thickness) - this creates a covering wall on each side and a floor above the door frame to fill the area.
Syntax:AddFillerWalls texture, thickness, CenterX, CenterZ, width, height, voffset, direction, tw, th, isexternal
Example:AddFillerWalls ConnectionWall, 0.5, -10, 0, 3.5, 8, 0, true, 0, 0, false
The parameters in this function are similar to the related door's parameters. Direction is either true if the door faces the front/back (width is along the X axis), or false if the door faces left/right (width is along the Z axis).
The isexternal parameter is the same as with the AddWall command, and if it is true, the voffset value is relative of the floor's altitude, not base. - AddSound - creates a user-defined sound at the specified position
Syntax:AddSound name, filename, x, y, z, loop[, volume, speed, min_distance, max_distance, doppler_level, cone_inside_angle, cone_outside_angle, cone_outside_volume, direction_x, direction_y, direction_z]
Example 1:AddSound MySound, sound.wav, 10, 100, 5, true
Example 2:AddSound MySound, sound.wav, 10, 100, 5, true, 1, 100, 1, -1, 0, 360, 360, 1, 0, 0, 0
For information on the parameters, see the AddSound command in the Global Commands section. The only difference here is that the Y value is relative of the floor's base (altitude plus interfloor height). Loop specifies if the sound should loop and play on startup. - AddShaftDoorComponent - creates a single shaft door component, used for creating custom door styles
Syntax:AddShaftDoorComponent elevator:car, number, name, texture, sidetexture, thickness, direction, openspeed, closespeed, x1, z1, x2, z2, height, voffset, tw, th, side_tw, side_th
This command is almost identical to the AddDoorComponent command (in the elevator section below - see that for more information), except that it creates shaft doors. Use the FinishShaftDoor command after creating the components. The components don't need to line up with the floor's base; the elevator will automatically stop at the base of the shaft door for each floor. This command replaces the AddShaftDoor command. The Elevator:Car parameter specifies both the elevator and optionally elevator car to use (see the AddDirectionalIndicator command for more information). - FinishShaftDoor - finishes shaft door creation - use this after all related AddShaftDoorComponent commands are used, or specify it without the AddShaftDoorComponent commands if you're creating a manual shaft door.
Syntax:FinishShaftDoor elevator:car, number[, door_walls, track_walls]
This command is almost identical to the FinishDoors command (in the elevator section below - see that for more information) except that it's used for finishing a shaft door. - AddModel - adds a 3D model to the floor. If a filename is specified, the model's textures/materials must be defined in a separate ".material" file, and a separate collider mesh ".collider.mesh" will be loaded. In that situation, if a collider mesh isn't available, a simple box collider will be created. If a filename is not specified, this command will create a new empty model, where it's name can be used as the destobject parameter in other commands (in the related Floor section), and a collider will be automatically created.
Syntax:AddModel name, filename, center, CenterX, CenterY, CenterZ, RotationX, RotationY, RotationZ, MaxRenderDistance, ScaleMultiplier, EnablePhysics, Restitution, Friction, Mass
Example 1:AddModel MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, false, 0, 0, 0
Example 2:AddModel MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, true, 0.1, 0.5, 0.1
Example 3:AddModel MyModel, , false, 0, 0, 0, 0, 0, 0, 0, 1, true, 0.1, 0.5, 0.1
The Center value is either true or false, and determines if the loaded model should be automatically centered, otherwise the exact mesh positioning in the model file will be used. The CenterY value is relative to the current floor's base. MaxRenderDistance determines the maximum distance in feet that the object will be shown (0 means unlimited). ScaleMultiplier allows you to change the size of the object during the load - for example, set to 2 to double the size. Model files are in the OGRE native mesh format. In the example, the material/texture file is cube.material, and the optional collider mesh file is cube.collider.mesh. EnablePhysics enables Bullet physics on the object (physics will only work if you don't provide a collider mesh), and Restitution, Friction and Mass determine the physical properties of the object. - AddStairsModel - adds a 3D model to the specified stairwell, on the current floor. See the AddModel command above for parameter information.
Syntax:AddStairsModel number, name, filename, center, CenterX, CenterY, CenterZ, RotationX, RotationY, RotationZ, MaxRenderDistance, ScaleMultiplier, EnablePhysics, Restitution, Friction, Mass
Example:AddModel 1, MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, false, 0, 0, 0
The CenterY value is relative to the current floor's altitude. - AddShaftModel - adds a 3D model to the specified shaft, on the current floor. See the AddModel command above for parameter information.
Syntax:AddShaftModel number, name, filename, center, CenterX, CenterY, CenterZ, RotationX, RotationY, RotationZ, MaxRenderDistance, ScaleMultiplier, EnablePhysics, Restitution, Friction, Mass
Example:AddModel 1, MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, false, 0, 0, 0
The CenterY value is relative to the current floor's altitude. - AddActionControl - creates a custom control that uses a specific action defined by AddAction.
Syntax:AddActionControl name, sound, direction, centerx, centerz, width, height, voffset, selection_position, action_name(s), texture_name(s)
Example:AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit
AddActionControl command creates an advanced control similar to elevator button panel controls, but assigned to an action created with the AddAction command. The action_name(s) and texture_name(s) parameters allow you to specify a list of actions, and a list of textures to go along with those actions. There needs to be a texture for every action; if you specify 3 actions and only 2 textures, you will get an error. The control starts up in the first action, and switches to the next actions in sequence when it's clicked. Direction is the direction the control itself will face in 3D space (front, left, right, back). Voffset is relative of the floor's base. Leave the sound field blank for no sound to be played. Selection_position is the selection position to start at, which is normally 1. - AddShaftActionControl - creates a custom control in a specified shaft that uses a specific action defined by AddAction.
Syntax:AddShaftActionControl number, name, sound, direction, centerx, centerz, width, height, voffset, selection_position, action_name(s), texture_name(s)
Example:AddShaftActionControl 1, MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit
This command creates an advanced control similar to elevator car button panel controls, but assigned to an action created with the AddAction command. The action_name(s) and texture_name(s) parameters allow you to specify a list of actions, and a list of textures to go along with those actions. There needs to be a texture for every action; if you specify 3 actions and only 2 textures, you will get an error. The control starts up in the first action, and switches to the next actions in sequence when it's clicked. Direction is the direction the control itself will face in 3D space (front, left, right, back). Voffset is relative of the floor's base. Leave the sound field blank for no sound to be played. Selection_position is the starting selection position, which is normally 1. - AddStairsActionControl - creates a custom control in a specified stairwell that uses a specific action defined by AddAction.
Syntax:AddStairsActionControl number, name, sound, direction, centerx, centerz, width, height, voffset, selection_position, action_name(s), texture_name(s)
Example:AddStairsActionControl 1, MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit
This command creates an advanced control similar to elevator button panel controls, but assigned to an action created with the AddAction command. The action_name(s) and texture_name(s) parameters allow you to specify a list of actions, and a list of textures to go along with those actions. There needs to be a texture for every action; if you specify 3 actions and only 2 textures, you will get an error. The control starts up in the first action, and switches to the next actions in sequence when it's clicked. Direction is the direction the control itself will face in 3D space (front, left, right, back). Voffset is relative of the floor's base. Leave the sound field blank for no sound to be played. Selection_position is the starting selection position, which is normally 1. - AddTrigger - creates a trigger that is used to signal an action when the user's camera enters or leaves the defined area.
Syntax:AddTrigger name, sound, start_x, start_y, start_z, end_x, end_y, end_z, action_names(s)
Example:AddTrigger MyTrigger, switch.wav, -30, 0, -30, -20, 10, -20, UndoMyAction, MyAction
AddTrigger creates a trigger similar to action controls (AddActionControl) and elevator car controls. The action_names(s) parameter allows you to specify a list of actions that this trigger will call when the camera enters or exits the area. The trigger starts in the first action, and will switch to each consecutive action when the users enters/leaves. The X, Y and Z parameters specify the 3D box that defines the trigger area. Y is relative of the floor's base. Leave the sound field blank for no sound to be played. - AddRevolvingDoor - adds a textured revolving door in the specified location.
Syntax:AddDoor name, run, sound, texturename, thickness, clockwise, segments, speed, rotation, CenterX, CenterZ, width, height, voffset, tw, th, external
Example:AddRevolvingDoor MyRevDoor, false, , DoorTexture, 0.2, false, 4, 0.2, -8.5, 0, 3.5, 8, 0, 1, 1, false
Run is either true or false, and determines if the door should move on startup. Clockwise determines the direction the door rotates. Segments determines how many door segments to create (2-4). Leave the sound field blank for no sounds to be played.
Rotation determines the starting rotation of the door. - AddEscalator - creates an escalator at the specified location.
Syntax:AddEscalator name, run, speed, sound_file, riser_texture, tread_texture, direction, CenterX, CenterZ, width, risersize, treadsize, num_steps, voffset, tw, th
Example:AddEscalator MyEscalator, 1, 1, 1.0, , Brick, left, 0, -10, 4, 1, 1, 15, 0, 1, 1
The direction parameter specifies the direction the escalator faces (where the bottom step is), and so if an escalator 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_steps specifies the total number of steps to create. Run specifies the run state, where 1 equals forward, 0 equals stopped, and -1 equals reverse.
Actions are automatically created for escalators, and here's the available actions for custom controls:
Forward (run forward)
Reverse (run in reverse)
Stop (stop) - AddMovingWalkway - creates a moving walkway at the specified location. This command is similar to AddEscalator.
Syntax:AddMovingWalkway name, run, speed, sound_file, texture, direction, CenterX, CenterZ, width, treadsize, num_steps, voffset, tw, th
Example:AddMovingWalkway MyWalkway, 1, 1, 1.0, , Brick, left, 0, -10, 4, 1, 15, 0, 1, 1
The direction parameter specifies the direction the walkway faces (where the first step is), and so if a walkway goes from left to right, the direction would be left. Width specifies the step width; treadsize specifies the length of each step tread/run (horizontal portion); num_steps specifies the total number of steps to create. Run specifies the run state, where 1 equals forward, 0 equals stopped, and -1 equals reverse.
Moving walkways use the same action names as Escalator objects, so refer to that object for the action names.
The Elevator Section
The Elevator section allows you to create elevators for your building. Elevators are numbered, starting with 1.
Each elevator is created with a single default car, Car 1. Car-specific parameters and commands are listed in the Car section, but can also be specified in this section, if an elevator only has a single car, or if you're referring to Car 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>
When creating a new elevator car, the required values for each are the Speed, Acceleration, Deceleration, AssignedShaft, and ServicedFloors parameters and the CreateElevator command.
Variables
%elevator%
- number of the current elevator
Parameters
- Name - sets the name of the elevator
Example:Name = Service Elevator
- ID - sets the ID of the elevator, used for Destination Dispatch. The default is the number of the elevator.
Example:ID = A
- Type - sets the type of the elevator. Available types are "Local" for a standard local passenger elevator (the default), "Express" for an express elevator, "Service" for a service elevator, and "Freight" for a freight elevator.
Example:Type = Express
- Speed, UpSpeed, DownSpeed - maximum speed of the elevator, for either both up and down movements (Speed), or for each individual movement direction (UpSpeed and DownSpeed), in feet per second
Example:Speed = 20
- Acceleration - acceleration speed of the elevator, in feet per second
Example:Acceleration = 0.015
- AccelJerk - acceleration jerk rate of the elevator (rate of change of acceleration)
Example:AccelJerk = 1.0
- Deceleration - deceleration speed of the elevator, in feet per second
Example:Deceleration = 0.0075
- DecelJerk - deceleration jerk rate of the elevator (rate of change of deceleration)
Example:DecelJerk = 1.0
- AssignedShaft - the shaft number this elevator is in
Example:AssignedShaft = 1
- MotorStartSound, MotorUpStartSound, MotorDownStartSound - the sound file to play when the elevator motor starts moving/speeds up (sets both directions). Default is elevstart.wav. Leave the filename field blank for no sound. The first command specifies both up and down sounds, while the others are for either upwards movement or downwards movement.
Example:MotorStartSound = start.wav
- MotorRunSound, MotorUpRunSound, MotorDownRunSound - the sound file to play while the elevator motor is running (sets both directions). This file is automatically looped by the simulator. Default is elevmove.wav. Leave the filename field blank for no sound. The first command specifies both up and down sounds, while the others are for either upwards movement or downwards movement.
Example:MotorRunSound = run.wav
- MotorStopSound, MotorUpStopSound, MotorDownStopSound - the sound file to play when the elevator motor slows down and stops (sets both directions). Default is elevstop.wav. Leave the filename field blank for no sound. The first command specifies both up and down sounds, while the others are for either upwards movement or downwards movement.
Example:MotorStopSound = stop.wav
- MotorIdleSound - the sound file to play when the elevator motor is idling. There is no default yet. Leave the filename field blank for no sound.
Example:MotorIdleSound = idle.wav
- FloorSkipText - sets the text that will be shown in the floor indicator when passing non-serviced floors. The texture for this must be loaded for it to show (and will start with the related indicator's texture prefix) - of you set this to EX for example, and the indicator's texture prefix is "Button", the texture it'll load will be ButtonEX.jpg. Common values for this are EZ, X, and EX (which stand for Express Zone).
Example:FloorSkipText = EZ
- RecallFloor - sets the floor the elevator will recall to during fire service phase 1 mode. Default is the lowest serviced floor.
Example:RecallFloor = 5
- AlternateRecallFloor - sets the alternate floor the elevator will recall to during fire service phase 1 mode. Default is the highest serviced floor.
Example: AlternateRecallFloor = 6 - ACP - enables ACP (Anti-Crime Protection) mode
Example:ACP = true
- ACPFloor - sets the floor the elevator will stop at while in ACP mode. Default is the lowest serviced floor.
Example:ACPFloor = 5
- MotorPosition - sets the position of the motor sound emitter; if this command is not specified, it'll be placed at the base (altitude + interfloor) of the highest floor in the corresponding shaft. The X and Z values are relative of the elevator center.
Syntax:MotorPosition = x, y, z
Example:MotorPosition = 0, 100, 0
- QueueResets - set this to true if you want the elevator to reset the related queue (up or down) after it reaches the last valid entry. If the elevator is moving up for example with this setting on, and you press buttons for floors below you, the elevator will remove those entries after it reaches the highest selected floor. The elevator will only be available for hall calls in the active queue direction.
Example:QueueResets = true
- LimitQueue - set this to true to only allow floor selections in the same direction as the active elevator queue direction to be placed. For example, if the elevator is moving up, and a button is pressed for a lower floor, this will prevent that from being queued. The elevator will only be available for hall calls in the active queue direction.
Example: LimitQueue = true - UpPeak - enables up peak mode for this elevator.
Example:UpPeak = true
- DownPeak - enables down peak mode for this elevator.
Example:DownPeak = true
- InspectionService - enables inspection service mode for this elevator.
Example:InspectionService = true
- InspectionSpeed - speed multiplier for inspection service (if set to 0.6, would be 60% of elevator speed)
Syntax:InspectionSpeed = multiplier
- Parking - enables automatic elevator parking. If this option is used, the elevator will automatically send itself to the specified parking floor after the number of seconds specified in delay.
Syntax:Parking = floor, delay
- LevelingSpeed - elevator's leveling speed. Default is 0.2
Syntax:LevelingSpeed = speed
- LevelingOffset - distance in feet from the destination floor that the elevator will switch into leveling mode. Default is 0.5
Syntax:LevelingOffset = distance
- LevelingOpen - distance in feet from the destination floor that the elevator will open the doors. Default is 0.
Syntax:LevelingOpen = distance
- NotifyEarly - changes behavior of arrival notifications (chime, lighting of directional indicator, and floor announcement sound). 0 is the default and notifies when the elevator stops on the floor. 1 notifies when the elevator starts the leveling process, and 2 notifies when the elevator starts decelerating. A value of 3 combines 0 and 2 so that the elevator notifies twice. A value of -1 turns off standard notifications.
Syntax:NotifyEarly = value
- NotifyLate - if set to true, the elevator car performs an arrival notification (chime, lighting of directional indicator, and floor announcement sound) after the doors open. False is the default.
Syntax:NotifyLate = value
- DepartureDelay - sets the time in seconds that the elevator waits before proceeding to the next floor. Default is 0.
Syntax:DepartureDelay = 1
- ArrivalDelay - sets the time in seconds that the elevator waits before opening the doors after arriving at a floor. The default is 0. Note that a value greater than 0 will switch off the LevelingOpen setting.
Syntax:ArrivalDelay = 0.5
- FireService1 - sets the fire service phase 1 mode that the elevator will start with. Default is 0. Values are 0 for off, 1 for on, 2 for bypass.
Syntax:FireService1 = 2
- AutoDoors - if this is set to true, the elevator doors will automatically open if instructed (for example, when arriving at a floor), and will refuse to open if between floors. Set to false for manual elevators. The default is true.
Example:AutoDoors = false
- OpenOnStart - if this is set to true, the elevator doors will automatically open on startup. The default is false.
Example:OpenOnStart = false
- Interlocks - if this is set to true, the elevator doors will remain locked while the elevator is moving, will refuse to open unless the elevator is within a landing zone, and the elevator will not move unless the doors are closed. The default is true.
Example:Interlocks = false
- FloorHold - if this is set to true, the user must hold down the floor button in order to move to the desired floor. When the button is released, the elevator will immediately stop. This is used to mimic a modern manual elevator (platform lift). The default is false.
Example:FloorHold = true
- MotorEmergencyStopSound - the sound file to play for the elevator motor when an emergency stop is initiated. Leave the filename field blank to use the normal motor stop sound, if specified. The default is emergstop.wav
Example:MotorEmergencyStopSound = emergstop.wav
- EmergencyStopSpeed - the speed multiplier to use for an emergency stop. A value of 3, the default, would mean 3 times the normal deceleration rate.
Example:EmergencyStopSpeed = 2.5
- ChimeOnArrival - if set to true, the elevator will always chime when arriving to a floor. If false (the default), the elevator will only chime when responding to a hall call.
Example:ChimeOnArrival = true
- ReOpen - if this is set to true, if the elevator is idle, the doors will reopen if the same floor is selected. The default is true.
Example:ReOpen = false
- HoistwayAccessHold - if this is set to true, the control switch in Hoistway Access mode needs to be held in the direction position, for the elevator to move. The default is true.
Example:HoistwayAccessHold = false
- RunState - if this is set to false, the elevator starts in a stopped state. The default is true.
Example:RunState = false
- RopePosition - sets the position of the rope connection with the elevator. All values are relative of the elevator center.
Syntax:RopePosition = x, y, z
Example:RopePosition = 0, 8, 0
- RopeTexture - the texture to use for the elevator rope.
Example:RopeTexture = Rope
- CounterweightStartSound - the sound file to play for the counterweight when starting movement.
Example:CounterweightStartSound = weight_start.wav
- CounterweightMoveSound - the sound file to play for the counterweight during movement.
Example:CounterweightMoveSound = weight_move.wav
- CounterweightStopSound - the sound file to play for the counterweight when stopping movement.
Example:CounterweightStopSound = weight_stop.wav
Commands
- CreateElevator - creates an elevator at the specified location
Syntax:CreateElevator relative, x, z, floor
Example:CreateElevator false, 0, 10, 0
Relative determines if the coordinates are relative to the shaft center, or if they're absolute, X and Z are the coordinates to place the center of the elevator at, and Floor is the floor to place the elevator on. - CreateCounterweight - creates an elevator counterweight at the specified location. This should normally be used at the end of the Elevator section, after all cars are created. This command not only creates the counterweight, but also creates the counterweight and elevator ropes. The rope texture is specified in the RopeTexture parameter.
Syntax:CreateCounterweight frame_texture, weight_texture, x, z, size_x, size_y, size_z, weight_voffset
Example:CreateCounterweight CounterweightFrame, Counterweight, 0, 3.5, 2, 6, 0.5, 0.5
X and Z are the coordinates to place the center of the counterweight at, relative of the elevator center, size_x, size_y, size_z are the size of the counterweight, and weight_voffset is the vertical offset the weight should be at. - AddRails - creates rails on all relevant floors of a shaft, for either an elevator or counterweight. X and Z are relative of the elevator center. Orientation is either false to create the rails along X, or true to create them along Z. Rail_distance is the distance between the rail and the center of the elevator, and rail_width is the size of the rail. This command must be specified after the MotorPosition parameter.
Syntax:AddRails main_texture, edge_texture, x, z, orientation, rail_distance, rail_width
Example:AddRails Rails, RailsEdge, 0, 3.5, false, 1 + 0.06, 0.1
The Car (Elevator) Section
In order to support multi-deck elevators, each elevator car can be defined separately. The Car section is a subsection of the Elevator section, and allows you to create additional cars for your elevator. These are also numbered, starting with 1.
To create additional cars, this section is normally placed right after the elevator's CreateElevator command.
The section headers and footers are similar to the ones in the Elevator section.
To specify a single car, you would type something like:
<Car 2>
and end it with:
<EndCar>
For a range of elevators, you would use something like:
<Cars 1 to 2>
and end with:
<EndCars>
When creating a new elevator car, the required values for each are the ServicedFloors parameter and the CreateCar command.
Variables
%elevator%
- number of the current elevator
%car%
- number of the current car
Parameters
- Name - sets the name of the car
Example:Name = Lower Car
- OpenSpeed - open/close speed of the elevator doors. This must be specified after the CreateCar command.
Syntax:OpenSpeed doornumber = value
Example:OpenSpeed 1 = 0.2
- SlowSpeed - open/close speed multiplier of the elevator doors used for slow movement, usually nudge mode. The default is 0.5, which ends up being half of the door's speed value. This must be specified after the CreateCar command.
Syntax:SlowSpeed doornumber = value
Example:SlowSpeed 1 = 0.2
- ManualSpeed - open/close speed multiplier of the elevator doors used for manual movement. The default is 0.2. This must be specified after the CreateCar command.
Syntax:ManualSpeed doornumber = value
Example:ManualSpeed 1 = 0.2
- ServicedFloors - a comma-separated list of floors this elevator car services. Ranges can also be specified by putting a "-" between the numbers. Please note that each car must serve different floors.
Example:ServicedFloors = 0, 5, 6, 7-30, 31
- DoorTimer - the length of time (in milliseconds) that the elevator doors should stay open before automatically closing. Specify 0 to disable. The default is 5000, or 5 seconds. This must be specified after the CreateCar command.
Syntax:DoorTimer doornumber = value
Example:DoorTimer 1 = 10000
- QuickClose - the length of time (in milliseconds) that the elevator doors should stay open before automatically closing, in quick-close mode. Specify 0 to disable. The default is 3000, or 3 seconds. This must be specified after the CreateCar command.
Syntax:QuickClose doornumber = value
Example:QuickClose 1 = 10000
- NudgeTimer - the length of time (in seconds) that the doors have to remain open before the elevator car activates nudge mode for the related door. Specify 0 to disable. The default is 30 seconds. This must be specified after the CreateCar command.
Syntax:NudgeTimer doornumber = value
Example:NudgeTimer 1 = 10
- OpenSound - the sound file to play when the elevator doors open. Default is elevatoropen.wav. Leave the filename field blank for no sound. This must be specified after the CreateCar command.
Syntax:OpenSound doornumber = filename
Example:OpenSound 1 = open.wav
- CloseSound - the sound file to play when the elevator doors close. Default is elevatorclose.wav. Leave the filename field blank for no sound. This must be specified after the CreateCar command.
Syntax:CloseSound doornumber = filename
Example:CloseSound 1 = close.wav
- CarStartSound, CarUpStartSound, CarDownStartSound - the sound file to play when the elevator car starts moving/speeds up. Leave the filename field blank for no sound. By default no sound is played. The first command specifies both up and down sounds, while the others are for either upwards movement or downwards movement.
Example:CarStartSound = start.wav
- CarMoveSound, CarUpMoveSound, CarDownMoveSound - the sound file to play while the elevator car is moving. This file is automatically looped by the simulator. By default no sound is played. Leave the filename field blank for no sound. The first command specifies both up and down sounds, while the others are for either upwards movement or downwards movement.
Example:CarMoveSound = move.wav
- CarStopSound, CarUpStopSound, CarDownStopSound - the sound file to play when the elevator car slows down and stops. By default no sound is played. Leave the filename field blank for no sound. The first command specifies both up and down sounds, while the others are for either upwards movement or downwards movement.
Example:CarStopSound = stop.wav
- CarIdleSound - the sound file to play when the elevator car is idle (generally the fan sound). Default is elevidle.wav. Leave the filename field blank for no sound.
Example:CarIdleSound = idle.wav
- ChimeSound - the sound file to play when the elevator car arrives at a floor. Default is chime1.wav. This must be specified after the CreateCar command. This is used for both up and down chimes. Leave the filename field blank for no sound.
Syntax:ChimeSound doornumber = filename
Example:ChimeSound 1 = chime.wav
- UpChimeSound - the sound file to play when the elevator car arrives at a floor and it's direction is up. Default is chime1-up.wav. Leave the filename field blank for no sound. This must be specified after the CreateCar command.
Syntax:UpChimeSound doornumber = filename
Example:UpChimeSound 1 = chime.wav
- DownChimeSound - the sound file to play when the elevator car arrives at a floor and it's direction is down. Default is chime1-down.wav. Leave the filename field blank for no sound. This must be specified after the CreateCar command.
Syntax:DownChimeSound doornumber = filename
Example:DownChimeSound 1 = chime.wav
- EarlyUpChimeSound - the sound file to play during an early arrival notification of the elevator and the direction is up. Default is chime1-up.wav. Leave the filename field blank for no sound. This must be specified after the CreateCar command.
Syntax:EarlyUpChimeSound doornumber = filename
Example:EarlyUpChimeSound 1 = chime.wav
- EarlyDownChimeSound - the sound file to play during an early arrival notification of the elevator, and the direction is up. Default is chime1-down.wav. Leave the filename field blank for no sound. This must be specified after the CreateCar command.
Syntax:EarlyDownChimeSound doornumber = filename
Example:EarlyDownChimeSound 1 = chime.wav
- AlarmSound - the sound file to play when the elevator car's alarm button is pressed. Default is bell1.wav. Leave the filename field blank for no sound.
Example:AlarmSound = bell2.wav
- AlarmSoundStop - the sound file to play when the elevator car's alarm button is released. Leave the filename field blank for no sound. Default is bell1-stop.wav.
Example:AlarmSoundStop = bell2-stop.wav
- BeepSound - the sound file to play when the elevator car reaches a new floor. There is no default; if this is set, the beeps will be automatically enabled. If an asterisk (*) is specified, it is replaced with the current floor number.
Example:BeepSound = beep.wav
- FloorSound - the sound file(s) to play when the elevator car arrives at a floor; normally this is used for files that speak the floor number. There is no default; if this is set, the sounds will be automatically enabled. If an asterisk (*) is specified, it is replaced with the current floor number.
Example:FloorSound = floor*.wav
- UpMessage - the notification sound file(s) to play after the elevator car arrives at a floor and the doors open - this tells the passengers that the elevator is going up. There is no default; if this is set, the sound will be automatically enabled. If an asterisk (*) is specified, it is replaced with the current floor number.
Example:UpMessage = goingup.wav
- DownMessage - the notification sound file(s) to play after the elevator car arrives at a floor and the doors open - this tells the passengers that the elevator is going down. There is no default; if this is set, the sound will be automatically enabled. If an asterisk (*) is specified, it is replaced with the current floor number.
Example:DownMessage = goingdown.wav
- OpenMessage - the notification sound file(s) to play when the elevator doors begin opening - this tells the passengers that the doors are opening. There is no default; if this is set, the sound will be automatically enabled. If an asterisk (*) is specified, it is replaced with the current floor number.
Example:OpenMessage = doorsopening.wav
- CloseMessage - the notification sound file(s) to play when the elevator doors begin closing - this tells the passengers that the doors are closing. There is no default; if this is set, the sound will be automatically enabled. If an asterisk (*) is specified, it is replaced with the current floor number.
Example:CloseMessage = doorsclosing.wav
- MessageOnMove - if set to true, the Up/Down messages will be played when the elevator starts moving, otherwise it'll play after the doors open. The default is false.
Example:MessageOnMove = true
- Music - the sound file to play for the elevator car music in both movement directions - the sound is automatically looped. There is no default; if this is set, the sound will be automatically enabled.
Example:Music = musicfile.wav
- MusicUp - the sound file to play for the elevator car music in the up direction - the sound is automatically looped. There is no default; if this is set, the sound will be automatically enabled.
Example:MusicUp = musicfile.wav
- MusicDown - the sound file to play for the elevator car music in the down direction - the sound is automatically looped. There is no default; if this is set, the sound will be automatically enabled.
Example:MusicDown = musicfile.wav
- NudgeSound - the sound file to play while in nudge mode. Default is buzz.wav. Leave the filename field blank for no sound. This must be specified after the CreateCar command.
Syntax:NudgeSound doornumber = filename
Example:NudgeSound 1 = buzz.wav
- Doors - sets the number of doors the elevator car will have. The default is 1. Set to 0 in order to have a doorless elevator car.
Example:Doors = 2
- MusicPosition - sets the position of the music sound emitter relative of the elevator car's position. If this command is not specified, it'll be placed in the center of the elevator car on the ceiling.
Syntax:MusicPosition = x, y, z
Example:MusicPosition = 0, 8, 0
- MusicOn - Enables or disables music on start. Default is true.
Syntax:MusicOn = false
- MusicOnMove - Determines if music should only be played while the elevator is moving or not. Default is false.
Syntax:MusicOnMove = true
- DisplayFloors - sets the floors that will be displayed by the elevator car's indicators. This command uses the same syntax as the ServicedFloors command.
Syntax:DisplayFloors = 0, 9, 19, 29
- AutoEnable - Determines if interior objects should automatically be enabled or disabled when the user enters/exits the elevator car (set to false for glass elevators).
Syntax:AutoEnable = false
- DoorSensor - enable or disable the door sensor (electric eye), which is a trigger object placed in the elevator door area. Default is enabled for automatic doors. A second parameter specifies the sound file to play when switching between on and off - this is normally used for a relay switch sound effect. Only specify the first parameter for no sound. This must be specified after the CreateCar command.
Syntax:DoorSensor doornumber = enable[, filename]
Example:DoorSensor 1 = true, click.wav
To have the sensor play a continuous beep while it's on (obstructed), create a sound inside the elevator car with the AddSound command using the filename of the beep sound you want, and then create an action with the elevator car's "sensor" command name. So for elevator 1 car 1, you would create an action named "Elevator 1:Car 1:sensor", and the action would do a "playsound" command on the sound you created. - CarEmergencyStopSound - the sound file to play for the elevator car when an emergency stop is initiated. Leave the filename field blank to use the normal car stop sound, if specified. By default no sound is played.
Example:CarEmergencyStopSound = emergstop_car.wav
- IndependentService - enables independent service mode for the elevator, and makes this car the active car for the mode.
Example:IndependentService = true
- FireService2 - sets the fire service phase 2 mode that the elevator will start with, and makes this car the active car for the mode. Default is 0. Values are 0 for off, 1 for on, 2 for hold.
Syntax: FireService2 = 1
Commands
- CreateCar - creates an elevator car on the specified floor. This command is only used for creating additional cars, since the elevator's CreateElevator command creates Car 1 automatically. The Floor value must be greater than the previous car's floor.
Syntax:CreateCar floor
Example:CreateCar 1
- AddFloor - adds a textured floor with the specified dimensions for the car
Syntax:AddFloor name, texturename, thickness, x1, z1, x2, z2, voffset1, voffset2, reverse_axis, texture_direction, tw, th
Example:AddFloor Floor1, Wood2, 0.5, -3.5, -3, 3.5, 3, 0, 0, false, false, 0, 0
- AddWall - adds a textured wall for the car
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 car's AddWall command is similar to the other AddWall commands. - AddDoors - creates elevator car doors
Syntax: AddDoors number, lefttexture, righttexture, thickness, CenterX, CenterZ, width, height, direction, tw, th
The AddDoors command creates working elevator car doors at the central location specified by CenterX and CenterZ, with width and height specifying 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). Number specifies the number of the door to create (related to the Doors command) - if the car only has one door, or if the Doors command was not used, specify 1 here. - AddShaftDoors - creates elevator shaft doors
Syntax:AddShaftDoors number, lefttexture, righttexture, thickness, CenterX, CenterZ, voffset, tw, th
The AddShaftDoors command creates working elevator shaft 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 car doors need to be created first). The voffset parameter allows you to create shaft doors at a different vertical position than the base of the floor, and the elevator will automatically stop according to the shaft door's voffset for that floor. These doors should be moved slightly away from the car 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). Number specifies the number of the door to create (related to the Doors command) - if the elevator car only has one door, or if the Doors command was not used, specify 1 here. - 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 car'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. If a texture is not specified, the back portion of the panel will not be shown. - AddButton - creates a standard button on the panel
Syntax:AddButton panel_number, sound, texture_unlit, texture_lit, row, column, floor/type, width, height[, hoffset, voffset]
Example 1:AddButton 1, switch.wav, Button5, ButtonLit5, 7, 3, 4, 1, 1
Example 2:AddButton 1, , Button5, ButtonLit5, 7, 3, 4, 1, 1, 0.1, -0.1
The AddButton command creates a button on the button panel created with CreatePanel. Panel_number specifies the number of the panel to add the button to. Row and Column specify the position on the grid where the button should be. Floor/Type specifies either the floor number that this button calls, or the action name such as "Open" (see the AddControl command for more info). 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. Hoffset and Voffset are optional parameters, and are used to position the button outside the normal grid, and are in grid units (buttonwidth and buttonheight parameters of the CreatePanel function). In the second example, the button is positioned 0.1 grid units to the right, and 0.1 grid units down. Notice that no sound is specified in the 2nd example - this means that a sound won't be played. - AddControl - advanced command for creating buttons, switches and knobs on the panel
Syntax:AddControl panel_number, sound, row, column, width, height, hoffset, voffset, selection_position, command_name(s), texture_name(s)
Example 1:AddControl 1, switch.wav, 7, 3, 1, 1, 0, 0, 1, open, ButtonOpen
Example 2:AddControl 1, switch.wav, 7, 3, 1, 1, 0, 0, 1, FanOff, FanOn, SwitchFanOff, SwitchFanOn
Example 3:AddControl 1, switch.wav, 7, 3, 1, 1, 0, 0, 1, Off, 4, Button5, ButtonLit5
Example 4:AddControl 1, switch.wav, 7, 3, 1, 1, 0, 0, 1, Fire2Off, Fire2On, Fire2Hold, FireKnob1, FireKnob2, FireKnob3
The AddControl command creates an advanced control on the specified button panel (created with CreatePanel). Most of the parameters are the same as the AddButton command, but the command_name(s) and texture_name(s) parameters allow you to specify a list of commands, and a list of textures to go along with those commands. A texture needs to be specified for every command; if you specify 3 commands and only 2 textures, you will get an error. The first example shows a door open button being created, with the command "open" and the texture "ButtonOpen". The 2nd example shows a fan switch being created, with the first command being "FanOff" with the "SwitchFanOff" texture being used for that, and "FanOn" for the second command with the "SwitchFanOn" texture being used for that. Example 3 shows a standard floor button being created (which is what the AddButton command does) and example 4 shows a fire service mode knob being created with 3 positions. Leave the sound field blank for no sound to be played. The selection_position parameter specifies the starting selection position, which is normally 1.
Available command names for elevators:
Off (no action)
[floor number] (specify only the floor number to send elevator to that floor)
Open [door] (open doors)
Close [door] (close doors)
OpenInt [door] (open interior/car doors)
CloseInt [door] (close interior/car doors)
OpenExt [door] (open exterior/shaft doors)
CloseExt [door] (close exterior/shaft doors)
OpenManual [door] (open doors manually)
CloseManual [door] (close doors manually)
OpenIntManual [door] (open interior/car doors manually)
CloseIntManual [door] (close interior/car doors manually)
OpenExtManual [door] (open exterior/shaft doors manually)
CloseExtManual [door] (close exterior/shaft doors manually)
StopDoors [door] (stop doors during manual movement)
Cancel (call cancel)
Run (put elevator in run state)
Stop (put elevator in stop state)
EStop (emergency stop)
Alarm (alarm trigger)
Fire1Off (fire service phase 1 off for all elevators in same bank, which means all served by first call button on recall floor)
Fire1On (fire service phase 1 on for all elevators in same bank)
Fire1Bypass (fire service phase 1 bypass for all elevators in same bank)
Fire2Off (fire service phase 2 off)
Fire2On (fire service phase 2 on)
Fire2Hold (fire service phase 2 hold)
UpPeakOn (enable up peak)
UpPeakOff (disable up peak)
DownPeakOn (enable down peak)
DownPeakOff (disable down peak)
PeakOff (disable both peak modes)
IndOn (enable independent service mode)
IndOff (disable independent service)
InsOn (enable inspection service mode)
InsOff (disable inspection service)
AcpOn (enable ACP mode)
AcpOff (disable ACP mode)
FanOn (enable fan/idle sound)
FanOff (disable fan/idle sound)
Hold [door] (hold door and disable door sensor temporarily)
MusicOn (enable music sound)
MusicOff (disable music sound)
UpOn (inspection mode or manual elevator up on)
UpOff (inspection mode or manual elevator up off)
DownOn (inspection mode or manual elevator down on)
DownOff (inspection mode or manual elevator down off)
GoOn (inspection mode go on)
GoOff (inspection mode go off)
Return (return to nearest serviced floor after stop)
Up (move up for manual elevator, for a button held by mouse button)
Down (move down for manual elevator, for a button held by mouse button)
InterlocksOn (enable interlocks)
InterlocksOff (disable interlocks)
Sensor [door] (open and hold doors without disabling sensor, used by door sensor)
Reset [door] (reset door timer and turn on door sensor, which turns off hold)
SensorOn [door] (enable door sensor)
SensorOff [door] (disable door sensor)
SensorReset [door] (same as Reset but doesn't touch sensor setting)
Some commands in the above list have an optional Door parameter. For example, Open 2 will open door 2, while Open or Open 0 will open all doors.
When this command is used, actions are created using the specified commands. The resulting names of the actions are the elevator name, followed by a colon, then the Car name followed by another colon, and then the command name, in order to be unique to each elevator and car. So the "Open" command for Elevator 1 Car 1 is created as an action named "Elevator 1:Car 1:open", and you can specify more actions with that name to run multiple actions when the elevator car opens it's doors. - AddFloorIndicator - creates a floor indicator
Syntax:AddFloorIndicator texture_prefix, blank_texture, direction, CenterX, CenterZ, width, height, voffset
The AddFloorIndicator command creates a floor indicator at the position (relative to the elevator car) specified by CenterX and CenterZ. Direction is the direction the indicator faces, and can be either "left", "right", "front" or "back". This command can be given multiple times to create multiple indicators. Texture_prefix is the base name of the texture to load when displaying a floor ID; for example if the elevator car is on floor 3, and you specify a prefix of "Button", it'll load the "Button3" texture. Blank_texture specifies a texture to be used when the indicator is blank. - AddDirectionalIndicator - creates an internal directional indicator/lantern
Syntax:AddDirectionalIndicator ActiveDirection, Single, Vertical, BackTexture, UpTexture, UpTextureLit, DownTexture, DownTextureLit, CenterX, CenterZ, voffset, direction, BackWidth, BackHeight, ShowBack, tw, th
Example:AddDirectionalIndicator false, false, true, Metal, UpLight, UpLightOn, DownLight, DownLightOn, -3, -4.162, 6, front, 0.5, 1, true, 0, 0
This command will create a directional indicator inside the elevator car, and the positioning is relative of the elevator car's center.
ActiveDirection determines if the indicator should continuously display the active elevator direction (true), or if it should show the elevator's direction for the current call (false, default)
Single determines if a single indicator light should be created instead of two. If this is true, the unlit texture is specified in UpLight, and the DownLight value is ignored.
Vertical determines if the two lights should be vertically separated (true), or horizontally separated (false)
BackTexture is the texture of the wall plate behind the lights
UpTexture and DownTexture are the textures used for the lights themselves, and the "Lit" texures are the ones to show when the light is on. DownTexture is ignored if Single is true.
CenterX and CenterZ are the central location of the indicators
voffset is the altitude offset that the object is above each floor
direction determines the direction the indicators 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. - AddDirectionalIndicators - creates the elevator's exterior directional indicator/lanterns (similar to the CreateCallButtons command)
Syntax:AddDirectionalIndicators Relative, ActiveDirection, Single, Vertical, BackTexture, UpTexture, UpTextureLit, DownTexture, DownTextureLit, CenterX, CenterZ, voffset, direction, BackWidth, BackHeight, ShowBack, tw, th
Example:AddDirectionalIndicators true, false, false, true, Metal, UpLight, UpLightOn, DownLight, DownLightOn, -3, -4.162, 6, front, 0.5, 1, true, 0, 0
This command will create directional indicators on all floors the elevator car serves. It'll also automatically create the up and down lights depending on the floor. To create indicators on a per-floor basis, use the AddDirectionalIndicator command in the Floor section.
Relative determines if the X and Z coordinates are relative to the elevator car's origin (center) or not.
ActiveDirection determines if the indicator should continuously display the active elevator direction (true), or if it should show the elevator's direction for the current call (false, default)
Single determines if a single indicator light should be created instead of two. If this is true, the unlit texture is specified in UpLight, and the DownLight value is ignored.
Vertical determines if the two lights should be vertically separated (true), or horizontally separated (false)
BackTexture is the texture of the wall plate behind the lights
UpTexture and DownTexture are the textures used for the lights themselves, and the "Lit" textures are the ones to show when the light is on. DownTexture is ignored if Single is true.
CenterX and CenterZ are the central location of the indicators
voffset is the altitude offset that the object is above each floor
direction determines the direction the indicators 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. - SetShaftDoors - (deprecated) sets positioning and thickness of shaft doors which will be created with the older AddShaftDoor command. Please use the newer AddShaftDoor syntax instead.
Syntax:SetShaftDoors number, thickness, CenterX, CenterZ
This command must be used before calling the older AddShaftDoor command. This specifies the thickness and X/Z positioning for the shaft doors that will be created. Number specifies the door number this is associated with (use 1 if only one door). - AddFloorSigns - creates floor signs on all floors serviced by the elevator car
Syntax:AddFloorSigns door_number, relative, texture_prefix, direction, CenterX, CenterZ, width, height, voffset
The AddFloorSigns command creates floor signs (similar to floor indicators) on all the floors serviced by the current elevator car. Direction is the direction the signs face, and can be either "left", "right", "front" or "back". Texture_prefix is the base name of the texture to load when displaying a floor ID; for example if the sign is on floor 3, and you specify a prefix of "Button", it'll load the "Button3" texture. Door_number specifies the door number to check against, meaning if shaft doors don't exist on a certain floor for the specified door, the sign won't be created on that floor. This can be bypassed by setting door_number to 0. - AddSound - creates a user-defined sound at the specified position
Syntax:AddSound name, filename, x, y, z, loop[, volume, speed, min_distance, max_distance, doppler_level, cone_inside_angle, cone_outside_angle, cone_outside_volume, direction_x, direction_y, direction_z]
Example 1:AddSound MySound, sound.wav, 10, 100, 5, true
Example 2:AddSound MySound, ambient.ogg, 10, 100, 5, true, 1, 100, 1, -1, 0, 360, 360, 1, 0, 0, 0
For information on the parameters, see the AddSound command in the Global Commands section. The only difference here is that the X, Y and Z position values are relative of the elevator car's center/origin. Loop specifies if the sound should loop and play on startup. - AddDoorComponent - creates a single elevator car door component, used for creating custom door styles
Syntax:AddDoorComponent number, name, texture, sidetexture, thickness, direction, openspeed, closespeed, x1, z1, x2, z2, height, voffset, tw, th, side_tw, side_th
Example:AddDoorComponent 1, Left, ElevDoors, Black, 0.2, left, 0.3, 0.3, -1.75, 0, 0, 0, 8, 0, 0, 0, 0, 0
The AddDoorComponent command allows you to create your own custom door styles. It creates a single door component within a set - for example, the standard center-open doors have 2 door components: left and right. With this command you specify the positioning of a component similar to wall creation, specify it's textures, tell it which direction it's going to travel during opening, and what it's speed will be. Number specifies the number of the door to create (related to the Doors command) - if the elevator car only has one door, or if the Doors command was not used, specify 1 here. Texture refers to the texture used on the main (front and back) sides of the door. SideTexture refers to the texture used on the sides (and top/bottom) of the door. Direction is either Up, Down, Left (or Front; is the same), or Right (or Back; is also the same). Side_tw and side_th specify the texture tiling for the sides. Use the FinishDoors command after creating the components. The above example creates the left door component for the standard center-open doors, and uses default speed values. This command replaces the AddDoors command. - AddShaftDoorsComponent - creates a single shaft door component for all serviced floors - used for creating custom door styles
Syntax:AddShaftDoorsComponent number, name, texture, sidetexture, thickness, direction, openspeed, closespeed, x1, z1, x2, z2, height, voffset, tw, th, side_tw, side_th
This command is almost identical to the AddDoorComponent command, except that it creates shaft doors. Use the FinishShaftDoors command after creating the components. This command replaces the AddShaftDoors command. To create shaft doors on a per-floor basis, use the AddShaftDoorComponent command in the Floors section. - FinishDoors - finishes elevator car door creation - use this after all related AddDoorComponent commands are used.
Syntax:FinishDoors number[, door_walls, track_walls]
This command completes the elevator car door creation by storing the central location and shift factor, cutting walls for the door, creating side connection pieces for the cut, etc. The optional door_walls option specifies if the command should create the side door filler walls (texture used is "ConnectionWall"), and the optional track_walls option specifies if the top/bottom track connection walls should be made (texture used is "Connection"). - FinishShaftDoors - finishes shaft door creation for all serviced floors - use this after all related AddShaftDoorsComponent commands are used, or specify it without the AddShaftDoorComponent commands if you're creating a manual shaft door.
Syntax: FinishShaftDoors number[, door_walls, track_walls]
This command is almost identical to the FinishDoors command except that it's used for finishing shaft doors on all serviced floors. - AddDoor - adds a textured door in the specified location, which moves with the elevator car
Syntax:AddDoor opensound, closesound, texturename, open, thickness, direction, speed, CenterX, CenterZ, width, height, voffset, tw, th
See the AddDoor command in the floor section for information on the parameters. CenterX and CenterZ are relative of the elevator car's center. - AddModel - adds a 3D model to the elevator car. If a filename is specified, the model's textures/materials must be defined in a separate ".material" file, and a separate collider mesh ".collider.mesh" will be loaded. In that situation, if a collider mesh isn't available, a simple box collider will be created. If a filename is not specified, this command will create a new empty model, where it's name can be used as the destobject parameter in other commands (in the related Elevator or Car section), and a collider will be automatically created.
Syntax:AddModel name, filename, center, CenterX, CenterY, CenterZ, RotationX, RotationY, RotationZ, MaxRenderDistance, ScaleMultiplier, EnablePhysics, Restitution, Friction, Mass
Example 1:AddModel MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, false, 0, 0, 0
Example 2:AddModel MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, true, 0.1, 0.5, 0.1
Example 3:AddModel MyModel, , false, 0, 0, 0, 0, 0, 0, 0, 1, true, 0.1, 0.5, 0.1
The Center value is either true or false, and determines if the loaded model should be automatically centered, otherwise the exact mesh positioning in the model file will be used. The CenterY value is relative to the current elevator car's base. MaxRenderDistance determines the maximum distance in feet that the object will be shown (0 means unlimited). ScaleMultiplier allows you to change the size of the object during the load - for example, set to 2 to double the size. Models are in the OGRE native mesh format. In the example, the material/texture file is cube.material, and the optional collider mesh file is cube.collider.mesh. EnablePhysics enables Bullet physics on the object, and Restitution, Friction and Mass determine the physical properties of the object. - AddActionControl - creates a custom control that uses a specific action defined by AddAction.
Syntax:AddActionControl name, sound, direction, centerx, centerz, width, height, voffset, selection_position, action_name(s), texture_name(s)
Example:AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit
AddActionControl command creates an advanced control similar to elevator button panel controls, but assigned to an action created with the AddAction command. The action_name(s) and texture_name(s) parameters allow you to specify a list of actions, and a list of textures to go along with those actions. There needs to be a texture for every action; if you specify 3 actions and only 2 textures, you will get an error. The control starts up in the first action, and switches to the next actions in sequence when it's clicked. Direction is the direction the control itself will face in 3D space (front, left, right, back). Voffset is relative of the elevator car's base. Leave the sound field blank for no sound to be played. Selection_position is the starting selection position, which is normally 1. - AddTrigger - creates a trigger that is used to signal an action when the user's camera enters or leaves the defined area.
Syntax:AddTrigger name, sound, start_x, start_y, start_z, end_x, end_y, end_z, action_names(s)
Example:AddTrigger MyTrigger, switch.wav, -30, 0, -30, -20, 10, -20, UndoMyAction, MyAction
AddTrigger creates a trigger similar to action controls (AddActionControl) and elevator controls. The action_names(s) parameter allows you to specify a list of actions that this trigger will call when the camera enters or exits the area. The trigger starts in the first action, and will switch to each consecutive action when the users enters/leaves. The X, Y and Z parameters specify the 3D box that defines the trigger area, and are relative of the elevator car's location. Leave the sound field blank for no sound to be played. - AddKeypadIndicator - creates a keypad indicator for this car.
Syntax:AddKeypadIndicator sound, texture_prefix, blank_texture, direction, CenterX, CenterZ, width, height, voffset, timer_duration
Example:AddKeypadIndicator mechchime9.wav, Button, Black, right, 0, 0, 0.5, 0.5, 1, 5
The AddKeypadIndicator command creates a keypad indicator for the associated car. Sound is the sound played when displaying that a call has been requested and the different errors relating to the keypad, and if an asterisk is specified, the asterisk is replaced with the message shown on the screen, so "Sound*.wav" would change to "SoundRequested.wav". Texture_prefix specifies the base name of the texture used, so if "Button" is specified, the texture "ButtonRequested" would load when a call is requested. Blank_texture is the texture to use when off. CenterX and CenterZ are the center locations of the indicator. Timer_duration specifies how long the indicator message should be displayed, in seconds. The error text used is both "??" and "XX", so make sure to load textures for those (such as "Button??"). The "??" value is displayed when a floor entry is invalid, and the "XX" entry means "error". For error sounds, since the "??" characters sometimes can't be used in filenames, the simulator will expand it to "Invalid", and "XX" to "Error", so as an example the sounds will be "SoundInvalid.wav" and "SoundError.wav", if "Sound*.wav" is used for the sound parameter. - AddElevatorIDSigns - creates elevator ID signs on all floors serviced by the elevator car
Syntax:AddElevatorIDSigns door_number, relative, texture_prefix, direction, CenterX, CenterZ, width, height, voffset
The AddElevatorIDSigns command creates elevator ID signs on all the floors serviced by the current elevator car. Direction is the direction the signs face, and can be either "left", "right", "front" or "back". Texture_prefix is the base name of the texture to load when displaying an elevator ID; for example if the sign is for an elevator with an ID of A, and you specify a prefix of "Button", it'll load the "ButtonA" texture. Door_number specifies the door number to check against, meaning if shaft doors don't exist on a certain floor for the specified door, the sign won't be created on that floor. This can be bypassed by setting door_number to 0.
The Controller Section
The Controller section allows you to create dispatch controllers for your elevators. Controllers support both Destination Dispatch routes, and Standard routes. Controllers are numbered, starting with 1. When Call Buttons are created, they automatically create controllers.
The section headers and footers are similar to the ones in the Floor section.
To specify a single controller, you would type something like:
<Controller 1>
and end it with:
<EndController>
For a range of controllers, you would use something like:
<Controllers 2 to 10>
and end with:
<EndControllers>
All parameters in a controller section are optional.
Variables
%controller%
- number of the current controller
Parameters
- Name - sets the name of the controller
Example:Name = Dispatch Controller %controller%
- DestinationDispatch - enables or disables DestinationDispatch for this controller. Right now this is used only by a few elevator functions for checks, and the controller doesn't make much use of it, since it processes routes on a type basis. The default is false.
Example:DestinationDispatch = true
- Hybrid - enables hybrid mode for this controller. When true, allows elevators to both operate in Destination Dispatch and Standard modes. When this is false and DestinationDispatch is enabled, standard elevator floor selections no longer will work. The default is False.
Example:Hybrid = false
- Range - specifies the range of floors that dispatches will handle for a single elevator for Destination Dispatch mode. The default is 5.
Example:Range = 5
- MaxPassengers - the maximum number of requests for a route this controller will handle for a single elevator, before selecting another elevator for the route, in Destination Dispatch mode. The default is 5.
Example:MaxPassengers = 10
- Elevators - list of elevators to assign to the dispatch controller
Example:Elevators = 1, 2, 3, 4
Example:Elevators = 1 - 4
- Reprocess - enables or disables the reprocessing of routes if an elevator becomes unavailable. Note that this only affects DestinationDispatch mode. The default is false.
Example:Reprocess = true
The CallStation Section
The CallStation section allows you to create call stations for your elevators. This is used for both Destination Dispatch and ordinary call buttons, especially to create advanced call button panels. This must be created within a Floor section, in order to specify what floor the call station is on. Call Stations are numbered, starting with 1, this is a global number, not per-floor, even though call stations are created individually on each floor.
The section headers and footers are similar to the ones in the Floor section.
To specify a single call station, you would type something like:
<CallStation 1>
and end it with:
<EndCallStation>
For a range of call stations, you would use something like:
<CallStations 2 to 10>
and end with:
<EndCallStations>
All parameters in a CallStation section are optional.
For Actions, here's the available action command names that can be used for custom controls:
(Floor number) (select floor)
Off
FireOff (set fire service phase 1 to Off for all elevators serviced by this call station)
FireOn (set fire service phase 1 to On for all elevators serviced by this call station)
FireBypass (set fire service phase 1 to Bypass for all elevators service by this call station)
Input1 (number 1 on keypad)
Input2 (number 2 on keypad)
Input3 (number 3 on keypad)
Input4 (number 4 on keypad)
Input5 (number 5 on keypad)
Input6 (number 6 on keypad)
Input7 (number 7 on keypad)
Input8 (number 8 on keypad)
Input9 (number 9 on keypad)
Input0 (number 0 on keypad)
InputMinus (minus on keypad)
InputStar (star on keypad)
InputBackspace (extra feature with character "<")
Up (call elevator up)
Down (call elevator down)
Variables
%callstation%
- number of the current call station, on the current floor
%floor%
- the current floor
Parameters
- Name - sets the name of the call station
Example:Name = Call Station %callstation%
- Controller - used to specify the controller this call station will be assigned to.
Example:Controller = 1
- TimerDelay - specifies the key input timer delay, for keypads, in seconds. The default is 2 seconds.
Example:TimerDelay = 1
- InvalidInput - specifies keypad input values that should be treated as invalid.
Example:InvalidInput = 13, 23
Commands
- SetPosition - sets the position of this call station, relative to the floor it's on.
Syntax:SetPosition X, Y, Z
Example:SetPosition -3, 4, 0
- CreatePanel - creates a button panel
Syntax:CreatePanel texturename, rows, columns, direction, buttonwidth, buttonheight, spacingX, spacingY, tw, th
Example:CreatePanel Wall1, 5, 5, right, 0.15, 0.15, 0.3, 0.45, 0, 0
The CreatePanel command creates a button panel for the call station, similar to the elevator car section's CreatePanel command. 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. If a texture is not specified, the back portion of the panel will not be shown. - AddControl - command for creating buttons, switches and knobs on the panel
Syntax:AddControl sound, row, column, width, height, hoffset, voffset, selection_position, command_name(s), texture_name(s)
Example 1:AddControl switch.wav, 2, 2, 1, 1, 0, 0, 1, 7, Button7
The AddControl command creates a control on the specified button panel (created with CreatePanel). The command_name(s) and texture_name(s) parameters allow you to specify a list of commands, and a list of textures to go along with those commands. A texture needs to be specified for every command; if you specify 3 commands and only 2 textures, you will get an error. The example shows a Destination Dispatch floor button for floor 7. Leave the sound field blank for no sound to be played. The selection_position parameter specifies the starting selection position, which is normally 1. For more examples, see the AddControl command in the Elevator Car section.
Available command names for call stations:
[floor number] (specify only the floor number to select the floor with the Dispatch Controller)
When this command is used, actions are created using the specified commands. The resulting names of the actions are the floor name, followed by a colon, then the CallStation name followed by another colon, and then the command name, in order to be unique to each floor and callstation. So the "7" command for Floor 1 Call Station 1 is created as an action named "Floor 1:Call Station 1:7", and you can specify more actions with that name to run multiple actions when that floor is selected. - AddIndicator - creates a destination indicator for this call station
Syntax:AddIndicator sound, texture_prefix, blank_texture, direction, CenterX, CenterZ, width, height, voffset, timer_duration
Example:AddIndicator mechchime9.wav, Button, Black, right, 0, 0, 0.5, 0.5, 1, 5
The AddIndicator command creates a destination indicator for the associated call station. Sound is the sound played when displaying the elevator's ID, and if an asterisk is specified, the asterisk is replaced with the elevator's ID (in this case, "A"), so "Sound*.wav" would change to "SoundA.wav". Texture_prefix specifies the base name of the texture used, so if "Button" is specified, an elevator ID of "A" would load the texture "ButtonA". Blank_texture is the texture to use when off. CenterX and CenterZ are relative to the call station center. Timer_duration specifies how long the elevator's ID should be displayed, in seconds. The error text used is both "??" and "XX", so make sure to load textures for those (such as "Button??"). The "??" value is displayed when a floor entry is invalid, and the "XX" entry means "error". For error sounds, since the "??" characters sometimes can't be used in filenames, the simulator will expand it to "Invalid", and "XX" to "Error", so as an example the sounds will be "SoundInvalid.wav" and "SoundError.wav", if "Sound*.wav" is used for the sound parameter.
Global Commands/Functions
These commands and functions can be used anywhere in the script.
In this section, Destobject refers to the destination object to create other objects in, which can be:
- Floor (only available within a Floor section),
- Interfloor (Floor section only),
- ColumnFrame (Floor section only),
- Shaft [number] (Floor section only),
- Stairwell [number] (Floor section only),
- Elevator (Elevator section only),
- ElevatorCar (Car section only),
- External,
- Landscape,
- Buildings,
- (custom model name),
- Shaft [number]:[model name] (Floor section only), or
Stairwell [number]:[model name] (Floor section only)
When a command is used inside a Floor section, the Y values specified in these commands will be offsets (relative) of the floor's base, except for interfloor and columnframe names, which use the floor's altitude instead, and custom model names, which are relative of the model's position. A stairwell or shaft can be specified as "Shaft 1", and a custom model, such as one named "Test", can either be specified directly as "Test", or as part of a Shaft or Stairwell object, as "Shaft 1:Test".
- AddTriangleWall - adds a textured triangular wall. This is the same as AddCustomWall, but with only 3 coordinates used. If specified in a floor section, the Y values are then relative to the floor base.
Syntax: AddTriangleWalldestobject, 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
- 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. This command is not available inside sections, due to section-specific AddWall commands. - AddFloor - adds a textured floor
Syntax:AddFloor destobject, name, texturename, thickness, x1, z1, x2, z2, altitude1, altitude2, reverse_axis, texture_direction, tw, th
The command's parameters are the same as the Floor section's AddFloor command. This command is not available inside sections, due to section-specific AddFloor commands. - AddGround - adds a tile-based ground
Syntax:AddGround name, texturename, x1, z1, x2, z2, altitude, tile_x, tile_y
Example:AddGround AddGround Ground, Downtown, -158400, -158400, 158400, 158400, 0, 7920, 7920
This command is mainly for creating large ground sections, since using the AddFloor function with a large amount of texture tiling causes interference problems. The X and Z values specify the total size of the ground, and the tile_x and tile_y specify the size of each tile square to create. For example, if the ground is 10,000 feet wide, and tile_x and tile_y are both 1000, then 100 total tiles will be created; 10 wide and 10 deep. In the example above 7920 is 1/40 of the total width (316800 which is 158400 * 2), so the tile grid will be 40x40 tiles. - 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. - 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. - 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. The polygon will be two-sided if the DrawWalls command's MainNegative and MainPositive parameters are true. The RelativeY parameter is optional, and if not specified, when in a floor section, the Y values are always absolute (not relative of the a floor), for compatibility. If the RelativeY parameter is true, and in a floor section, the Y values are relative of the floor's base.
Syntax:AddCustomWall destobject, name, texturename[, RelativeY], x1, y1, z1, x2, y2, z2, x3, y3, z3, ..., tw, th
Example 1:AddCustomWall external, My Wall, Brick, 0, 0, 0, 0, 10, 0, 10, 10, 0, 15, 5, 0, 10, 0, 0, 0, 0
Example 2:AddCustomWall external, My Wall, Brick, true, 0, 0, 0, 0, 10, 0, 10, 10, 0, 15, 5, 0, 10, 0, 0, 0, 0
- AddCustomFloor - the same as AddCustomWall, but with only one vertical parameter. If specified while in a floor section, the altitude is relative to the current floor's base.
Syntax:AddCustomFloor destobject, name, texturename, x1, z1, x2, z2, x3, z3, ..., altitude, tw, th
Example:AddCustomFloor external, My Wall, Brick, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 0
- AddShaft - creates a shaft at a specified location and floor range
Syntax:AddShaft number, centerx, centerz, startfloor, endfloor
Example:AddShaft 1, 10, 10, 0, 9
The number parameter specifies the shaft number to create. 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). - 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. - 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. - 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). - 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. MainNegative is the main (that makes up the front of a wall lengthwise, or the top area of a floor) face on the negative side, MainPositive is the main face on the positive side (back of a wall, or the bottom area of a floor), 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 front face if a floor; Bottom refers to either the bottom side if a wall, or the back face if a floor. The following graphic explains the sides in detail: - SetPlanarMapping - sets the planar texture mapper's parameters.
Syntax:SetPlanarMapping Flat, FlipX, FlipY, FlipZ, Rotate
Example:SetPlanarMapping false, false, false, true, false
FlipX, FlipY and FlipZ reverse the texture mapping per axis, and Flat has it ignore depth., Skyscraper by default uses a simple planar texture mapper, which in simple terms draws the texture in a box around the object. With a basic wall, the top-left of the texture image is mapped to the top left of the wall, the top-right is mapped to the top-right of the wall, etc. If you want the top-right of the texture mapped to the top-left of the wall for example (to flip or change alignment), you'd set FlipX to false. This command is mainly used to change alignment - since the top-left of the texture is mapped to the top-left of the object, that means that textures have a left/top alignment by default. If you change FlipX to true, it'll be right-aligned. If you change FlipY to true, it'll be bottom-aligned. Rotate has it rotate the texture mapping 90 degrees counterclockwise, so instead of the texture being mapped from the top left to bottom right, if Rotate is true, it'll be mapped from the bottom left to top right. See this picture for an example:
In the above picture, I tiled a texture (a black box with yellow around it) 2.5 times on width and height. The bottom floor shows the default texture mapping (SetPlanarMapping false, false, false, false, false); you'll notice that it's aligned to the top-left. In the middle one, I set the FlipX value to true (SetPlanarMapping false, true, false, false, false). In the top one, I set the FlipY value to true (SetPlanarMapping false, false, true, false, false). - SetTextureMapping - manually sets UV texture mapping for all polygons generated after this command; ResetTextureMapping restores the values to the defaults or previous
Syntax:SetTextureMapping vertex1, u1, v1, vertex2, u2, v2, vertex3, u3, v3
Example:SetTextureMapping 0, 0, 0, 1, 1, 0, 2, 1, 1
The example shown above is the default value used by the simulator. This command maps the texture coordinates to the specified 3 vertex indices - normally a side of a wall will have 4 vertices/sets of coordinates (0 to 3), and by default the first three are used (top left, top right and bottom right respectively), with the UV coordinates representing the size percentage of the texture (with 1 being 100%, 0.5 being 50%, etc; normally this would relate to absolute texture coordinates) - so in the example, texture coordinate 0,0 (top left) is mapped at the first vertex (top left); texture coordinate 1,0 (really "width, 0") being mapped at the second vertex (top right), and texture coordinate 1,1 (really "width, height") being mapped to the bottom right. For a standard wall, the valid vertex values are from 0 to 3. If a wall or floor is created with AddCustomWall, and if it has for example 7 vertex points, the valid values for this command would then be 0 to 6 (but only 3 vertices can be used for mapping purposes). One caveat with manual texture mapping is that sometimes the simulator will automatically reverse the vertices to keep the wall faces oriented properly, so if you set your texture mapping this way and notice issues, try reversing the coordinates (u3 would be u1 for a 3-point triangular wall, etc) and see if that helps. Textures can also be cropped with this command - for example, to map only a central square of a texture, you'd use:SetTextureMapping 0, 0.25, 0.25, 1, 0.75, 0.25, 2, 0.75, 0.75
Here's an easier way to see the example above:0 -> 0, 0
The following diagram shows the mapping described above. Texture location 0,0 is mapped to wall vertex 0, location 1,0 is mapped to vertex 1, etc:
1 -> 1, 0
2 -> 1, 1 - SetTextureMapping2 - advanced version of SetTextureMapping - manually sets UV texture mapping for all polygons generated after this command; ResetTextureMapping restores the values to the defaults or previous
Syntax:SetTextureMapping2 v1x, v1y, v1z, u1, v1, v2x, v2y, v2z, u2, v2, v3x, v3y, v3z, u3, v3
Example:SetTextureMapping2 x0, y0, z0, 0, 0, x1, y1, z1, 1, 0, x2, y2, z2, 1, 1
See the above description of SetTextureMapping for a detailed description on texture mapping in general. This command mostly does the same as that command, and the example given is the default command (and is equivalent to the SetTextureMapping example). Instead of just choosing which vertex indices to use like SetTextureMapping, this command lets you create your own texture vertices (sets of coordinates) using coordinates of already-existing vertices. The vertex values that can be used start with an "x", "y" or "z", followed by the vertex index. In the example, the X, Y and Z values of the first vertex are mapped to UV coordinate 0,0 - this is because "x0, y0, z0" was specified. A specification of "x0, y2, z0" will use the X and Z values from vertex 0, but the Y value from vertex 2. This way you can specify coordinates outside of the wall/polygon's range. Here's an easier way to see the example:x0, y0, z0 -> 0, 0
x1, y1, z1 -> 1, 0
x2, y2, z2 -> 1, 1 - ResetTextureMapping - resets the texture mapping parameters to either the default or previous values
Syntax:ResetTextureMapping = default
Example:ResetTextureMapping = true
If default is true, the texture mapping values are reset to the default, which is shown above in the SetTextureMapping's example. If default is false, the previous values will be loaded and used. - ReverseAxis - this command is deprecated, and only used for older versions of the AddFloor commands, since the current ones have this option built-in. This reverses the axis that the difference in altitude/voffset for floors corresponds to. In the AddFloor command, there are parameters for specifying two different altitudes. By default, if the altitudes are different, the floor will angle upward/downward along the Z axis (front/back), but if this is set to true, the floor will angle along the X axis (left/right).
Syntax:ReverseAxis = value
- 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. - 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
- Isect - the Isect function calculates the position that a line intersects with a certain object, such as a floor. 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 (see the top of this section for more info). 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").
For an example, start up the Simple building and enter this into the console:print isect(external, front, 0, 5, -60, 0, 5, 0)
This command will do a line intersection from the camera's starting position, forward, and will print out the position that it intersects with the External mesh's "Front" wall, the one visible in front of you. - 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. - TextureOverride - overrides textures for the next command. Currently works with the different AddWall, AddFloor, AddInterFloor and CreateWallBox/CreateWallBox2 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". - ShaftShowFloors - allows a range of floors to be shown in an elevator or shaft, primarily for glass elevators.
Syntax:ShaftShowFloors ShaftNumber = range/list[, full]
Example:ShaftShowFloors 1 = 1 - 10
Example 2:ShaftShowFloors 1 = 1 - 10, true
The full parameter is optional, and if it is false or not specified (the default), only a range of floors are shown at a time (by default 3 at a time, and only the ones specified), while the elevator is moving, and is normally used in conjunction with the Group command for atriums. If full is true, all the floors in the list or range are shown at a time, while the user is in the shaft, regardless of if the elevator is moving or not, and are disabled when the user exits the shaft. In the first example above, let's say the user is in an elevator in shaft 1, and is moving upwards from the 2nd floor. In this situation, floors 1 to 10 will be displayed, either a few at a time or the whole set (depending on the Group command), but after they go beyond the range, those floors will be disabled. In the second example, when the user enters the shaft or elevator, floors 1 to 10 will all be enabled, and when they exit the elevator/shaft, those floors will be disabled. For a basic glass elevator, the second example would be used, along with the Group command to group floors 1 to 10 together. - ShaftShowInterfloors - display specific interfloors while inside a shaft. This is primarily for pipe/utility shafts.
Syntax:ShaftShowInterfloors ShaftNumber = range/list
Example:ShaftShowInterfloors 1 = 1 - 10
- ShaftShowOutside - allows objects outside the building (sky, landscape, etc) to be enabled while the user is both inside the specified shaft and on one of the specified floors - primarily for glass elevators.
Syntax:ShaftShowOutside ShaftNumber = range/list
Example:ShaftShowOutside 1 = 1 - 10
In the above example, if a user is riding an elevator in shaft 1, the outside (sky, landscape, etc) will be enabled while the elevator is on any of the floors from 1 to 10. Once the elevator reaches the 11th floor, the outside will be disabled. This command can be mixed with ShaftShowFloors for mixed atrium/external glass elevators such as the ones in the Glass Tower, where the elevator moves upwards through an indoor atrium, and eventually outside above the atrium. In that situation, the floors that comprise the lower (atrium) section would be specified using ShaftShowFloors (such as 1-10), while the upper (outdoor) floors would be specified using ShaftShowOutside (such as 11-20). - ShowFullShaft - determines if an entire shaft should always be shown, such as a glass elevator track.
Syntax:ShowFullShaft ShaftNumber = value
Example:ShowFullShaft 1 = true
- StairsShowFloors - allows a range of floors to be shown while inside the specified stairwell.
Syntax:StairsShowFloors StairwellNumber = range/list
Example:StairsShowFloors 1 = 1 - 10
In the above example, let's say the user is in stairwell 1, and is walking upwards from the 2nd floor. In this situation, the 2nd floor will be visible/enabled while they're walking up (since it was in the range specified with this command), but when they reach the 11th floor, that floor will be invisible/disabled. - ShowFullStairs - determines if an entire stairwell should be shown. If set to "true" or "inside", the full stairwell is shown only when the user is inside the stairwell. If set to "always", the full stairwell is always shown. Setting this to true is useful for stairwells that have a gap in the center between the actual stairs.
Syntax:ShowFullStairs StairwellNumber = value
Example:ShowFullStairs 1 = inside
- TextureFlip - flips specified textures for the next command.. Currently only works with the different AddWall, AddFloor and AddInterFloor commands. The values available are 0 for no flipping, 1 for horizontal flip, 2 for vertical flip, and 3 for both horizontal and vertical.
Syntax:TextureFlip MainNegative, MainPositive, SideNegative, SidePositive, Top, Bottom
Example:TextureFlip 1, 1, 0, 0, 0, 0
This command will allow you to flip textures on specific parts of a wall or floor created with a command such as AddWall. It will only work on the command immediately after this one. In the above example, the Main Positive and Main Negative sides of the object will have their textures flipped horizontally. - Cut - performs a manual box cut on an object
Syntax:Cut destobject, x1, y1, z1, x2, y2, z2, cutwalls, cutfloors
Example:Cut external, -5, -5, -5, 5, 5, 5, false, true
The x, y and z values specify the start and end coordinates of the box cut. If cutwalls is true, the function will cut walls; if cutfloors is true, it'll cut floors. - Mount - mounts a zip file in the data directory into a virtual path.
Syntax:Mount filename, path
Example:Mount myfile.zip, mydirectory
In this example, the file myfile.zip located in Skyscraper's data directory will be mounted as "mydirectory", and so a file such as test.jpg inside that zip file will appear as "mydirectory/test.jpg". - AddFloorAutoArea - defines an area that will automatically enable and disable floors when the user moves within it, similar to a stairwell
Syntax:AddFloorAutoArea x1, y1, z1, x2, y2, z2
Example:AddFloorAutoArea -100, 0, -100, 100, 100, 100
- AddSound - creates a user-defined sound at the specified position
Syntax:AddSound name, filename, x, y, z, loop[, volume, speed, min_distance, max_distance, doppler_level, cone_inside_angle, cone_outside_angle, cone_outside_volume, direction_x, direction_y, direction_z]
Example 1:AddSound MySound, sound.wav, 10, 100, 5, true
Example 2:AddSound MySound, ambient.ogg, 10, 100, 5, true, 1, 100, 1, -1, 0, 360, 360, 1, 0, 0, 0
This command creates a custom sound in the specified position, and has a number of optional parameters - the defaults for the optional parameters are shown in Example 2. Loop specifies if the sound should loop and play on startup. If you're going to use any of the optional parameters, you must specify them all. X, Y and Z specify the location in 3D space that the sound will be at, volume specifies the volume percentage (with 1.0 being 100%) of the sound, speed determines the playback speed of the sound in percent, min_distance and max_distance set the minimum and maximum distances that the sound can be heard at full volume - by default, minimum is 1 and maximum is -1. Doppler_level specifies the doppler scale for the sound (0 means off, the default, 1 is normal, 5 is max). Cone_inside_angle is the angle within which the sound is at it's normal volume (default 360), cone_outside_angle is the outside angle that the sound is at it's normal volume (default 360, shouldn't be less than the inside angle), and cone_outside_volume is the volume level of the sound outside (0.0 to 1.0, default 1.0). Direction_x, direction_y and direction_z specify the direction of the sound cone. - GetWallExtents - the GetWallExtents command returns the X and Z extents (minimum and maximum values) of a wall, at the specified altitude. The command will return the results in the MinX, MinZ, MaxX and MaxZ variables.
Syntax:GetWallExtents destobject, wallname, altitude
Example:GetWallExtents external, wall1:front, 10
Then to use the values:
Example:Set 2 = %minz%
Destobject is the destination object to get the object from (see the top of this section for more info). Wallname specifies the name of the wall to get the extents from. Generally this should be in the form of "name:side", but if you leave out the "side" parameter, it'll choose one of the sides from a pre-defined search list. Sides of walls made from any AddWall command generally have "front", "back", "left" and "right" sides. Walls made using AddCustomWall and AddTriangleWall have sides of "0" (front) and "1" (back), so with those you'd specify "name:0" for the front. Altitude specifies the altitude to use for the check - basically it makes a copy of the wall, cuts it down to a line at that altitude, and returns the coordinates of the endpoints. The command will store the results in the MinX, MinZ, MaxX and MaxZ variables, which can be used anywhere in the script - to get the minimum X result, you'd use %minx%. - AddAction - defines an action, to be used by custom controls and triggers.
Syntax:AddAction name, parent_object, command[, parameters]
Example:AddAction MyAction, Floor 2, ChangeTexture, OldTexture, NewTexture
Example:AddAction MySoundAction, Floor 2, PlaySound, Sound1, false
This command creates a global action, to be used with commands such as AddActionControl and AddTrigger. Name must be a globally-unique name. If the same name is used for multiple actions, all of those actions will be run when an object uses that name. Parent_object is the object to use to perform the action on. Currently includes "Global", floors such as "Floor 2", elevators such as "Elevator 1", elevator cars such as "Elevator 1:Car 2", shafts like "Shaft 1", stairwells like "Stairwell 2", call buttons such as "Floor 0:Call Panel 1", and can also be specified as a range of objects, such as "Floors 3 to 8".
Commands and parameters:
(General)
ChangeTexture: oldtexture, newtexture
PlaySound: name, loop true/false
StopSound: name
Teleport: X, Y, Z (destination coordinates to teleport camera to)
GotoFloor: floor_number (teleport to specified floor number
OpenShaftDoor: door number (0 for all), floor number (parent needs to be the elevator object)
CloseShaftDoor: door number (0 for all), floor number (parent needs to be the elevator object)
OpenShaftDoorManual: door number (0 for all), floor number (parent needs to be elevator object
CloseShaftDoorManual: door number (0 for all), floor number (parent needs to be elevator object)
AccessDown: floor number (parent needs to be elevator object)
AccessOff: floor number (parent needs to be elevator object)
AccessUp: floor number (parent needs to be elevator object)
(for other elevator commands, see the AddControl command in the elevator section)
Forward, Reverse, or Stop (parent needs to be an Escalator or MovingWalkway)
Enable or Disable (these are used by CameraTextures)
On and Off (these are used by Lights and Revolving Doors)
Open and Close (used by Doors)
AutoClose: interval (used by Doors)
The PlaySound command plays sounds created with the AddSound command. With this command, if multiple sounds have the same name, all of those sounds will be played simultaneously when the related action is run.
OpenShaftDoor example, to open elevator 1's shaft doors on floor 2:AddAction MyDoorOpen, Elevator 1, OpenShaftDoor, 0, 2
PlaySound example, to play sound FireAlarm created using the AddSound command on Floor 1:AddAction MySound, Floor 1, FireAlarm, true
The Access commands enable and disable Hoistway Access Mode on the elevator, which is part of Inspection Mode.
For example, when AccessUp is used by a switch on the elevator's lowest landing, and the elevator is in inspection mode with the shaft doors open, the interlock check for that shaft door is disabled, and the elevator will move upwards at leveling speed. If AccessDown is set, the elevator will move down. When AccessOff is set, the elevator will refuse to move, due to the shaft doors being open, which causes the interlock check to fail. - AddActionControl - creates a custom control that uses a specific action defined by AddAction.
Syntax:AddActionControl name, sound, direction, centerx, centerz, width, height, voffset, selection_position, action_name(s), texture_name(s)
Example:AddActionControl MyControl, switch.wav, front, -10, 10, 1.5, 1.5, 4, 1, UndoMyAction, MyAction, Touch, TouchLit
AddActionControl command creates an advanced control similar to elevator button panel controls, but assigned to an action created with the AddAction command. The action_name(s) and texture_name(s) parameters allow you to specify a list of actions, and a list of textures to go along with those actions. There needs to be a texture for every action; if you specify 3 actions and only 2 textures, you will get an error. The control starts up in the first action, and switches to the next actions in sequence when it's clicked. Direction is the direction the control itself will face in 3D space (front, left, right, back). Leave the sound field blank for no sound to be played. Selection_position is the selection position to start at, which is normally 1. - AddTrigger - creates a trigger that is used to signal an action when the user's camera enters or leaves the defined area.
Syntax:AddTrigger name, sound, start_x, start_y, start_z, end_x, end_y, end_z, action_names(s)
Example:AddTrigger MyTrigger, switch.wav, -30, 0, -30, -20, 10, -20, UndoMyAction, MyAction
AddTrigger creates a trigger similar to action controls (AddActionControl) and elevator controls. The action_names(s) parameter allows you to specify a list of actions that this trigger will call when the camera enters or exits the area. The trigger starts in the first action, and will switch to each consecutive action when the users enters/leaves. The X, Y and Z parameters specify the 3D box that defines the trigger area. Leave the sound field blank for no sound to be played. - AddModel - adds a global 3D model. If a filename is specified, the model's textures/materials must be defined in a separate ".material" file, and a separate collider mesh ".collider.mesh" will be loaded. In that situation, if a collider mesh isn't available, a simple box collider will be created. If a filename is not specified, this command will create a new empty model, where it's name can be used as the destobject parameter in other commands, and a collider will be automatically created.
Syntax: AddModelname, filename, center, CenterX, CenterY, CenterZ, RotationX, RotationY, RotationZ, MaxRenderDistance, ScaleMultiplier, EnablePhysics, Restitution, Friction, Mass
Example 1:AddModel MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, false, 0, 0, 0
Example 2:AddModel MyModel, cube.mesh, true, 0, 0, 0, 0, 0, 0, 0, 1, true, 0.1, 0.5, 0.1
Example 3:AddModel MyModel, , false, 0, 0, 0, 0, 0, 0, 0, 1, true, 0.1, 0.5, 0.1
The Center value is either true or false, and determines if the loaded model should be automatically centered, otherwise the exact mesh positioning in the model file will be used. MaxRenderDistance determines the maximum distance in feet that the object will be shown (0 means unlimited). ScaleMultiplier allows you to change the size of the object during the load - for example, set to 2 to double the size. Model files are in the OGRE native mesh format. In the example, the material/texture file is cube.material, and the optional collider mesh file is cube.collider.mesh. EnablePhysics enables Bullet physics on the object (physics will only work if you don't provide a collider mesh), and Restitution, Friction and Mass determine the physical properties of the object. - CreateWallObject - creates a custom wall object, in the specified mesh object. Wall objects are used to contain a number of polygons, to represent a wall structure, and are normally automatically created by other commands. The AddPolygon command is used with this command, to create the polygons.
Syntax:CreateWallObject destobject, name
Example:CreateWallObject landscape, mywall
- AddPolygon - this is the same as the AddCustomWall command, but adds the custom polygon to an existing (usually custom) wall object, instead of creating a new one. The example below adds the polygon to the Landscape mesh object, to the custom-created "mywall" Wall Object, which was created with the CreateWallObject command. The polygon will be two-sided if the DrawWalls command's MainNegative and MainPositive parameters are true. If created in a Floor section, the Y values will be relative to that floor's base.
Syntax:AddPolygon destobject, wallname, texturename, x1, y1, z1, x2, y2, z2, x3, y3, z3, ..., tw, th
Example:AddPolygon landscape, mywall, Brick, 0, 0, 0, 0, 10, 0, 10, 10, 0, 10, 0, 10, 0, 0
- SetKey - specifies that the next created model will be a key. The model will be tagged with a specific key ID number, and when clicked, the key ID will be added to the user's keyring and the model will be deleted. The value must be greater than 0.
Syntax:SetKey keyid
Example:SetKey 1
- SetLock - sets the lock and key parameters for subsequent doors, controls/buttons, and call buttons that are created.
Syntax:SetLock locked, keyid
Example:SetLock 1, 3
For doors, locked specifies which sides (directions) are locked. Values are:
0 - unlocked
1 - negative-facing (left/front) side locked
2 - positive-facing (right/back) side locked
3 - both sides locked
For controls/buttons and call buttons, the locked values are:
0 - unlocked
1 - locked
Locked objects can only be unlocked if the person has the key number specified as keyid. If keyid is 0, no key is needed to lock or unlock. To reset to the defaults, use 0 for the locked setting and 0 for keyid. - Print - prints the contents of a line to the console. This command will still convert variables and even math expressions, and output the results.
Syntax:Print text
Example:Print 1+1
- Delete - deletes an object. This command is normally used after a building has loaded.
Syntax:Delete object_number
Example:Delete 12
- RunAction - runs an action by name. This command is normally used after a building has loaded.
Syntax:RunAction name
Example:RunAction myaction
- AddActionParent - adds a parent object to an existing action. See the AddAction command for details on parent objects
Syntax:AddActionParent name, object
Example:AddActionParent myaction, Elevator 2
Example:AddActionParent myaction, Floors 2 to 5
- RemoveActionParent - removes a parent object from an existing action. See the AddAction command for details on parent objects. This command is normally used after a building has loaded.
Syntax:RemoveActionParent name, object
Example:RemoveActionParent myaction, Elevator 2
Example:RemoveActionParent myaction, Floors 2 to 5
- GotoFloor - jumps the user to the specified floor. This command is normally used after a building has loaded.
Syntax:GotoFloor floor
Example:GotoFloor 3
- EndPoint - the EndPoint function calculates endpoint coordinates given a starting point, direction (angle in degrees), and distance.
Syntax:endpoint(startx, starty, angle, distance)
Example:endpoint(-150, 150, 180, 20)
Result:-150, 130
- FloorInfo - show information on all floors or optionally a specified floor
Syntax:FloorInfo [number]
Example:FloorInfo 3
- ListTextures - list the loaded texture names (materials) and filenames
- ListVisibleMeshes - list the mesh objects currently visible by the camera
- ShowLoadedSounds - show the sounds currently loaded in the sound system, and the number of associated sound objects for each one
- ShowPlayingSounds - show the sounds currently playing in the sound system, with each filename followed by a listing of playing sound objects
- Teleport - warps the user to the specified location. This command is normally used after a building has loaded.
Syntax:Teleport X, Y, Z
Example:Teleport 3, 5, 10
Extended Commands/Functions
Extended commands are global commands that use a newer method of specifying objects to use. The previous Global Commands have an older method of specifying Mesh objects, these newer commands allow you to specify raw SBS objects. Some commands are broken out, so that you can specify parameters for an object with separate commands for each type of parameter. This also introduces Levels, which are the floors used in Shafts and Stairwells.
In this section, Parent refers to the destination SBS object to use as the object's parent, such as if you create a Light object named "Light1" within Floor 3, the Floor 3 object would be the parent, and the full SBS name would be "Floor 3:Light1".
Current examples:
Floor 1
Elevator 1
Elevator 1:Car 1
Shaft 1:Level 2
Stairwell 5:Level 6
DoorManager (used for creating global/external Doors)
- AddLight - adds a light, the parameters of the light can be changed later. Note that lights only work if Lighting is enabled in the INI file.
Syntax:AddLight parent, name, type
Example:AddLight Floor 0, My Light, 0
The example will create "My Light" on floor 0. Type is 0 for a point light, 1 for a directional light, and 2 for a spotlight. The related Action commands that lights use are On and Off, these can be used to create a lightswitch for example. - SetLightColor - sets the color of a light. The default is white.
Syntax:SetLightColor parent, name, ColorR, ColorG, ColorB
Example:SetLightColor Floor 0, My Light, 0.5, 0, 1
The example will set the color of "My Light" to a shade of purple. - SetLightSpecular - sets the specular color of a light. The default is black.
Syntax:SetLightSpecular parent, name, ColorR, ColorG, ColorB
Example:SetLightSpecular Floor 0, My Light, 1, 1, 1
The example will set the specular color of My Light to white. - SetLightAttenuation - sets the attenuation of the specified light. This has no effect on directional lights.
Syntax:SetLightAttenuation parent, name, range, constant, linear, quadratic
Example:SetLightAttenuation Floor 0, My Light, 100000, 1, 0, 0
The example shows the default for this. Range is the upper range of the light in world units. A constant of 1 means never attenuate, 0 means always attenuate. A linear of 1 means evenly attenuate over the distance. Quadratic adds a curvature to the attenuation formula. - SetSpotlightRange - sets the range of a spotlight. This is only applicable to spotlights (type 2).
Syntax:SetSpotlightRange parent, name, inner_angle, outer_angle, falloff
Example:SetSpotlightRange Floor 0, My Light, 30, 40, 1
The example shows the defaults. Inner_angle is the angle covered by the bright inner cone. Outer_angle is the angle covered by the outer cone. Falloff is the rate of falloff between the inner and outer cones, 1 means linear, less means slower, higher means faster. - SetLightDirection - sets the direction of a light, not applicable to point lights.
Syntax:SetLightDirection parent, name, X, Y, Z
Example:SetLightDirection Floor 0, My Light, 10, 50, 20
- MoveLight - moves a light.
Syntax:MoveLight parent, name, X, Y, Z
Example:MoveLight Floor 0, My Light, 0, 10, 0
The example will move "My Light" up 10 feet. - AddCameraTexture - creates a CameraTexture in the specified object. CameraTextures are turned off by default, but can be turned on with Actions, used in conjunction with a trigger object. See the demo building "Simple - CameraTexture".
Syntax:AddCameraTexture parent, name, quality, fov, position_x, position_y, position_z, use_rotation, rotation_x, rotation_y, rotation_z
Example:AddCameraTexture Floor 0, Camera1, 1, 71, 10, 10, 0, true, 0, 90, 0
The example will create Camera1 on Floor 0, with a default FOV. Quality can either be 1, 2, or 3, and determines the resolution of the image. If use_rotation is false, the specified rotation will be a LookAt position. A light will also move with it's parent object, such as if you put a light in an elevator, it'll move as the elevator goes up.
The related Action commands that CameraTextures use are Enable and Disable, see the Triton Center building for an example of why this is needed, the framerate drops when the cameratexture is active, so it is only enabled in a small range near the TV screen.
Name will create a texture with that name, there can only be one texture with that name in the simulator instance, so make it unique. Once the CameraTexture is created, use another command such as AddWall to create a TV screen, and use the CameraTexture's name as the wall's texture. When the CameraTexture is enabled, you'll see a live video feed on your wall. - AddSlidingDoor - creates a sliding door object, which is a door with the rotation setting turned off.
Syntax:AddSlidingDoor parent, name, open_sound, close_sound, open_state, texture, side_texture, thickness, face_direction, open_direction, open_speed, close_speed, CenterX, CenterZ, width, height, voffset, tw, th, side_tw, side_th
Example:AddSlidingDoor Floor 0, MyDoor, open.wav, close.wav, false, Door, Brick, 0.2, left, right, 10, 5, 5, 3.5, 8, 0, 1, 1
The example will create a sliding door on Floor 0. Open_state determines if the door is open on startup. Side_texture defines the texture used on the sides of the door. Face_direction is the direction the door faces, such as "left", "right", "front" or "back". Open_direction is either "up", "down", "left"/"front" or "right"/"back". - AddStdDoor - creates a standard door object, which is a door with the rotation setting turned on. This command replaces the older AddDoor and related commands.
Syntax:AddStdDoor parent, name, open_sound, close_sound, open_state, texture, side_texture, thickness, face_direction, open_direction, open_speed, close_speed, CenterX, CenterZ, width, height, voffset, tw, th, side_tw, side_th
Example:AddStdDoor Floor 0, MyDoor, open.wav, close.wav, false, Door, Brick, 0.2, left, right, 10, 10, 5, 5, 3.5, 8, 0, 1, 1, 1, 1
The example will create a standard door on Floor 0. Open_state determines if the door is open on startup. Side_texture defines the texture used on the sides of the door. Face_direction is the direction the door faces, such as "left", "right", "front" or "back". Open_direction is either "left", "right", "front" or "back". - CreateCustomDoor - starts a manually-created (custom) door. The commands CustomDoorComponent and FinishDoor need to be used after this command.
Syntax:CreateCustomDoor parent, name, open_sound, close_sound, rotate
Example:CreateCustomDoor Floor 0, My Custom Door, open.wav, close.wav, false
The example will create a sliding door "My Custom Door" on floor 0. - CustomDoorComponent - creates a door component in the specified custom door.
Syntax:CustomDoorComponent parent, name, component_name, texture, side_texture, thickness, face_direction, open_direction, OpenClockwise, OpenSpeed, CloseSpeed, x1, z1, x2, z2, height, voffset, tw, th, side_tw, side_th
Example:CustomDoorComponent Floor 0, My Custom Door, RightDoor, StairsDoor, Brick, 0.2, front, front, false, 10, 10, -5, -5, 0, -5, 8, 0, 0, 0, 0, 0
The example will create a custom door component on floor 0's door "My Custom Door" named "RightDoor". Face_direction can either be "left", "right", "front" or "back", open_direction can be "up", "down", "left"/"front", or "right"/"back". OpenClockwise is used when door rotation is on, it determines if the door opens clockwise or not. - FinishDoor - finishes a manually-created (custom) door.
Syntax:FinishDoor parent, name, open_state
Example:FinishDoor Floor 0, My Custom Door, true
The example will finish the custom door, and open it on startup. - MoveDoor - changes a door's position
Syntax:MoveDoor parent, name, X, Y, Z
Example:MoveDoor Floor 0, My Custom Door, -5, 0, 0
- SetAutoClose - enables or disables the autoclose timer on a door
Syntax:SetAutoClose parent, name, interval
Example:SetAutoClose Floor 0, My Custom Door, 5
The example will automatically close "My Custom Door" after being open for 5 seconds. Set interval to 0 to turn off the timer. - CreatePrim - creates a new primitive object and shape
Syntax:CreatePrim parent, name, type, [shape parameters...]
Example:CreatePrim Floor 0, MyPrim, Sphere, 2.0, 5.0, 5.0, 16, 16
The Type parameter determines the type of shape to create, with the shape parameters following it:
-Plane,SizeX, SizeY, SegmentsX, SegmentsY, UTile, VTile
-Sphere,Radius, UTile, VTile, Rings, Segments
-Cylinder,Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight, Capped
-Torus,Radius, SectionRadius, UTile, VTile
-Cone,Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight
-Tube,InnerRadius, OuterRadius, Height, UTile, VTile, SegmentsBase, SegmentsHeight
-Box,SizeX, SizeY, SizeZ, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ
-Capsule,Radius, Height, Rings, UTile, VTile, Segments, SegmentsHeight, Capped
-TorusKnot,Radius, SectionRadius, UTile, VTile, SegmentsCircle, SegmentsSection, P, Q
-IcoSphere,Radius, UTile, VTile, Iterations
-RoundedBox,SizeX, SizeY, SizeZ, ChamferSize, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ, Capped
-Spring,RadiusCircle, RadiusHelix, Height, Round, UTile, VTile, SegmentsCircle, SegmentsPath, Capped
-Prism,Radius, Height, Sides, SegmentsHeight, Capped
The command creates a new prim on the specified parent object, making it available for use by future commands.
The example creates a primitive named "MyPrim" on floor 0. - PrimShape - creates a new shape for the specified primitive
Syntax:PrimShape parent, name, type, [shape parameters...]
Example:PrimShape Floor 0, MyPrim, Sphere, 2.0, 5.0, 5.0, 16, 16
The Type parameter determines the type of shape to create, with the shape parameters following it:
-Plane,SizeX, SizeY, SegmentsX, SegmentsY, UTile, VTile
-Sphere,Radius, UTile, VTile, Rings, Segments
-Cylinder,Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight
-Torus,Radius, SectionRadius, UTile, VTile
-Cone,Radius, Height, UTile, VTile, SegmentsBase, SegmentsHeight
-Tube,InnerRadius, OuterRadius, Height, UTile, VTile, SegmentsBase, SegmentsHeight
-Box,SizeX, SizeY, SizeZ, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ
-Capsule,Radius, Height, Rings, UTile, VTile, Segments, SegmentsHeight, Capped
-TorusKnot,Radius, SectionRadius, UTile, VTile, SegmentsCircle, SegmentsSection, P, Q
-IcoSphere,Radius, UTile, VTile, Iterations
-RoundedBox,SizeX, SizeY, SizeZ, ChamferSize, UTile, VTile, SegmentsX, SegmentsY, SegmentsZ, Capped
-Spring,RadiusCircle, RadiusHelix, Height, Round, UTile, VTile, SegmentsCircle, SegmentsPath, Capped
-Prism,Radius, Height, Sides, SegmentsHeight, Capped
The example creates a sphere shape on the prim "MyPrim", on floor 0. - PrimAttach - attaches the specified primitive to the parent object
Syntax:PrimAttach parent, name, X, Y, Z, rotation_x, rotation_y, rotation_z
Example:PrimAttach Floor 0, MyPrim, 0, 5, 0, 0, 0, 0
The example places the prim at the center of floor 0, at a height of 5 feet. - PrimTexture - assigns a texture to a primitive
Syntax:PrimTexture parent, name, texture
Example:PrimTexture Floor 0, MyPrim, Default
The example assigns the system texture "Default" to the prim MyPrim. - PrimVisible - determines if a primitive should always be visible or not.
Syntax:PrimVisible parent, name, value
Example:PrimVisible Floor 0, MyPrim, true
The example makes the prim "MyPrim" always visible. - CreateObject - creates a custom object. The command FinishObject needs to be used after this command.
Syntax:CreateObject parent, name, X, Y, Z, RotationX, RotationY, RotationZ, max_render_distance, scale_multiplier
Example:CreateObject Floor 0, My Custom Object, 0, 0, 0, 0, 0, 0, 100, 1
The example will create a custom object "My Custom Object" on floor 0, at the center of the building. - FinishObject - finishes a custom object. This needs to be run after the CreateObject command, and after working on the object such as adding walls.
Syntax:FinishObject parent, name[, restitution, friction, mass]
Example:FinishObject Floor 0, My Custom Object
Example 2:FinishObject Floor 0, My Custom Object, 1, 1, 1
The first example will finish the custom object "My Custom Object" on floor 0, and set it to non-physical. The second example is the same but enables physics on the object. - ObjectWall - adds a wall to the specified custom object. This needs to be run after the CreateObject command.
Syntax:ObjectWall parent, name, texture, thickness, x1, z1, x2, z2, height1, height2, altitude1, altitude2, tw, th
Example: ObjectWallFloor 0, My Custom Object, Brick, 0, -10, 0, 10, 0, 10, 10, 0, 0, 1, 1
The example will create a wall on custom object "My Custom Object" on floor 0. - ObjectFloor - adds a floor to the specified custom object. This needs to be run after the CreateObject command.
Syntax:ObjectFloor parent, name, texture, thickness, x1, z1, x2, z2, altitude1, altitude2, reverse_axis, texture_direction, tw, th
Example:ObjectFloor Floor 0, My Custom Object, Brick, 0, -10, -10, 10, 10, 0, 0, false, false, 1, 1
The example will create a floor on custom object "My Custom Object" on floor 0. - ObjectWallBox - adds a wall box to the specified custom object. This needs to be run after the CreateObject command.
Syntax:ObjectWallBox parent, name, texture, x1, x2, z1, z2, height, voffset, tw, th, inside, outside, top, bottom, autosize
Example:ObjectWallBox Floor 0, My Custom Object, Brick, -10, 10, -10, 10, 10, 0, 1, 1, true, true, true, true, true
The example will create a box on custom object "My Custom Object" on floor 0. - ObjectWallBox2 - adds a centered wall box to the specified custom object. This needs to be run after the CreateObject command.
Syntax:ObjectWallBox parent, name, texture, CenterX, CenterZ, WidthX, WidthZ, height, voffset, tw, th, inside, outside, top, bottom, autosize
Example:ObjectWallBox Floor 0, My Custom Object, Brick, 0, 0, 10, 10, 10, 0, 1, 1, true, true, true, true, true
The example will create a centered box on custom object "My Custom Object" on floor 0. - ObjectVisible - determines if the object should always be visible or not.
Syntax:ObjectVisible parent, name, value
Example:ObjectVisible Floor 0, My Custom Object, true
- EnablePhysics - an experimental feature that enables physics on SBS mesh objects
Syntax:EnablePhysics parent, meshname, value, restitution, friction, mass
Example:EnablePhysics Floor 0, Level 0, true, 0.1, 0.5, 0.1
The example turns physics on for Floor 0's mesh, which is a pretty crazy effect. - END command
The End command tells the software to stop processing the current script and start the simulation. This is optional.
Example:<end>
- BREAK command
The Break command triggers a break section in the script processor, and is used when running a debug build of the simulator, with a debugger attached. A 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>
Predefined Functions
There are a number of script functions provided by the simulator. Currently there's only a single script for elevator doors - see the Simple building (noted at the bottom of this page) for an example. These functions can be used by putting this line in your script:
<Include data/scripts/elevator_doors.txt>
You'll then be able to use some predefined door functions:
- elevdoor_single - creates a single-slide elevator door.
Syntax:elevdoor_single(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, movement_direction, speed, is_shaft_door)
Door_Direction is either "left", "right", "front" or "back" and is the direction the doors face (torwards the outside of the elevator). Movement_direction is the direction the door should move. - elevdoor_center - creates a center-open elevator door.
Syntax:elevdoor_center(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door)
- elevdoor_center_classic - creates a center-open elevator door with a partially open interior door.
Syntax:elevdoor_center_classic(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door)
- elevdoor_dualspeed_left - creates a dual-speed door that opens to the left
Syntax:elevdoor_dualspeed_left(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door)
- elevdoor_dualspeed_right - creates a dual-speed door that opens to the right
Syntax:elevdoor_dualspeed_right(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door)
- elevdoor_center_dualspeed - creates a dual-speed center-open door
Syntax:elevdoor_center_dualspeed(door_number, texture, side_texture, thickness, CenterX, CenterZ, width, height, door_direction, speed, is_shaft_door)
The Buildings Section
The Buildings section allows you to load additional buildings, into separate simulation engines, and have them all be visible and usable in the same scene. This section is small, and mainly exists to provide clarity in scripts. Additional buildings also have their own script interpreters, so their scripts (and things such as includes) are completely isolated from each other. Note that this section is skipped when reloading the building (Ctrl-R). This section should be placed at the beginning of the script file, so that the progress bar during load can be accurate. When the script is finished loading, the primary building (the one included in the main script) will be automatically cut for each child building (using the section's Cut parameters), making it easy to integrate new buildings into existing spaces with large landscapes, or even city blocks. Nesting of this section is also supported, so that if a child building also has a buildings section, it'll process it, and the parent building will be cut for each child building.
The section starts with this header:
<Buildings>
and ends with this footer:
<EndBuildings>
Parameters
All of the parameters below are optional.
- ConcurrentLoads - if this is set to true, load all buildings simultaneously. Default is false, which loads each building in order.
Example:ConcurrentLoads = true
- CutLandscape - if this is set to true, cut the Landscape mesh of buildings, discarding the area outside of the building's set boundaries. Default is true
CutLandscape = true
- CutBuildings - if this is set to true, cut the Buildings mesh of buildings, discarding the area outside of the building's set boundaries. Default is true
CutBuildings = true
- CutExternal - if this is set to true, cut the External mesh of buildings, discarding the area outside of the building's set boundaries. Default is false, since this may have an unnecessary performance impact
CutExternal = true
- CutFloors - if this is set to true, cut the Floors meshes of buildings, discarding the area outside of the building's set boundaries. Default is false, since this may have an unnecessary performance impact
CutFloors = true
Commands
- Load - load a building, creating a new Engine Context (script interpreter and sim engine pair) for it. This command requires a building filename to be specified, and optionally allows the position to be set (which overrides the Position value in that building's Globals section), the rotation (Y axis, which is left/right) in degrees to be set, and the bounds values to be set (which also overrides the building's Bounds value). For the rotation value, if "90" is specified, the building is rotated so that it faces the right. If the value is "270" or "-90", the building faces the left. The Bounds values are used to determine the position limits of what are considered that building, where if a building has a position X value of 200, and the MinX is -100 and MaxX is 100, the global positions of 100X to 300X are "inside" that building's space (200 - 100, and 200 + 100). Subfolders are supported, so a filename of "myfolder/mybuilding.bld" will load the building file at "buildings/myfolder/mybuilding.bld".
Syntax:Load filename[, X, Y, Z, Rotation][, MinX, MinY, MinZ, MaxX, MaxY, MaxZ]
- Example 1:
Load Simple.bld
- Example 2:
Load Simple.bld, 200, 0, 200, 0
- Example 3:
Load Simple.bld, 200, 0, 200, 0, -100, 0, -100, 100, 0, 100
- Example 4:
Load myfolder/mybuilding.bld
- Example 1:
The Vehicles Section
The Vehicles section allows you to create vehicles for your building. Vehicles are numbered, starting with 1.
The section headers and footers are similar to the ones in the Floor section.
To specify a single vehicle, you would type something like:<Vehicle 1>
and end it with:<EndVehicle>
For a range of vehicles, you would use something like:<Vehicles 2 to 10>
and end with:<EndVehicles>
Variables
%vehicle%
- number of the current vehicle
Parameters
- Name - sets the name of the vehicle.
Example:Name = Car
- MaxEngineForce - sets the maximum engine force. Default is 3000
- SteeringIncrement - sets the steering increment. Default is 0.04
- SteeringClamp - sets the steering clamp, which is the maximum steering value. Default is 0.8.
- WheelFriction - sets the wheel friction value. Default is 1e30
- SuspensionStiffness - sets the suspension stiffness value. Default is 20
- SuspensionDamping - sets the suspension damping value. Default is 2.3
- SuspensionCompression - sets the suspension compression. Default is 4.4
- RollInfluence - sets the roll influence value. Default is 0.1
- SuspensionRestLength - sets the suspension rest length. Default is 0.6
- MaxSuspensionTravelCm - sets the maximum suspension travel. Default is 500
- FrictionSlip - sets the friction slip value. Default is 10.5
- ChassisShift - sets the vehicle's chassis offset, in X, Y and Z values.
ChassisShift = 0, 1, 0
- ChassisMesh - defines the mesh file to use for the chassis
ChassisMesh = ogrebullet/models/chassis.mesh
- WheelMesh - defines the mesh file to use for the wheels
ChassisMesh = ogrebullet/models/wheel.mesh
- ChassisScale - sets the scaling factor for the chassis mesh
ChassisScale = 4
- WheelScale - sets the scaling factor for the wheel mesh
WheelScale = 4
Commands
- CreateVehicle - creates the vehicle at the specified location. Use this command after the CreateChassis and AddWheel commands.
Syntax:CreateVehicle X, Y, Z
Example:CreateVehicle -50, 0, 0
- CreateChassis - creates the vehicle's cahssis. The parameters are physics options that are used when creating the rigid body
Syntax:CreateChassis restitution, friction, mass, linear_dampening, angular_dampening
Example:CreateChassis 0.6, 0.6, 800, 0.2, 0.2
- AddWheel - adds a wheel to this vehicle. If engine is true, the wheel is powered by the engine. If steerable is true, the wheel is controlled by the steering wheel. The ConnectionPoint values specify the point at which to connect the wheel to the chassis. The Direction and Axle values are optional, and the defaults for those are "0, 01, 0" for the Direction, and "-1, 0, 0" for the Axle.
Syntax:AddWheel engine, steerable, IsFrontWheel, radius, ConnectionPointX, ConnectionPointY, ConnectionPointZ[, DirectionX, DirectionY, DirectionZ, AxleX, AxleY, AxleZ]
Example:AddWheel true, true, true, 0.3, -1, 0, 0
Example Building
There is an example of a small simplistic building in the code. Check out the Simple building code in the Skyscraper buildings directory. It's also available online here.