Entitiesfunc_
func_areaportal
 
Description
 
Solid class. Vis blocking entity. This is a non-visible object that divides the world into areas that are separated when this portal is not activated. Usually enclosed in the middle of a door.Can be targeted by a door entity or refered to by a script for opening and closing as needed. See the scripting docs for more details.
 
Keys
 
targetname:
either a door entity points to this or can be refered to by the script for control.
target:
will trigger the entity that this points to each time the portal is either opened or closed.

Spawnflags
 
None


Notes

These portals are more flexible than Quake 2's areaportals since they can be controlled from the script. They can be opened and closed in a very straightforward way using 2 simple commands:

$<areaportal_name> open
$<areaportal_name> close

If they are targeted by a door entity, they will function automatically (the same way as Quake 2 areaportals): they will open before the door is opened and close after the door is closed.


func_beam
 
Description
 
Beam effect used for a wide range of laser beam, particle spray, electrical bolt, bullet trail, etc. type effects. The beam effect goes from its own origin to the target's origin. Beams can use an info_notnul or a moving object (such as func_scriptobject) as an aiming target and will respond to script move* and rotate* type commands.
 
Keys
 
alpha:
translucency of the beam. Values are from 0.0 to 1.0 (Default: 1.0 - 100% opaque).
target:
if an entity is targeted by this, it will be used as an aiming point for the beam.
targetname:
name used for script control or activating trigger points to this.
life:
number of seconds to keep the beam on. Beam will deactivate itself after this period of time. If not set, beam will stay on indefinitely.
damage:
amount of damage to inflict when beam hits players, actors and destructible world models (default 0). When "model" is set, the beam can also damage a func_box.
color:
weighted RGB value of beam color (default 1 1 1). Only works if "model" or "beamstyle" are NOT set.
diameter:
set the thickness of the beam in map units (default 4). Only works if "model" is NOT set.
beamstyle:
used to set a predefined style for the beam. Only works if "model" is NOT set. Possible styles as defined in global/global0.scr are:
    120 :gunsmoke
    121 :blood
    122 :sparks
    123 :orangeglow
    124 :blueyellow
    125 :debris trail
    126 :weird bubblegum
    127 :blood2
    128 :oil
    129 :water spray
    130 :blue - yellow - blue
    131 :blue fade
model:
specifies the model to use as the beam (.def file). Any model can be used for this but the ones more likely to produce good results are:
    beam.def :           blue-white beam
    beam2.def :         blue-white beam (2nd type)
    goo.def :             green slime blobs - looks good with ELECTRIC effect.
    lightning.def :       lightning bolt - ideal for ELECTRIC effect.
    ln.def :                lightning bolt (2nd type) - ideal for ELECTRIC effect.
    muzflash1.def :    muzzle flash - can simulate machinegun bullet trails.
    muzflash2.def :    muzzle flash (2nd type) - also good for bullet trails.
    pfxbegin.def :      lightning bolt (3rd type) - ideal for ELECTRIC effect.
    pfxtile.def :          lightning bolt (4th type) - ideal for ELECTRIC effect.
overlap:
specifies the amount of overlap each beam link should have. Use this to fill in the cracks when using electric on beams or gaps in straight beams when small models are used (default 0). Only works if "model" is set.
minoffset:
amount of electrical variation at the endpoints of the beam when it is drawn with the ELECTRIC effect (default 5). Only works if "model" is set.
maxoffset:
amount of electrical variation in the middle of the beam when it is drawn with the ELECTRIC effect (default 25). Only works if "model" is set.

Spawnflags
 
1
START_ON
starts the beam on.
2
ANIMATE
play the animation of the model (model must be set).
4
FAST
play the animation of the model at 20 frames/sec (model must be set).
8
ROLL
rolls the beam (model must be set).
16
RANDSTART
start each segment of the beam's animation on a different frame (model must be set).
32
ELECTRIC
applies an electrical effect to the beam (model must be set).
64
RANDALPHA
sets the alpha (translucency) of the beam randomly each frame (model must be set).

Notes

On top of responding to script move* and rotate* type commands, func_beam's can be bound to scriptobjects and scriptmodels. They also have a set of dedicated script commands to control their appearance while in the game.

To turn the beam on or off, use the following commands:

$beam activate
$beam deactivate


To modify a non-model beam's characteristics, use the following commands:

$beam diameter <value>
$beam color <"r g b">
$beam beamstyle <style_number>


To modify a model based beam's characteristics (when ELECTRIC is set), use the following commands:

$beam minoffset <value>
$beam maxoffset <value>


To modify any kind of beam's translucency, use the following command:

$beam alpha <value>


func_box
 
Description
 
Solid class. Explodable box that falls when boxes below it are destroyed. These can be made to spawn goodies like weapons, ammo and powerups when destroyed.
 
Keys
 
items:
list of items to spawn when the box is destroyed. Those must referred to by the name of the .def file that contains their entity definition and the names must be separated by spaces (Eg. "adren.def rlaunch.def" for Adrenaline and Rocket Launcher). Default is nothing.
angles:
orientation of the box when it falls to the floor after another box below this one is destroyed. This also sets the angles of the item that is spawned. Will not work if the box is set to spawn more than one item (default 0 0 0).
health:
amount of damage to inflict to the box before it's destroyed (default is 60).
target:
point to the entities to trigger when box is destroyed.
alpha:
sets the translucency of the entity (default 1.0).

Spawnflags
 
None


Notes


func_breakawaywall
 
Description
 
Solid entity. Special wall that removes itself when triggered. Will also trigger any func_areaportals that it targets.
 
Keys
 
targetname:
used for triggering by trigger or script.
target:
this points to the areaportal to open before wall is removed.
key: name of item required to activate this (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
thread:
name of thread to call when activated. This can be in a different script file as well by using the '::' notation.
alpha:
sets the translucency of the entity (default 1.0). Warning: don't set this if the wall targets an areaportal.

Spawnflags
 
4
NOT_PLAYERS
the activating trigger will not respond to players.
8
MONSTERS
the activating trigger will respond to monsters.
16
PROJECTILES
the activating trigger will respond to projectiles (rockets, grenades, mines).

Notes


func_camera
 
Description
 
Solid class. Cameras used for cinematic sequences. These can be made to follow paths or objects and their speed of displacement is controllable. Several cameras can be used in the same level and cued at will from one to the other. All this can be done through script control though a set of simple commands. Also, all the key values for cameras can be set or modified at any time through their equivalent script commands. Please refer to the SinScript camera commands for more details.
 
Keys
 
angles:
pitch, yaw, roll method of 3D orientation (default 0 0 0). Use to set where camera will point initially.
targetname:
name refered to by script for control.
target:
points to the target to orbit or follow. If it points to a splinepath node, the camera will follow the path.
distance:
the distance to follow or orbit if the target is not a path (default 128).
speed:
specifies how fast to move on the path or orbit (default 1).
fov:
specifies fov of camera (default 90).
yaw:
specifies yaw of camera (default 0).
height:
specifies height of camera from origin of entity while orbiting around it (default 128).
panspeed:
speed at which to pan (default 7 degrees per second).
panmax:
maximum angle offset for panning (default 45 degrees).
nextcamera:
points to the targetname of the next camera in a chain of cameras. While looking though a camera. the use key switches to the next camera.
overlay:
overlay file to use while looking through the camera. This is the name of the file in the 'base/layout' folder of the PAK file which contains the layout commands that produce the desired camera view overlay (file extension is omitted).
thread:
name of thread that will be called when the camera is looked through. This can be in a different script file as well by using the '::' notation.

Spawnflags
 
1
ORBIT
tells the camera to create a circular path around the object it points to. If the camera points to a path, it will loop when it reaches the end of the path.
2
START_ON
causes the camera to start moving as soon as it is spawned.
4
PAN
camera will pan from right to left.

Notes

Two func_camera's are used in the intro_start cinematic sequence. The script for this map (intro_start.scr) provides an excellent example of what can be done with those: cueing (switching) between cameras, path following while looking at another entity (when it keeps pointing at Blade in the elevator while orbiting around him), entity following (when it follows Blade while he's running in the corridor towards the door to the helipad) and speed control.


func_clipbox
 
Description
 
Point class. Invisible bounding box used like a clip brush. This is mainly used for blocking off areas or improving clipping without having to recompile the map. Because of this, it will most likely only be spawned via script.
 
Keys
 
mins:
minimum point of the clip.
maxs:
maximum point of the clip.
type:
type of clip:
    0 :monster and player clip
    1 :monster clip
    2 :player clip

Spawnflags
 
None

Notes


func_door
 
Description
 
Solid class. Common sliding door. By default, doors must be used to open. Doors that touch are automatically teamed and operate as a single unit. Only doors of the same type that touch can be teamed.
 
Keys
 
angle:
determines the opening direction (default 0).
targetname:
if this is set, the door can be operated by an activating trigger or script commands but also retains its default use mode or proximity (if AUTO_OPEN is set) mode of operation.
target:
point this to the func_areaportal within the door.
time:
time in seconds the door will take to open or close.
speed:
move speed (100 default - overrides time).
wait:
wait before returning (3 default, -1 = never return).
lip:
lip remaining at end of move (8 default).
dmg:
damage to inflict to player when he blocks the door (0 default).
message:
text string to print on the screen every time the door is operated.
noise:
sound to play when "message" is printed. The "message" key must be set for sound to be heard (default none). Does the same thing as the "sound_message" key.
key: name of item required to open door (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
sound_stop:
path/name of wav file to play when door stops.
sound_move:
path/name of wav file to play when door is moving.
sound_message:
path/name of wav file to play when door displays a message.
sound_locked:
path/name of wav file to play when door is locked.
alpha:
sets the translucency of the entity (default 1.0). Warning: don't set this if the door targets an areaportal.

Spawnflags
 
4
DOOR_DONT_LINK
is for when you have two doors that are touching but you want them to operate independently. This prevents them from being automatically teamed*.
8
NOT_PLAYERS
players cannot open this door.
16
NOT_MONSTERS
monsters cannot open this door.
32
TOGGLE
causes the door to wait in both the open and closed states for a trigger event.
64
AUTO_OPEN
proximity mode, door will open when a player is near it instead of waiting for the player to use it.
128
TARGETED
use mode and proximity mode are disabled and door can only be operated by triggers or script commands ("targetname" must be set).

Notes

*Note: if two doors touch, they are assumed to be teamed and operate as a unit. If you want touching doors to operate independently from one another, you have to set the DOOR_DONT_LINK spawnflag on the team master which is the first door among those to spawn in the map. Unfortunately, determining which door is the team master is complicated at best. So to make sure they will operate independently, just set the DOOR_DONT_LINK spawnflag on all the doors that touch one another.

There are a number of useful SinScript commands specific to doors that you can use to control them with.

Doors can be locked and unlocked by using the following commands:

$door1 lock
$door1 unlock


Doors can be opened and closed by using the following commands:

$door1 open <entity>
$door1 close


Please note that the optional <entity> argument following the "open" command is the targetname or entity sequence number of the entity that operates the door. This is required mainly for rotating doors so the door knows which way to open. For sliding doors, including the argument makes no difference other than avoiding an error message to be printed on the screen (provided developer mode is set to 1).

Although the targetname or sequence number of any entity (except the door itself) can be used, the most common one to use as the command argument is the player which is always has the entity sequence no. 1 in single player maps. Thus, the above command line's syntax would be:

$door1 open *1

For doors which have the TOGGLE spawnflag set, you can open or close the door with the command:

$door1 toggledoor <entity>

Here the optional <entity> argument follows the same principle as the "open" command and thus, the most common usage would be:

$door1 toggledoor *1

A door's opening and closing time can be modified with the command:

$door1 time <value>


func_earthquake
 
Description
 
Point class. Causes a localized earthquake when triggered.
 
Keys
 
targetname:
used for triggering or script control.
duration:
the duration of the earthquake. Default is 0.8 seconds.

Spawnflags
 
None

Notes

To activate the earthquake from a script, use the following command:

trigger $quake

To deactivate the earthquake, use the following command:

$quake earthquake_deactivate


func_exploder
 
Description
 
Point class. Spawns an sprite based explosion effect when triggered. This can also trigger targets and call threads.
 
Keys
 
targetname:
name used by trigger or script to activate this.
dmg:
specifies how much damage to cause (Default is 120).
scale:
specifies the scale of the explosion to make (default 1.0).
volume:
loudness of explosion sound. Values range from 0 - 4 (default 1.0).
attenuation:
attenuation of explosion sound (default normal).
delay:
delay before explosion (default 0).
wait:
amount of time before explosion, once activated, responds to activation again (.2 default). This is useful only if "cnt" is set to a value other than 1.
target:
points to entities to trigger when explosion occurs.
killtarget:
any entities this points to will be removed when explosion occurs.
cnt:
how many times explosion can be triggered before removing itself (default: infinite).
message:
text string to print on the screen every time the explosion is triggered.
noise:
sound to play when "message" is printed. The "message" key must be set for sound to be heard (default none).
key: name of item required to activate this (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
thread:
name of thread to call when activated. This can be in a different script file as well by using the '::' notation.

Spawnflags
 
8
BIG_EXPLOSION
uses a bigger model based effect with smoke and particles instead.

Notes


func_explodingwall
 
Description
 
Solid class. Wall that falls down with an explosion effect when triggered or damaged. Can be made to fall in any position + angle and shatter after it falls. This can also trigger targets and call threads.
 
Keys
 
targetname:
used for triggering or script control.
health:
amount of damage that must be inflicted to the wall before it breaks (default 60).
explosions:
the number of explosion effects that accompany the breaking of the wall (default 1).
scale:
specifies the scale of the explosion to make (default 1.0).
land_angles:
the angles you want this piece to orient to when it lands on the ground (default 0 0 0).
land_radius:
the distance the piece should be off the ground once it has fallen (default 0).
anglespeed:
speed at which pieces rotate when wall breaks (default 100). If RANDOMANGLES is set, default is 600.
target:
point to the entities to trigger when wall explodes.
killtarget:
any entities this points to will be removed when wall explodes.
message:
text string to print on the screen when wall explodes.
noise:
sound to play when "message" is printed. The "message" key must be set for sound to be heard (default none).
key: name of item required to activate this (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
thread:
name of thread to call when activated. This can be in a different script file as well by using the '::' notation.
alpha:
sets the translucency of the entity (default 1.0).

Spawnflags
 
1
RANDOMANGLES
object randomly spins while in the air.
2
LANDSHATTER
object shatters when it hits the ground (overrides TWOSTAGE).
4
NOT_PLAYERS
activating trigger will not respond to events caused by players.
8
MONSTERS
activating trigger will respond to events caused by monsters.
16
PROJECTILES
activating trigger will respond to events caused by projectiles (rockets, grenades, mines).
32
INVISIBLE
entity brush is invisible and not solid until triggered.
64
ACCUMULATIVE
damage is accumulative instead of threshold based.
128
TWOSTAGE
wall will have a second breaking stage when it lands where it can be destroyed again (it tesselates the second time).

Notes


func_glass
 
Description
 
Solid class. Use this to make breakable glass objects. Shatters when enough damage has been inflicted or when activated by trigger or script. This can also trigger targets and call threads.
 
Keys
 
targetname:
name used by trigger or script to activate this.
health:
specifies how much damage must occur before the glass shatters (default 20). The default noise is based on this value. If less or equal to 60, a small glass breaking sound is played. If more than 60, a large glass breaking sound is played.
percentage:
specifies how much of the total volume of the brush to produce fragments from (default 50 percent).
minsize:
minimum size of fragments, default based on brush size.
maxsize:
maximum size of fragments, default based on brush size.
thickness:
thickness of fragments, default based on brush size.
noise:
sound to play when shattered (overrides default based on health).
target:
point to the entities to trigger when glass shatters.
killtarget:
any entities this points to will be removed when glass shatters.
message:
text string to print on the screen when glass shatters.
key: name of item required to activate this (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
thread:
name of thread to call when activated. This can be in a different script file as well by using the '::' notation.
alpha:
sets the translucency of the entity (default 1.0).

Spawnflags
 
4
NOT_PLAYERS
activating trigger does not respond to events caused by players.
8
NOT_MONSTERS
activating trigger does not respond to events caused by monsters.
16
NOT_PROJECTILES
activating trigger does not respond to events caused by projectiles.
64
THRESHOLD
damage is threshold based instead of accumulative

Notes

Threshold based damage is different from cumulative in that the damage has to be inflicted all in one shot in order for the entity to shatter. This can be useful if you want the glass to resist to low damage attacks like fists and bullets but still want it to shatter when shot at with a rocket, grenade or some other high damage projectile.

The "percentage", "minsize", "maxsize" and "thickness" values of this entity can be modified in the course of the game by using the following script commands:

$glass shatter_percentage <value>
$glass shatter_minsize <value>
$glass shatter_maxsize <value>
$glass shatter_thickness <value>


func_illusionary
 
Description
 
Solid class. Entity's brush will be visible but not solid and lets you walk through it. If "targetname" is set, this can be removed during the game by having a trigger's "killtarget" key point to it or by using the 'remove' script command.
 
Keys
 
targetname:
name used by trigger or script to remove this.
alpha:
sets the translucency of the entity (default 1.0).

Spawnflags
 
None


Notes


func_launcher
 
Description
 
Solid class. Variable size entity that launches projectiles when triggered. Using "shotrocket" as projectile type will make this launch guided rockets that veer and seek the player.
 
Keys
 
targetname:
used for triggering or script control.
target:
point this to an info_notnull entity to use as aiming point (required).
projectile:
sets the projectile type to launch. Possible types are:
    spear : speargun harpoons
    mine : spider mines
    rocket : normal rocket launcher projectiles
    shotrocket : guided rockets
    drunkmissile : gray & red rocket
launchsound:
sets the launching sound (path/name of .wav file). This is independent from the projectile which makes its own sound.
alpha:
sets the translucency of the entity (default 1.0).

Spawnflags
 
None


Notes

There is a number of specialized SinScript commands to control the func_launcher during the course of the game.

To modify the direction (pitch, yaw and roll angles respectively) in which the projectiles will be launched, use the following script commands:

$launcher setXdir <pitch_angle>
$launcher setYdir <yaw_angle>
$launcher setZdir <roll_angle>


You can modify the angle variance of the launcher's aiming direction. The angle variance is a ±value added to the direction value. This is used to implement a controlled degree of innacuracy to the launching angle of the projectiles. For this, use the following commands:

$launcher setXvar <pitch_angle_variance>
$launcher setYvar <yaw_angle_variance>
$launcher setZvar <roll_angle_variance>


To launch a projectile, use the command:

$launcher launch


func_multi_exploder
 
Description
 
Solid class. Spawns multiple sprite based explosion effects when triggered and then removes itself. The explosions are confined to the volume occupied by the brush so the position and size of brush determine where and how close to one another the explosions occur. This can trigger targets and call threads.
 
Keys
 
targetname:
name used by trigger or script to activate this.
dmg:
specifies how much damage to cause from each explosion (default 120).
scale:
specifies the scale of the explosions to make (default 1.0).
volume:
loudness of explosion sound. Values range from 0 - 4 (default 0.5).
attenuation:
attenuation of explosion sound (default normal).
delay:
delay before beginning of explosions (default 0).
wait:
time between each explosion (default 0.25 seconds).
duration:
how long explosions will last (default 1 second).
random:
random factor. Only applies if either the RANDOM_TIME or RANDOM_SCALE spawnflag are set or both (default 0.25).
target:
point to the entities to trigger when explosion occurs.
killtarget:
any entities this points to will be removed when explosions occurs.
message:
text string to print on the screen when the explosions are triggered.
noise:
sound to play when "message" is printed. The "message" key must be set for sound to be heard (default none).
key: name of item required to activate this (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
thread:
name of thread to call when activated. This can be in a different script file as well by using the '::' notation.

Spawnflags
 
2 RANDOM_TIME adjusts the wait between each explosion by the random factor.
4 RANDOM_SCALE adjusts the size of each explosion by the random factor.
8 BIG_EXPLOSION uses a bigger model based effect with smoke and particles instead.

Notes


func_remove
 
Description
 
Solid class. This entity removes itself as soon as it spawns in the game. Can used for area lighting by brush faces. The brush is removed but the light it emits stays.
 
Keys
 
None

Spawnflags
 
None

Notes


func_respawn
 
Description
 
Point class. This will spawn a model when triggered. When the thing that is spawned is killed, the func_respawn will get re-triggered and spawn the model again. It can spawn any model but it's really meant for spawning monsters.
 
Keys
 
targetname:
name used by trigger or script to activate this.
angle:
direction model will be facing when spawned.
modelname:
name of the .def file you wish to spawn. The file extension is required (ex: thug_ass.def).
attackmode:
attacking mode of the spawned monster. Possible modes are:
    0 :normal - will go for player and use duck and cover pathnodes (default).
    1 :stand ground - won't move from its spawn spot (except melee monsters).
    2 :blitzkrieg - will go for player but won't use duck and cover pathnodes.

Spawnflags
 
None


Notes


func_rotatingdoor
 
Description
 
Solid class. Rotating door. By default, doors must be used to open. Doors that touch are automatically teamed and operate as a single unit. Only doors of the same type that touch can be teamed.
 
Keys
 
angle:
determines the opening direction. The angle should point towards the "handle side" of the door (away from the hinge). This ensures that the door always opens away from the player.
openangle:
the angle the door will rotate when operated. Positive values make the door open away from the player and negative values make the door open toward the player (default 90 degrees).
origin:
optional alternative to the use of an origin brush as the center of rotation of the entity. Set this to the XYZ coordinate you want the entity to use as it's center of rotation.
targetname:
if this is set, the door can be operated by an activating trigger or script commands but also retains its default use mode or proximity (if AUTO_OPEN is set) mode of operation.
target:
point this to the func_areaportal within the door.
time:
time in seconds the door will take to open or close (0.3 default).
wait:
wait before returning (3 default, -1 = never return).
dmg:
damage to inflict to player when he blocks the door (0 default).
message:
text string to print on the screen every time the door is operated.
noise:
sound to play when "message" is printed. The "message" key must be set for sound to be heard (default none). Does the same thing as the "sound_message" key.
key: name of item required to open door (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
sound_stop:
path/name of wav file to play when door stops.
sound_move:
path/name of wav file to play when door is moving.
sound_message:
path/name of wav file to play when door displays a message.
sound_locked:
path/name of wav file to play when door is locked.
alpha:
sets the translucency of the entity (default 1.0). Warning: don't set this if the door targets an areaportal.

Spawnflags
 
4
DOOR_DONT_LINK
is for when you have two doors that are touching but you want them to operate independently. This prevents them from being automatically teamed*.
8
NOT_PLAYERS
players cannot open this door.
16
NOT_MONSTERS
monsters cannot open this door.
32
TOGGLE
causes the door to wait in both the open and closed states for a trigger event.
64
AUTO_OPEN
proximity mode, door will open when a player is near it instead of waiting for the player to use it.
128
TARGETED
use mode and proximity mode are disabled and door can only be operated by triggers or script commands ("targetname" must be set).

Notes

*Note: if two doors touch, they are assumed to be teamed and operate as a unit. If you want touching doors to operate independently from one another, you have to set the DOOR_DONT_LINK spawnflag on the team master which is the first door among those to spawn in the map. Unfortunately, determining which door is the team master is complicated at best. So to make sure they will operate independently, just set the DOOR_DONT_LINK spawnflag on all the doors that touch one another.

There are a number of useful SinScript commands specific to doors that you can use to control them with.

Doors can be locked and unlocked by using the following commands:

$door1 lock
$door1 unlock


Doors can be opened and closed by using the following commands:

$door1 open <entity>
$door1 close


Please note that the optional <entity> argument following the "open" command is the targetname or entity sequence number of the entity that operates the door. This is required mainly for rotating doors so the door knows which way to open. For sliding doors, including the argument makes no difference other than avoiding an error message to be printed on the screen (provided developer mode is set to 1).

Although the targetname or sequence number of any entity (except the door itself) can be used, the most common one to use as the command argument is the player which is always has the entity sequence no. 1 in single player maps. Thus, the above command line's syntax would be:

$door1 open *1

For doors which have the TOGGLE spawnflag set, you can open or close the door with the command:

$door1 toggledoor <entity>

Here the optional <entity> argument follows the same principle as the "open" command and thus, the most common usage would be:

$door1 toggledoor *1

A door's opening and closing time can be modified with the command:

$door1 time <value>


func_scriptdoor
 
Description
 
Solid class. Script door. Opening and closing movement/rotation must be done with script threads. By default, doors must be used to open. Doors that touch are automatically teamed and operate as a single unit. Only doors of the same type that touch can be teamed.
 
Keys
 
angle:
determines the opening direction. The angle should point towards the "handle side" of the door (away from the hinge). This ensures that the door always opens away from the player.
origin:
optional alternative to the use of an origin brush as the center of rotation of the entity. Set this to the XYZ coordinate you want the entity to use as it's center of rotation.
targetname:
if this is set, the door can be operated by an activating trigger or script commands but also retains its default use mode or proximity (if AUTO_OPEN is set) mode of operation.
target:
point this to the func_areaportal within the door.
time:
time in seconds the door will take to open or close.
wait:
wait before returning (3 default, -1 = never return).
dmg:
damage to inflict to player when he blocks the door (0 default).
message:
text string to print on the screen every time the door is operated.
noise:
sound to play when "message" is printed. The "message" key must be set for sound to be heard (default none). Does the same thing as the "sound_message" key.
key: name of item required to open door (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
initthread:
name of the door initialization thread in the script. Gets called when the door is spawned. This thread is optional.
openthread:
name of the door opening thread in the script. This thread must be defined in the script and contain the door opening commands.
closethread:
name of the door closing thread in the script. This thread must be defined in the script and contain the door closing commands.
sound_stop:
path/name of wav file to play when door stops.
sound_move:
path/name of wav file to play when door is moving.
sound_message:
path/name of wav file to play when door displays a message.
sound_locked:
path/name of wav file to play when door is locked.
alpha:
sets the translucency of the entity (default 1.0). Warning: don't set this if the door targets an areaportal.

Spawnflags
 
4
DOOR_DONT_LINK
is for when you have two doors that are touching but you want them to operate independently. This prevents them from being automatically teamed*.
8
NOT_PLAYERS
players cannot open this door.
16
NOT_MONSTERS
monsters cannot open this door.
32
TOGGLE
causes the door to wait in both the start and end states for a trigger event.
64
AUTO_OPEN
causes the door to open when a player is near instead of waiting for the player to use the door.
128
TARGETED
door is only operational from triggers or script.

Notes

*Note: if two doors touch, they are assumed to be teamed and operate as a unit. If you want touching doors to operate independently from one another, you have to set the DOOR_DONT_LINK spawnflag on the team master which is the first door among those to spawn in the map. Unfortunately, determining which door is the team master is complicated at best. So to make sure they will operate independently, just set the DOOR_DONT_LINK spawnflag on all the doors that touch one another.

The func_scriptdoor entity is like a normal door except that it absolutely requires opening and closing script threads which contain the movement and/or rotation commands that tell it what to do when an open or close event occurs. This is accomplished through the use of the 3 additional keys: 'initthread', 'openthread' and 'closethread'. The initthread is optional and is not absolutely essential. It can be used to initialize a door's position and various other parameters. The openthread and closethread keys must be set and the threads they point to must exist in the script. A set of local variables are automatically defined when the door is spawned and a few others are defined when the openthread and closethread threads are called.

Defined at all times:

local.targetname:
local.startorigin:
local.startangles:
local.movedir:

local.doorsize:


the value of the targetname key (string variable).
the initial position of the door when spawned (vector variable).
the initial orientation of the door when spawned (vector variable).
a vector which is the direction of the door as it was setup in the editor (number variable).
the "width" of the door along the movedir vector. This is used for sliding doors (number variable).


Defined when the openthread is called:

local.self:

local.origin:
local.opendot:



the owner of the initthread, openthread and closethread threads (the scriptdoor itself - string variable).
the current position of the door (vector variable).
the dotproduct of the delta between the opener and the door (forms the first vector) and the value of local.movedir (the second vector). Used to determine which way to open the door. If the result of the product is negative, the door will rotate clockwise and if the result is positive, the door will rotate counter-clockwise (number variable).


The openthread must have a 'local.self dooropened' command at the end to generate the required event which tells the game that the door is fully opened.

Defined when the closethread is called:

local.self:

local.origin:



the owner of the closethread thread (the scriptdoor itself - string variable).
the current position of the door (vector variable).


The closethread must have a 'local.self doorclosed' command at the end to generate the required event which tells the game that the door is fully closed.

Info courtesy of Mark Dochterman and Charlie Wiederhold, Ritual Entertainment.
Clarifications by Zied of 2015.

There are a number of useful SinScript commands specific to doors that you can use to control them with.

Doors can be locked and unlocked by using the following commands:

$door1 lock
$door1 unlock


Doors can be opened and closed by using the following commands:

$door1 open <entity>
$door1 close


Please note that the optional <entity> argument following the "open" command is the targetname or entity sequence number of the entity that operates the door. This is required mainly for rotating doors so the door knows which way to open. For sliding doors, including the argument makes no difference other than avoiding an error message to be printed on the screen (provided developer mode is set to 1).

Although the targetname or sequence number of any entity (except the door itself) can be used, the most common one to use as the command argument is the player which is always has the entity sequence no. 1 in single player maps. Thus, the above command line's syntax would be:

$door1 open *1

For doors which have the TOGGLE spawnflag set, you can open or close the door with the command:

$door1 toggledoor <entity>

Here the optional <entity> argument follows the same principle as the "open" command and thus, the most common usage would be:

$door1 toggledoor *1


func_scriptmodel
 
Description
 
Script slave entity. A model that must be controlled by script commands. Any game model defined by a .def file can be used for this. Refer to the scripting docs to learn more on the use these extremely powerful and flexible entities.
 
Keys
 
targetname:
name used by script to control model.
model:
name of model's .def file (required). Determines which game model to assign to this entity.
anim:
default "Idle" animation alias name of model. Points to a .sam animation file in the model's .def file. See Notes below.
scale:
controls size of model in the game (ex: 1.0).
angle:
initial orientation of model (default 0).
angles:
pitch, yaw and roll orientation of model (overrides angle - default 0 0 0).
skin:
name of skin to use for model (when applicable).
key: item needed to use model (default nothing). This is useful if you have a script thread in which there is an 'onuse' event monitoring command for this model. This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
alpha:
sets the translucency of the model (default 1.0).

Spawnflags
 
1
NOT_SOLID
model will be visible but not solid.

Notes

The anim key cannot be used directly to change the model's initial animation in the game. A script with animation commands (anim, nextanim, animate, etc.) must be used for this.

However, changing the value of the anim key in SinEd by using the + and - buttons in the entity dialog and using the "Toggle animations" feature (CTRL-A) can be useful for browsing the model's different animations directly in the 3D view. This information can then be used to set the animation commands in the script to the desired animations.


func_scriptobject
 
Description
 
Solid class. Script slave entity. Object made from one or several brushes completely dependent on script commands for its movement and rotation. Use for any type of moving mechanism other than doors. Refer to the scripting docs to learn how to use these extremely powerful and flexible entities.
 
Keys
 
angle:
this sets the reference pointing angle for the moveForward, moveBackward, moveLeft, moveRight, moveUp and moveDown script commands (default 0).
targetname:
name used by script to control object.
origin:
optional alternative to the use of an origin brush as the center of rotation of the entity. Set this to the XYZ coordinate you want the entity to use as it's center of rotation.*
key: item needed to use object (default nothing). This is useful if you have a script thread in which there is an 'onuse' event monitoring command for this object. This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
alpha:
sets the translucency of the entity (default 1.0).

Spawnflags
 
1
NOT_SOLID
object will be visible but not solid.

Notes

*By default, the implied center of rotation of an object in Sin is its physical center. This physical center is the point that's in the middle of the width, length and height of the object. So IOW, if you want to make an object rotate symmetrically along its physical center, you don't have to set a value for the 'origin' key or use an origin brush.

This is worth mentionning since it contrasts from Quake 2's rotating entities for which setting a value for the 'origin' key or using an origin brush for an object to rotate along its own physical center was absolutely required (since the default origin of rotation for rotating entities in Quake 2 is the world origin - XYZ: 0 0 0).

This entity along with the scripting language enables you to create an infinite variety of mechanisms and give them a virtually unlimited degree of sophistication and intricacy. No other 3D game even comes close to this in terms of power and flexibility when it comes to moving/rotating brush based entities.


func_scriptorigin
 
Description
 
Point class. Used as an alternate origin for objects. Bind the object to the func_scriptorigin in order to simulate changing that object's origin.
 
Keys
 
targetname:
name referred to by the script for control.

Spawnflags
 
None

Notes

This can be used as a positional origin for func_scriptmodel's and func_scriptobject's when you need to have an alternate XYZ origin in replacement to its default origin in the case of scriptmodels or its physical center in the case of scriptobjects.

Also, this can be used to control the hierarchy or inter-dependency of func_scriptobjects or func_scriptmodels when they are bound to one another and must move or rotate as a whole while retaining the ability to individually move or rotate its individual bound parts.

An example of this is the helicopter model used in the intro_start cinematic. The rotor model (lamprey_rotors.def) is bound to a func_scriptorigin and this in turn is bound to the body of the helicopter (lamprey.def). This makes it possible to make the rotor turn at any chosen speed using the func_scriptorigin's location as the center of rotation. Thus, the helicopter's rotor can rotate or tilt independently from the fuselage. But, if you apply a rotational or linear movement to the helicopter body, the rotor will follow the fuselage's movements and keep on rotating around it's own axis. This powerful entity provides a way to keep all the individual models together and move or rotate the entire "assembly" simply by moving or rotating the master or parent model (the helicopter fuselage in this case) while retaining independent control on all of its separate components (the rotor and machine gun turret in this case).

The actual script commands in intro_start.scr are:

$rotor bind $rotororigin

the rotor now has a new origin and will be refered to by its origin from now on.

$rotororigin bind $heli

the rotor (new origin) is now a child of the helicopter body.

$heligun bind $heligun_origin

the machine gun now has a new origin and will be refered to by its origin from now on.

$heligun_origin bind $heli

the machine gun (new origin) is now a child of the helicopter body.

Move the helicopter body around ($heli) and all the child components will follow. But you can still make the machine gun turret and/or the rotor rotate or tilt independently from the rest of the helicopter "assembly". The only thing to watch out for is to set the components' hierarchy properly in the syntax as it would not be a good idea to make the helicopter's body a child component of the rotor for example. :)

Please refer to the SinScript command reference for more details on the bind command and object rotation/translation commands. Also, there is a downloadable helicopter example map in the Files section which demonstrates the use of binding scriptmodels to scriptorigins to improve the realism of a model's rotation.


click for full size image in pop-up window func_securitycamera
 
Description
 
Camera used for security, monitoring in hazardous environments, etc. This is functionally identical to the func_camera except it has a visible model. Like the func_camera, all the key values for these can be set or modified at any time through their equivalent script commands. Please refer to the SinScript camera commands for more details.
 
Keys
 
model:
name of entity's model definition file (camera.def). Do not change.
scale:
scale of camera model (default set by .def file).
angles:
pitch, yaw and roll orientation of camera model and direction it which it will look when spawned (default 0 0 0).
targetname:
point a trigger_camerause or the previous camera's "nextcamera" key (to create a chain of cameras) to this. This can also be used by a script to control the camera.
target:
points to the target to orbit or follow. If it points to a path, the camera will follow the path.
distance:
the distance to follow or orbit if the target is not a path (default 128).
speed:
specifies how fast to move on the path or orbit (default 1).
fov:
specifies fov of camera (default 90).
yaw:
specifies yaw of camera (default 0).
height:
specifies height of camera from origin of entity while orbiting around it (default 128).
panspeed:
speed at which to pan (default 7 degrees per second).
panmax:
maximum angle offset for panning (default 45 degrees).
nextcamera:
points to the targetname of the next camera in a chain of cameras. While looking though a camera. the use key switches to the next camera.
overlay:
overlay file to use while looking through the camera. This is the name of the file in the 'base/layout' folder of the PAK file which contains the layout commands that produce the desired camera view overlay (file extension is omitted).
thread:
name of thread that will be called when the camera is looked through. This can be in a different script file as well by using the '::' notation.
alpha:
sets the translucency of the camera model (default 1.0).

Spawnflags
 
1
ORBIT
tells the camera to create a circular path around the object it points to. If the camera points to a path, it will loop when it reaches the end of the path.
2
START_ON
causes the camera to start moving as soon as it is spawned.
4
PAN
camera will pan from right to left.

Notes


func_shatter
 
Description
 
Solid class. Use this to make breakable objects other than glass. Shatters when enough damage has been inflicted or when activated by a trigger or script. This can trigger a targeted func_areaportal when not invisible and can also trigger regular targets and call threads.
 
Keys
 
targetname:
name used by trigger or script to activate this.
health:
specifies how much damage must occur before object shatters (default 20).
percentage:
specifies how much of the total volume of the brush to produce fragments from (default 50 percent).
minsize:
minimum size of fragments, default based on brush size.
maxsize:
maximum size of fragments, default based on brush size.
thickness:
thickness of fragments, default based on brush size.
noise:
sound to play when shattered (default none).
target:
point this to the areaportal to open or to the entities to trigger when object shatters.
killtarget:
any entities this points to will be removed when object shatters.
message:
text string to print on the screen when object shatters.
key: name of item required to activate this (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
    ChemBioSuit : use chemsuit instead
    cookies : works but doesn't generate an icon
    genericpulsepart : works but doesn't generate an icon
thread:
name of thread to call when activated. This can be in a different script file as well by using the '::' notation.
alpha:
sets the translucency of the entity (default 1.0). Warning: don't set this if the object targets an areaportal.

Spawnflags
 
4
NOT_PLAYERS
activating trigger does not respond to events caused by players.
8
NOT_MONSTERS
activating trigger does not respond to events caused by monsters.
16
NOT_PROJECTILES
activating trigger does not respond to events caused by projectiles.
64
THRESHOLD
damage is threshold based instead of accumulative.

Notes

Threshold based damage is different from cumulative in that the damage has to be inflicted all in one shot in order for the entity to shatter. This can be useful if you want the object to resist to low damage attacks like fists and bullets but still want it to shatter when shot at with a rocket, grenade or some other high damage projectile.

The "percentage", "minsize", "maxsize" and "thickness" values of this entity can be modified in the course of the game by using the following script commands:

$glass shatter_percentage <value>
$glass shatter_minsize <value>
$glass shatter_maxsize <value>
$glass shatter_thickness <value>


func_spawn
 
Description
 
Point class. This will spawn a model when triggered. It can spawn any model but it's mainly used for spawning monsters.
 
Keys
 
targetname:
name used by trigger or script to activate this.
angle:
direction model will be facing when spawned.
modelname:
name of the .def file you wish to spawn. The file extension is required (ex: thug_ass.def).
spawntargetname:
targetname of the model after it has spawned in the game. This can be used by the script for control of the spawned model (default none).
attackmode:
attacking mode of the spawned monster. Possible modes are:
    0 :normal - will go for player and use duck and cover pathnodes (default).
    1 :stand ground - won't move from its spawn spot (except melee monsters).
    2 :blitzkrieg - will go for player but won't use duck and cover pathnodes.

Spawnflags
 
None

Notes


func_spawnchain
 
Description
 
Point class. This will try to spawn a model when triggered but will succeed only if there is no direct line of sight between itself and any players. If it fails, it will trigger its targets.
 
Keys
 
targetname:
name used by trigger or script to activate this.
angle:
direction model will be facing when spawned.
modelname:
name of the .def file you wish to spawn. The file extension is required (ex: thug_ass.def).
spawntargetname:
targetname of the model after it has spawned in the game. This can be used by the script for control of the spawned model (default none).
target:
this points to the entity to trigger if there are no players within sight of the func_spawnchain entity.

Spawnflags
 
None

Notes


func_spawnoutofsight
 
Description
 
Point class. This will try to spawn a model when triggered but will succeed only if there is no direct line of sight between itself and any players.
 
Keys
 
targetname:
name used by trigger or script to activate this.
angle:
direction model will be facing when spawned.
modelname:
name of the .def file you wish to spawn. The file extension is required (ex: thug_ass.def).
spawntargetname:
targetname of the model after it has spawned in the game. This can be used by the script for control of the spawned model (default none).

Spawnflags
 
None

Notes

This is basically the same thing as the func_spawnchain but without the ability to trigger any targets when it fails to spawn its model.


func_throwobject
 
Description
 
Point class. This is a model actors can pickup and throw at players or other actors. Just set the model key like you would for a func_scriptmodel to set the type of object.
 
Keys
 
targetname:
name used by script to control model.
model:
name of model's .def file (required). Determines which game model to assign to this entity.
anim:
default "Idle" animation alias name of model. Points to a .sam animation file in the model's .def file. See Notes below.
scale:
controls size of model in the game (ex: 1.0).
angle:
initial orientation of model (default 0).
angles:
pitch, yaw and roll orientation of model (overrides angle - default 0 0 0).
skin:
name of skin to use for model (when applicable).
alpha:
sets the translucency of the model (default 1.0).

Spawnflags
 
1 NOT SOLID
2 NOT DAMAGEABLE

Notes

The anim key cannot be used directly to change the model's initial animation in the game. A script with animation commands (anim, nextanim, animate, etc.) must be used for this.

However, changing the value of the anim key in SinEd by using the + and - buttons in the entity dialog and using the "Toggle animations" feature (CTRL-A) can be useful for browsing the model's different animations directly in the 3D view. This information can then be used to set the animation commands in the script to the desired animations.

There are a few script commands you can use to make actors pick up, drop and throw func_throwobjects. To make the actors pick up the object, use the command:

$throwobject pickup $actorname <actor_bone_name>

The object will be picked up by the actor and attach itself to the specified bone name of the actor. The object will remain attached to the actor until he dies or you make him drop the object by using a detach command:

$throwobject detach

After you make the actor pick up the object, you can make him throw it at any entity in the map by using the command:

$throwobject throw $throwobject <velocity> <$entity_to_throw_at> <gravity>

This will make the object be thrown from its present location towards the specified entity at the given velocity. The gravity value (0 for no gravity, 1 for normal gravity) sets the gravity pull on the object while being thrown. Once the object hits something or falls on the floor, it will break (even if the NOT DAMAGEABLE spawnflag was set on the entity).


func_volumetric
 
Description
 
Solid class. Use this to make non-solid volumes for fog effects, wide sunbeams and light beams, etc. Set up the brush's surface properties with the "add-blend" flag. Since this is a scriptslave entity, it will respond to bind, move and rotate script commands.
 
Keys
 
targetname:
name used by script to control entity.
origin:
optional alternative to the use of an origin brush as the center of rotation of the entity. Set this to the XYZ coordinate you want the entity to use as it's center of rotation.

Spawnflags
 
None

Notes


func_wall
 
Description
 
Solid class. This is just a solid wall. If "targetname" is set, this can be removed during the game by having a trigger's "killtarget" key point to it or by using the 'remove' script command.
 
Keys
 
targetname:
name used by trigger or script to remove this.
alpha:
sets the translucency of the entity (default 1.0).

Spawnflags
 
None

Notes