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)
SBS (creates a global object, available with some commands)
a. 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.
b. 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.
c. 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.
d. 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.
e. 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.
f. 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
g. 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.
h. 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.
i. 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".
j. 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".
k. 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
l. 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
Syntax: FinishDoor parent,
name, open_state
Example: FinishDoor Floor 0, My Custom
Door, true
Syntax: MoveDoor parent,
name, X, Y, Z
Example: MoveDoor Floor 0, My Custom
Door, -5, 0, 0
Syntax: SetAutoClose parent,
name, interval
Example: SetAutoClose Floor 0, My Custom
Door, 5
Syntax: CreatePrim parent, name, type,
[shape parameters...]
Example: CreatePrim Floor 0, MyPrim, Sphere, 2.0, 5.0,
5.0, 16, 16
Syntax: PrimCollider parent, name, value
Example: PrimCollider Floor 0, MyPrim, -1
The example turns off the collider flag for
the prim, so that when the PrimAttach command is run, a
collider is not created. The values are currently 0
for standard collider, and -1 for no collider.
Syntax: PrimAttach parent, name, X, Y, Z,
rotation_x, rotation_y, rotation_z
Syntax2: PrimAttach parent, name, X, Y, Z, rotation_x,
rotation_y, rotation_z, max_render_distance,
scale_multiplier, enable_physics, restitution,
friction, mass
Example: PrimAttach Floor 0, MyPrim, 0, 5, 0, 0,
0, 0
Example2: PrimAttach Floor 0, MyPrim, 0, 5, 0, 0,
0, 0, 0, 1, true, 0.1, 0.5, 0.1
Syntax: PrimTexture parent, name, texture
Example: PrimTexture Floor 0, MyPrim, Default
Syntax: PrimVisible parent, name, value
Example: PrimVisible Floor 0, MyPrim,
true
u. 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
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
Syntax: ObjectWall parent,
name, texture, thickness, x1, z1, x2, z2, height1,
height2, altitude1, altitude2, tw, th
Example: ObjectWall Floor 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.
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.
y. 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.
z. 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.
aa. ObjectVisible - determines if the object should always be visible or not. Syntax: ObjectVisible parent,
name, value
Example: ObjectVisible Floor 0, My Custom
Object, true
Syntax: EnablePhysics parent,
meshname, value, restitution, friction, mass
Example: EnablePhysics Floor 0, Level 0, true, 0.1, 0.5,
0.1
Syntax: Rotate object, X, Y, Z, speed
Example: Rotate Floor 0:MyPrim, 0, 1, 0, 1
Syntax: Move object, X, Y, Z, speed
Example: Move Floor 0:MyPrim, 0, 1, 0, 1
Syntax: SetPosition object, X, Y, Z
Example: SetPosition Floor 0:MyPrim, 5, 0, 0
Syntax: SetPositionY object, value
Example: SetPositionY Floor 0:MyPrim, 5
Syntax: SetPositionRelative object, X,
Y, Z
Example: SetPositionRelative Floor 0:MyPrim, 5, 0, 0
Syntax: SetCameraZoom parent_name,
cameratexture_name, zoom
Example 1: SetCameraZoom Floor 0, MyCamera, 2
Example 2: SetCameraZoom
MapGenerator, MapCamera, 1.5