Entity commands
 
These are the basic entity commands. They are in principle, applicable to all the SiN entities (gameX86 source code reference: entity.cpp). In practical terms, some of these are applicable to all the entities, some apply to a certain range or type of entities.

I tried to include as much information as possible as to what commands apply or don't apply to which type of entities, but some trial and error is likely to be necessary since it's simply impossible to test all the possible combinations.

Entity commands are colored in red in my custom SinScript syntax coloring wordfile for UltraEdit32.


alpha  
 
Function
 
This sets the translucency of any visible entity in the game. Values are from 0.0 to 1.0: 0 is completely translucent (thus invisible) and 1 is not translucent at all (default).

Syntax
 
$<entity_name> alpha <value>

Notes & examples
 

ambientsound
 
Function
 
Makes an entity play a .wav file in the game. Used for ambient sounds.

Syntax
 
$<entity_name> ambientsound "<path>/<soundname>.wav"

Notes & examples
 
Ambient sounds loop, play at full volume and use static attenuation (3) by default. The parameters available for normal sounds (volume, channel, attenuation, pitch, timeofs, fadetime and flags) cannot be used with ambient sounds.

To stop sounds started with this command, use the stopambientsound command.


angles  
 
Function
 
This sets the 3D orientation of an entity in the game. Works for all model based entities and some solid based entities such as func_scriptobjects.

Syntax
 
$<entity_name> angles "<pitch yaw roll>"

Notes & examples
 

anim
 
Function
 
Selects and plays an animation sequence of a model based entity. The animation will loop continuously until a nextanim or stopanim command is used for that entity.

Syntax
 
$<entity_name> anim <animation_name>

Notes & examples
 
Animation names for model entities can take 2 forms: animation alias names and specific .sam file animation names. The choice of possible animations of a model entity is defined by a list in that entity's .def file. Here is an example from tech_freeport.def (Neutral_Technician_Freeport):

idle1   idle_watch.sam
run1    run1.sam
walk1   walk.sam
        |
        |
      etc.


In the preceding example, since all the .sam animation files for the entity's model are defined by aliases in the .def file, they must be refered by that name in the anim and all other animation related commands. Now here is another example from pigeon.def (Animals_Pigeon):

idle.sam
pigeon_fly.sam
pigeon_takeoff.sam
pigeon_peck.sam
        |
        |
      etc.


In the preceding example, since all the .sam animation files for the entity's model are listed directly by their .def file names and that no animation alias names are defined, the name of the .sam file must be used in the command (file extension is omitted).

Also, in the case of actors with pre-defined AI states such as Neutral_Technician_Freeport, the anim command will make the animation play once after which the actor will revert to the animation assigned to his current AI state. In order to gain complete control over the actor's animations, it's AI responses must be modified with the ignore and respondto commands. This can also be done by using the animate command to place the actor in animation control mode. In this mode, the anim command will make the actor's animation loop continuously instead of just once.


animate
 
Function
 
Animates a model based entity. This is used after a nextanim command to start playing the model's animation or it can be used to restart an animation previously stoppped with the stopanim command.

Syntax
 
$<entity_name> animate

Notes & examples
 
By default, a model based entity which has no AI states defined spawns un-animated in the game (cinematic actors for example) and this command along with the nextanim command is required to animate them. For examples on how the animate and nextanim commands work together, refer to the notes in the nextanim command.

This command will also place an actor with predefined AI states in animation control mode (see the anim command).


attach  
 
Function
 
This will attach an existing model based entity to the bone of another model based entity. Bones are attachment points for models, all actors and some objects have one or several "bones". Only func_scriptmodels or func_throwobjects can be attached to another model's bone this way.

Syntax
 
$<object_name> attach $<entity_name> <entity_bone_name>

Notes & examples
 
Here's a breakdown of the command arguments:

$<object_name>:


$<entity_name>:



<entity_bone_name>:



targetname of the func_scriptobject or func_throwobject to attach to the parent model.

targetname of the parent model entity, usually (but not necessarily) an actor entity. When the parent model moves around in the map, the attached model will follow.

name of the parent entity's bone to which the attached model will be connected. The bones of a particular model are defined in its .def file.
How to use this command:

First create a func_scriptobject or func_throwobject in your map, assign the "model" key to the name of the desired model's .def file and give it a targetname. For this example, I'll set the "model" key to "moneybag.def" and give it a targetname of "bag1".

Next, create a model entity which has bones defined for it. Actors are the most likely candidates for this so I'll use a Neutral_Technician_Freeport and give it a targetname of "Charlie". Then take a look at the value assigned to the entity's "model" key by default (tech_freeport.def in this case). Open the .def file with a text editor and look for statements which start with "id #" and have the word "bone" in them. In this case, there's only one:

id 200 group arm_left_lower bone gun 0 0 0 flesh

This statement means that the model has a bone at the extremity (origin) of its lower left arm group and that the bone's name is "gun" (the bone is located exactly in his left hand).

So now, all you have to do to attach the moneybag to the actor's left hand is isssue the command:

$bag1 attach $Charlie gun
$bag1 origin "0 0 0"


If you then make "Charlie" walk around, the attached model will stay with him and he will look like he's carrying the bag around. The origin command is used to reset the attached object's position in relation to the parent model's bone. If the actor dies, the attached model is automatically dropped.

If you need to both create a model and attach it, use the attachmodel instead. An attached model can be detached by using the detach command or thrown by using the throw Throwobject command.

Note:
This command works exactly the same way as the pickup Throwobject command.



attachmodel
 
Function
 
This will automatically create and attach a model based entity to the bone of another model based entity. Bones are attachment points for models, all actors and some objects have one or several "bones". The attached object is automatically created as a func_throwobject.

Syntax
 
$<entity_name> attachmodel <model_name>.def <model_bone_name> <attached_model_targetname>

Notes & examples
 
This command works on the same principle as the attach command except that it does not require that the attached model exists in the game before attaching it. The attachmodel command creates the entity and attaches it all at once. Because of this, the syntax is also different.

Here's a breakdown of the command arguments:

$<entity_name>:



<model_name>.def:


<model_bone_name>:


<attached_model_name>:

targetname of the parent model, usually (but not necessarily) an actor entity. When the parent model moves around in the map, the attached model will follow.

name of the .def file of the model entity to create and attach to the parent model. The entity is created as a func_throwobject.

name of the parent model's bone to which the attached model will be connected. The bones of a particular model are defined in its .def file.

targetname assigned to the attached model. This name is necessary if you want to adjust the attached model's origin in relation to the bone. It is also useful in case you need to detach or throw the object later in the game.

How to use this command:

I will use the same example as the one in the notes of the attach command. Refer to it for information on determining the name and location of a model's bone(s).

Create a Neutral_Technician_Freeport and give it a targetname of "Charlie" but don't create anything else. Next, just use the following commands:

$Charlie attachmodel moneybag.def gun bag1
$bag1 origin "0 0 0"

This will create a func_throwobject with the model key set to "moneybag.def" and give it a targetname of "bag1". The end result will be exactly the same as in the example in the notes of the attach command. The only difference is that the func_throwobject does not need to be created in the map editor before the command is used.


bind
 
Function
 
Use this to bind solid entities together. ScriptSlave entities (func_scriptobject, func_scriptmodel, func_scriptorigin) can be bound together without any restrictions. Scriptslave entities can also be bound to some solid moving entities such as func_door's, func_rotatingdoor's and func_scriptdoor's.

Syntax
 
$<child_entity_name> bind $<parent_entity_name>

Notes & examples
 
This works on a child-parent relationship so when a move or rotate command is applied to the parent object, all the child objects bound to it will follow. But a move or rotate command is applied to one of the child objects, only that child object will move or rotate but not the parent.

This command is one of the cornerstones for making complex moving mechanical things in Sin maps. More details and some examples can be found in the notes of the func_scriptorigin entity documentation sheet.

To unbind entities, use the unbind command.


censor  
 
Function
 
This will replace any model based or solid entity with a censored.def model which is a red rectangular box with the word "censored" written on all its sides. Only works if parentmode is set to 1.

Syntax
 
$<entity_name> censor

Notes & examples
 
This command was implemented to give the developers to easily censor something controversial in their maps should the need arise. Its actual usefulness for amateur mapmakers is therefore somewhat limited.


courseangles  
 
Function
 
This will make a rotating entity in the game send its "angles" data as 8-bit values over the network. This makes the rotation movement look more "coarse" or choppy but saves on network traffic. The default is 16-bit values. This command has no effect on SP games.

Syntax
 
$<entity_name> courseangles

Notes & examples
 
This only applies to model based or solid entities which respond to rotation commands. To reset a rotating entity to make it send the default 16-bit angles values over the network again, use the smoothangles command.


detach
 
Function
 
Use this to detach a model previously attached with an attach or attachmodel command.

Syntax
 
$<attached_model_name> detach

Notes & examples
 
In reference to the example used in the attach command, in order to detach the attached object, the command in that case would simply be:

$bag1 detach

The moneybag model will be detached from the Neutral_Technician_Freeport's 'gun' bone and left floating in the air (it will not drop to the floor) wherever the actor is positioned at the instant the command is issued.



doActivate  
 
Function
 
This can be used to make the player, actors, sentients or drivable vehicles activate a triggerable entity in the map without the intermediary of a conventional trigger. It serves as a "trigger-less remote activate" command.

Syntax
 
$<entity_name> doActivate $<activator_name>|*1

Notes & examples
 
This can be used with any entity that's triggerable in the game. Here's a breakdown of the command arguments:

$<entity_name>: the targetname of the entity that's being activated.

$<activator_name>: the targetname of the activator entity (required otherwise game crashes!).

Examples of triggerable entities are func_door's, func_glass, func_explodingwall's, etc. Also, func_scriptobject's and func_scriptmodel's which have been set to react to being triggered in the script with the ontrigger command. For regular triggerable entities, the activator entity must be either the player (*1), actors, sentients or drivable vehicles. For scriptobject's and scriptmodel's, the activator entity can be any entity that's solid in the game (trigger brushes don't count as solid objects).

Non-solid entities such as lights, pathnodes, etc. cannot be used as activators.

Triggerable entities can also be activated by using the trigger Master command in which the syntax does not require an activator entity to be specified.


doBlocked  
 
Function
 
This is used to simulate the physical blocking of a moving or rotating entity (model based or solid) in the game by either the player, actors, sentients or drivable vehicles. It can be used a "remote blocking" command where the blocking entity doesn't have to physically block the moving entity to produce the same results.

Syntax
 
$<entity_name> doBlocked $<blocker_name>|*1

Notes & examples
 
This can be used with any entity that will react to being blocked (stop moving, reverse direction or inflict damage) in the game. Here's a breakdown of the command arguments:

$<entity_name>: the targetname of the entity that's being blocked.

$<blocker_name>: the targetname of the entity that's blocking (required otherwise game crashes!).

Typical examples of blockable entities are doors. Also, func_scriptobject's and func_scriptmodel's which have been set to react to being blocked in the script with the onblock command. For doors, the blocker entity must be either the player (*1), actors, sentients or drivable vehicles. For scriptobject's and scriptmodel's, the blocker entity can be any entity that's solid in the game (trigger brushes don't count as solid objects).

Non-solid entities such as lights, pathnodes, etc. cannot be used as blockers.

Here's a practical example: Let's say you have a func_scriptobject in your map with a targetname of "object1" and that you set its blocking damage to 10 points with the setdamage command:

$object1 setdamage 10

Now, if you make the scriptobject move around in the map and the player gets in the way of its movement and physically blocks it, he will be inflicted 10 points of damage every time he does this. Well, the doBlocked command can simulate this regardless of where the player is in the map. So if you then use the following command:

$object1 doBlocked *1

The player would go "ouch!" and lose 10 health points the same as if he had physically blocked the scriptobject even if he is nowhere near it.


doTouch  
 
Function
 
This is used to simulate the physical touching of a model based or solid entity in the game by either the player, actors, sentients or drivable vehicles. It can be used a "remote touching" command where the entity that's doing the "touching" doesn't have to physically touch the entity to produce the same results.

Syntax
 
$<entity_name> doTouch $<toucher_name>|*1

Notes & examples
 
This can be used with any entity that will react to being touched. Here's a breakdown of the command arguments:

$<entity_name>: the targetname of the entity that's being touched.

$<toucher_name>: the targetname of the entity that's touching (required otherwise game crashes!).

Typical examples of entities that will react to touch are solid triggers: trigger_once, trigger_multiple, etc. Also, func_scriptobject's and func_scriptmodel's which have been set to react to touch in the script with the ontouch command. For solid triggers, the toucher entity must be either the player (*1), actors or sentients. For scriptobject's and scriptmodel's, the toucher entity can be any entity that's solid in the game (trigger brushes don't count as solid objects).

Non-solid entities such as lights, pathnodes, etc. cannot be used as touchers.


doUse  
 
Function
 
This can be used to make the player, actors, sentients or drivable vehicles use a usable entity in the map without having to press the "use" button while facing and being near that usable entity (in the case of players). It serves as a "remote use" command.

Syntax
 
$<entity_name> doUse $<user_name>|*1

Notes & examples
 
This can be used with any entity that will react to being used. Here's a breakdown of the command arguments:

$<entity_name>: the targetname of the entity that's being used.

$<user_name>: the targetname of the user entity (required otherwise game crashes!).

Examples of entities that will react to being used are doors and triggers like trigger_use, trigger_camerause, etc. and drivable vehicles. Also, func_scriptobject's and func_scriptmodel's which have been set to react to being used in the script with the onuse command. Unfortunately, console entities cannot be used with this command.

For doors and usable triggers, the user entity must be either the player (*1), actors or sentients. For scriptobject's and scriptmodel's, the user entity can be any entity that's solid in the game (trigger brushes don't count as solid objects).

Non-solid entities such as lights, pathnodes, etc. cannot be used as users.

Note:
For drivable vehicles, the user entity must absolutely be the player (*1) otherwise the game will crash.



effects  
 
Function
 
This can be used to set or clear a number of special effects for model based and sprite based entities.

Syntax
 
$<entity_name> effects ±<modifier>

Notes & examples
 
The modifiers can be preceded by a + or a -. A plus will set the modifier and a minus will clear it but in both cases, any other modifiers set previously will be unchanged. Using a modifier without a plus or minus will set that modifier but will clear all the others.

Here's the list of the modifiers and the effect they produce:

+rotate:
This will make the entity's model rotate around itself horizontally. Applies to model based entities only.

+pulse:
This will make the entity's model throw out a continuous shower of blue particles in all directions like a fountain. Applies to model based entities only.

+gib:
Haven't been able to determine what this does.

+everyframe:
The only use I have found for this is to render visible and animate the sprite assigned to the fx_uwshock entity.

+autoanimate:
This will animate the sprite of an fx_sprite entity. This only works for animated sprites (sprites with animation frames).

+rocket:
Haven't been able to determine what this does.


endanim  
 
Function
 
This will bring an animated model entity to the last frame of its current animation. If the animation is stopped while the command is issued, the model will wait until the next animate command is issued to jump to the last frame and resume animating. If the animation is already running while the command is issued, the animation will jump to the last frame right away and keep animating.

Syntax
 
$<entity_name> endanim

Notes & examples
 
This command only applies to model based entities which have animations. There are 3 other commands for animation frame control: nextframe, prevframe and setframe.


fade  
 
Function
 
This will make any visible entity fade out and be removed from the game. Does exactly the same thing as the fadeout entity command but the fadeout rate or speed is adjustable.

Syntax
 
$<entity_name> fade <rate>

Notes & examples
 
The possible values of <rate> are from 0.0 to 1.0, 0 being the slowest and 1 the fastest.


fadeout  
 
Function
 
This will make any visible entity fade out and be removed from the game. Does exactly the same thing as the fade command but the fadeout rate or speed is fixed.

Syntax
 
$<entity_name> fadeout

Notes & examples
 
Note:
Do not confuse this command with the fadeout Master command. It is an entirely different command with a different function even though it has the same name.


flags  
 
Function
 
This can be used to set or clear a number of special effects for model based entities.

Syntax
 
$<entity_name> flags ±<modifier>

Notes & examples
 
The modifiers can be preceded by a + or a -. A plus will set the modifier and a minus will clear it but in both cases, any other modifiers set previously will be unchanged. Using a modifier without a plus or minus will set that modifier but will clear all the others.

Here's the list of the modifiers and the effect they produce:

+blood:
This make the entity's model spurt blood when hurt. Applies to solid destructible models only.

+sparks:
This make the entity's model spurt sparks when hurt. Applies to solid destructible models only.

+shatter:
This make the entity's model tesselate (throw fragments of itself) when hurt. Applies to solid destructible models only.

+blast:
Haven't been able to determine what this does.

+die_shatter:
This make the entity's model shatter like glass when killed or destroyed. Applies to solid destructible models only.

+explode:
This make the entity's model spawn an explosion when killed or destroyed. The explosion will hurt anything or anybody nearby. Applies to solid destructible models only.

+die_gibs:
This make the entity's model burst into organic gibs when killed or destroyed. Applies to solid destructible models only.

+darken:
This make the entity's model darken more and more each time it's hurt. Applies to solid destructible models only.

+forcefield:
This make the entity's model produce a blue spherical forcefield around it for a brief moment each time it's shot at. This also makes it indestructible. Applies to solid destructible models only.

+stealth:
Haven't been able to determine what this does.


ghost  
 
Function
 
This makes a model based entity not solid. It remains visible but can be walked through. This does exactly the same thing as the notsolid command.

Syntax
 
$<entity_name> ghost

Notes & examples
 

gib
 
Function
 
Makes gibs and blood splats spew out from a model based entity. This command is meant to be used mainly with func_scriptmodel's but can, in principle, be used on any model based entity. See notes below.

Syntax
 
$<entity_name> gib <no_of_gibs> <velocity> <scale> <gib_type>

Notes & examples
 
Explanation of the command arguments:

<no_of_gibs>:  number of gib models that will be thrown.

<velocity>:      velocity of the thrown gibs (inversely proportional to scale).

<scale>:         size of the thrown gibs (affects velocity: the smaller the gibs, the farther they fly out).

<gib_type>:    type of thrown gibs. Possible types are: organic (heads, arms, legs, etc.) and feather.

When used on func_scriptmodel's, this command will make them throw gibs and disappear afterwards the same way as if the thing had died in a shower of gibs. When used on other model based entities such as actors or world objects, they will throw gibs but won't die, be damaged or removed.

If you need to make a living things gib AND die, the easiest way is to inflict them a massive amount of damage that largely exceeds their maximum default health with the hurt command. For example, to gib-kill a simple thug:

$thug1 hurt 1000

Since a regular thug has a maximum health value of about 60 - 80 points, inflicting 1000 points of damage will gib it.

If you want to make an non-damageable model based entity to appear to die in a shower of gibs, the best way is to create an illusion. For this, just follow the gib command with a remove command, for example:

$object gib 10 30 1 organic
$object remove



gravity  
 
Function
 
This sets the gravity pull exerted on entities which respond to gravity: actors, sentients and all pickup-able items (weapons, ammo , health, etc.).

Syntax
 
$<entity_name> gravity <value>

Notes & examples
 
Gravity values are from 0.0 to 1.0. 1 is normal gravity and 0 is no gravity at all. Values above 1 make the entities fly right up and through the ceiling outside the map so don't use values above 1.

Also, since pickup-able items in Sin don't register the value of the "targetname" key when set in the editor's entity dialog, refering to them in a script is tricky. The only possiblility is to find out their entity sequence number with the procedure described in the notes of the removeent Master command.

Then you can refer to the entity directly by its sequence number preceded by a * character or you can set its targetname with the targetname command first and refer to that name afterwards.

Note:
When new entities are added to a map, all the previous sequence numbers get shifted so this sequence number technique described above is not recommended unless you are sure that you already have created all the entities you need for your map.


group
 
Function
 
This makes it possible to control the appearance of a model based entity's individual parts or "groups". These groups are essentially "body parts" and must defined in the model's .def file (under the id # group statements).

Syntax
 
$<actor_name> group <group_name> ±<modifier>

Notes & examples
 
Here's a breakdown of the command arguments:

<group_name>:


±<modifier>:

any valid group for this model's .def file (example: head, torso_upper, leg_lower_left, helmet, etc.).

this is a keyword with either a '+', '-' or nothing prepended to it. A '+' means assert this modifier, a '-' means clear this modifier and nothing means set the modifier and nothing else (Note: most of the time you want to put a '+' or '-' in front of the modifier, since by prepending nothing you clear the state of all other modifiers).

Here's the list of possible modifiers:

skin1:

skin2:

nodraw:

envmapped:

goldenvmapped:

translucent33:

translucent66:

fullbright:

the first skin offset bit (used for damage or alternate skins).

the second skin offset bit (used for damage or alternate skins).

don't draw this group.

environment map this group.

environment map this group with a gold environment map.

make this group 33% translucent.

make this group 66% translucent.

make this group fullbright.

Info courtesy of Mark Dochterman, Ritual Entertainment.


health
 
Function
 
This sets the maximum health of an entity. If the entity is a living thing or a destructible object, it will be killed or destroyed when an amount of damage points equal or greater to its health will have been inflicted.

Syntax
 
$<entity_name> health <points>

Notes & examples
 
This can be used to modify the default maximum health of actors, monsters or destructible objects in the game to make them more or less difficult to kill or destroy.


hide
 
Function
 
This makes any visible entity invisible in the game.

Syntax
 
$<entity_name> hide

Notes & examples
 
Even though the entity is invisible, it's still present in the game. It can still be controlled and interact with it's environment in the map. To make the entity visible again, use the show command.


hurt  
 
Function
 
This will inflict damage to any damageable entity. If the number of damage points specified in the command argument is greater or equal than the entity's current health, it will be killed or destroyed.

Syntax
 
$<entity_name> hurt <points>

Notes & examples
 

kill  
 
Function
 
This will kill any actor or sentient and will also shatter destructible solid entities such as func_glass or func_shatter.

Syntax
 
$<entity_name> kill

Notes & examples
 
This command doesn't work with func_scriptmodel's or plain world objects.


killtarget  
 
Function
 
This will set or change the value of an entity's "killtarget" key. Only applies to entities which support this key.

Syntax
 
$<entity_name> killtarget "<new_value>"

Notes & examples
 
When in doubt whether an entity supports the "killtarget" key or not, consult the documentation sheet for that particular entity.


light  
 
Function
 
This makes a model based or solid entity emit dynamic light. The color, intensity and radius of the emitted light are set by the command arguments. Lensflare entities can also emit dynamic light and will respond to this command.

Syntax
 
$<entity_name> light <red> <green> <blue> <radius>

Notes & examples
 
Dynamic lights are different from regular light entities or light radiated by brush surfaces: normal lights cannot be moved but dynamic lights can. For example, let's say you create a func_scriptobject and set one or more of its brush faces to emit light (radiosity or direct). The light is pre-calculated where the object spawns and will remain in the same place even if the object is moved in the game with script commands.

But if you set a dynamic light value to a func_scriptobject and make that object move in the game, the light will move along with the object.

The <red>, <green> and <blue> arguments affect only the color of the light and can be set separately by using the lightRed, lightGreen and lightBlue commands. Color values are from 0.0 to 1.0 and the default is white.

The <radius> argument sets the dynamic light's radius and intensity and can be set separately by using the lightRadius command. The radius values is arbitrary and not in map units. To get a feel for it, it is recommended to start with a value of 100 or so (assuming the entity is in a dark area) and work from there .


lightBlue  
 
Function
 
This sets the amount of blue in the color of the dynamic light emitted by a model based or solid entity. Lensflare entities can also emit dynamic light and will respond to this command.

Syntax
 
$<entity_name> lightBlue <value>

Notes & examples
 
In order for the dynamic light emitted by an entity to be visible, a light radius value must be set. This can be done by using the light and lightRadius commands.


lightGreen  
 
Function
 
This sets the amount of green in the color of the dynamic light emitted by a model based or solid entity. Lensflare entities can also emit dynamic light and will respond to this command.

Syntax
 
$<entity_name> lightGreen <value>

Notes & examples
 
In order for the dynamic light emitted by an entity to be visible, a light radius value must be set. This can be done by using the light and lightRadius commands.


lightOff  
 
Function
 
This turns off the dynamic light emitted by a model based or solid entity. This is assuming that the entity was previously set to emit dynamic light with the light command. Lensflare entities can also emit dynamic light and will respond to this command.

Syntax
 
$<entity_name> lightOff

Notes & examples
 
A dynamic light can be turned back on at any time by using the lightOn command.


lightOn  
 
Function
 
This turns on the dynamic light emitted by a model based or solid entity. This is assuming that the entity was previously set to emit dynamic light with the light command and turned off with the lightOff command afterwards. Lensflare entities can also emit dynamic light and will respond to this command.

Syntax
 
$<entity_name> lightOn

Notes & examples
 
A dynamic light can be turned back off at any time by using the lightOff command.


lightRadius  
 
Function
 
This sets the radius and intensity of the dynamic light emitted by a model based or solid entity. Lensflare entities can also emit dynamic light and will respond to this command.

Syntax
 
$<entity_name> lightRadius <value>

Notes & examples
 
The radius of the dymamic light can also be set by using the light command. If no color was set previously by that command or the lightRed, light or lightBlue commands, the default is white.


lightRed  
 
Function
 
This sets the amount of red in the color of the dynamic light emitted by a model based or solid entity. Lensflare entities can also emit dynamic light and will respond to this command.

Syntax
 
$<entity_name> lightRed <value>

Notes & examples
 
In order for the dynamic light emitted by an entity to be visible, a light radius value must be set. This can be done by using the light and lightRadius commands.


lightoffset  
 
Function
 
This will set the level of non-lit lighting of model based entities only. Does not work with solid brush-based entities. Values go from -125 to 125.

Syntax
 
$<entity_name> lightoffset <value>

Notes & examples
 
Non-lit lighting is different from dynamic lights and should not be confused. A non-lit value will make the object self-lighted but it won't radiate light onto its surroundings in the map. It's a bit as if the model was lighted "from the inside" and is used mainly to make it stand out in a dark area of the map without affecting that area's light level.

This does the same thing as the minlight command except that it offers an adjustable range of values instead of a fixed level of non-lit lighting.


mass  
 
Function
 
This will change the default mass of any actor or sentient affected by gravity. Used mainly to modify the mass of ennemies and monsters. Its mass will determine how far back or how high the monster will be pushed when hit by projectiles or explosions.

Syntax
 
$<entity_name> mass <value>

Notes & examples
 
As a basic yardstick for mass of actors: typical human type actors such as thugs, grunts and civilians have a default mass of around 200. Big monsters have a much higher mass. Peon has a mass of 2000, Thrall: 10000


minlight  
 
Function
 
This toggles on/off the minimum amount of non-lit lighting of model based entities only. Does not work with solid brush-based entities.

Syntax
 
$<entity_name> minlight 0|1
0: off
1: on

Notes & examples
 
Non-lit lighting is different from dynamic lights and should not be confused. A non-lit value will make the object self-lighted but it won't radiate light onto its surroundings in the map. It's a bit as if the model was lighted "from the inside" and is used mainly to make it stand out in a dark area of the map without affecting that area's light level.

This does the same thing as the lightoffset command except that it sets a fixed minimum level of non-lit lighting instead of a range of lighting values.


model  
 
Function
 
This can be used to change the model assigned to a func_scriptobject or a func_throwobject entity in the course of the game. All the attributes of the original model such as scale and angles, etc. are transposed to the new model.

Syntax
 
$<entity_name> model <filename>.def

Notes & examples
 
If you have a func_scriptmodel which's model key was set to "moneybag.def", it will originally be a moneybag model in the game. If, for example, you set it's targetname to "object1" and use the command:

$object1 model lamp.def

The moneybag will turn into a table lamp.


nextanim
 
Function
 
Selects the next animation sequence to play of a model based entity. If the model is not currently animated when the command is issued, the animation will only start playing on the next animate command. Inversely, if the model is already playing an animation when the command is issued, it will switch to the new animation and start playing it right away.

Syntax
 
$<entity_name> nextanim <animation_name>

Notes & examples
 
Animation names for model entities can take 2 forms: animation alias names and specific .sam file animation names. The choice of possible animations of a model entity is defined by a list in that entity's .def file. For examples of this, please refer to the notes in the anim command.

By default, a model based entity which has no AI states defined spawns un-animated in the game (cinematic actors for example) and this command along with the animate command is required to animate them.

A typical example of this is the cinematic_blade actor: it has no predefined AI states and thus no default "Idle" state which would automatically animate him in the game. When you place this entity in the map, the "anim" key is set to "idle1" by default. Let's say you give it a targetname of "blade1"and you put the following command in the script:

$blade1 animate

You'll notice that this doesn't animate the model in the game. If you refer to the notes for the cinematic_blade entity, you'll see that it's stated in there that the model's animation can't be set directly by setting the value of the "anim" key. This is the reason why: you absolutely have to use the nextanim command for this. So to animate the actor for the first time, you have to use the following 2 commands:

$blade1 nextanim idle1
$blade1 animate


Afterwards, the following nextanim commands with a different animation name will change and play the new animation right away because the model is already animated. The only other time the nextanim command doesn't switch animations right away is if the animation was stopped previously with the stopanim command. In that case, an additional animate command is required to start playing the animation:

$blade1 stopanim              // the animation freezes
$blade1 nextanim typing    // set the next animation to play - model isn't animated yet.
$blade1 animate               // the animation starts playing



nextframe  
 
Function
 
This will bring an animated model entity to the next frame of its current animation. If the animation is stopped while the command is issued, the model will wait until the next animate command is issued to jump to the next frame and resume animating. If the animation is already running while the command is issued, the animation will jump to the next frame right away and keep animating.

Syntax
 
$<entity_name> nextframe

Notes & examples
 
This command only applies to model based entities which have animations. There are 3 other commands for animation frame control: endanim, prevframe and setframe.


nodamage  
 
Function
 
This makes a normally damageable entity indestructible. Can be used with living things such as actors and sentients and destructible world objects.

Syntax
 
$<entity_name> nodamage

Notes & examples
 
An entity made indestructible with this command can be made damageable again by using the takedamage command.

Note:
Do not confuse this command with the nodamage Scriptslave command. It is an entirely different command with a different function even though it has the same name.


notsolid
 
Function
 
Makes a solid model based or brush based entity non-solid so game actors and players can walk through it.

Syntax
 
$<entity_name> notsolid

Notes & examples
 
To make the entity solid again, just use the opposite command: solid.


origin  
 
Function
 
This moves the origin of the entity to the coordinates specified in the command argument. Works with practically any entity except light entities and pathnodes.

Syntax
 
$<entity_name> origin "<X Y Z>"

Notes & examples
 

phssound
 
Function
 
Plays a .wav file in the game based on PHS (Potentially Hearable Set) information. The PHS info is itself derived from the PVS (Potentially visible set) information which is generated by qvis3 during compilation. Used for sounds emanating from solid entities or models. This information is used to calculate a more realistic propagation of the sound emanating from a movable entity in a map.

Syntax
 
$<entity_name> phssound "<path>/<soundname>.wav" <volume> <channel> <attenuation> <pitch> <timeofs> <fadetime>

Notes & examples
 
The sound will originate from the entity used in the command. Here is the list of the function and possible values of the optional arguments for this command:

volume:

channel:










attenuation:




pitch:





timeofs:

fadetime:
loudness of sound (default 1). Value ranges from 0 - 4 (floating point). Volume has no effect on ambient sounds.
channel on which sound is generated (has no effect on ambient sounds). Value ranges from 0 - 7.
    0 :auto channel (default).
    1 :weapon channel (sounds from weapons).
    2 :voice channel (talking).
    3 :item channel (items on player making sounds).
    4 :body channel (falling to the ground, landing, bodyfalls).
    5 :dialog channel (formal dialog).
    6 :secondary dialog channel (formal dialog).
    7 :weaponidle channel (sounds your weapon makes, should
        only be on weapons).
attenuation of sound with distance. Value ranges from 0 - 3.
    0 :no attenuation (level-wide).
    1 :normal attenuation (default).
    2 :idle attenuation (falls off a little more quickly).
    3 :static attenuation (same as ambient sounds).
the pitch of the sound (has no effect on ambient sounds). Value must be >0 (floating point).
For example:
    0.5 :half speed.
    1.0 :normal speed (default).
    2.0 :double speed.
offset time in milliseconds till the sound starts (has no effect on ambient sounds) (0 is default).
how long the sound takes to fade in seconds (has no effect on ambient sounds) (0 is default).

To stop sounds started with this command, use the stopsound command.


playsound
 
Function
 
Plays a .wav file in the game. Used for sounds emanating from solid entities or models. If the object moves, the sound will move along with it.

Syntax
 
$<entity_name> playsound "<path>/<soundname>.wav" <volume> <channel> <attenuation> <pitch> <timeofs> <fadetime>

Notes & examples
 
The sound will originate from the entity used in the command. Here is the list of the function and possible values of the optional arguments for this command:

volume:

channel:











attenuation:




pitch:





timeofs:

fadetime:
loudness of sound (default 1). Value ranges from 0 - 4 (floating point). Volume has no effect on ambient sounds.
channel on which sound is generated (has no effect on ambient sounds). Value ranges from 0 - 8.
    0 :auto channel (default).
    1 :weapon channel (sounds from weapons).
    2 :voice channel (talking).
    3 :item channel (items on player making sounds).
    4 :body channel (falling to the ground, landing, bodyfalls).
    5 :dialog channel (formal dialog).
    6 :secondary dialog channel (formal dialog).
    7 :weaponidle channel (sounds your weapon makes, should
        only be on weapons).
    8 :no PHS channel (don't use PHS).
attenuation of sound with distance. Value ranges from 0 - 3.
    0 :no attenuation (level-wide).
    1 :normal attenuation (default).
    2 :idle attenuation (falls off a little more quickly).
    3 :static attenuation (same as ambient sounds).
the pitch of the sound (has no effect on ambient sounds). Value must be >0 (floating point).
For example:
    0.5 :half speed.
    1.0 :normal speed (default).
    2.0 :double speed.
offset time in milliseconds till the sound starts (has no effect on ambient sounds) (0 is default).
how long the sound takes to fade in seconds (has no effect on ambient sounds) (0 is default).

To stop sounds started with this command, use the stopsound command.


prevframe  
 
Function
 
This will bring an animated model entity to the previous frame of its current animation. If the animation is stopped while the command is issued, the model will wait until the next animate command is issued to jump to the previous frame and resume animating. If the animation is already running while the command is issued, the animation will jump to the previous frame right away and keep animating.

Syntax
 
$<entity_name> bogus <argument>

Notes & examples
 
This command only applies to model based entities which have animations. There are 3 other commands for animation frame control: endanim, nextframe and setframe.


randomambientsound
 
Function
 
Plays a .wav file in the game. Used for random ambient sounds emanating from solid entities or models. If the object moves, the sound will move along with it.

Syntax
 
$<entity_name> randomambientsound "<path>/<soundname>.wav"

Notes & examples
 
Ambient sounds loop, play at full volume and use static attenuation (3) by default. The parameters available for normal sounds (volume, channel, attenuation, pitch, timeofs, fadetime and flags) cannot be used with ambient sounds.

To stop sounds started with this command, use the stopambientsound command.


randomglobalambientsound  
 
Function
 
Plays a .wav file in the game. Used for random ambient sounds emanating from solid entities or models which must be heard level-wide.

Syntax
 
$<entity_name> randomglobalambientsound "<path>/<soundname>.wav"

Notes & examples
 
Ambient sounds loop, play at full volume and use level-wide attenuation (0) by default. The parameters available for normal sounds (volume, channel, attenuation, pitch, timeofs, fadetime and flags) cannot be used with ambient sounds.

To stop sounds started with this command, use the stopambientsound command.


randomphssound  
 
Function
 
Plays a .wav file in the game based on PHS (Potentially Hearable Set) information at random time intervals. The PHS info is itself derived from the PVS (Potentially visible set) information which is generated by qvis3 during compilation. Used for sounds emanating from solid entities or models. This information is used to calculate a more realistic propagation of the sound emanating from a movable entity in a map.

Syntax
 
$<entity_name> randomphssound "<path>/<soundname>.wav" <volume> <channel> <attenuation> <pitch> <timeofs> <fadetime>

Notes & examples
 
The sound will originate from the entity used in the command. Here is the list of the function and possible values of the optional arguments for this command:

volume:

channel:










attenuation:




pitch:





timeofs:

fadetime:
loudness of sound (default 1). Value ranges from 0 - 4 (floating point). Volume has no effect on ambient sounds.
channel on which sound is generated (has no effect on ambient sounds). Value ranges from 0 - 7.
    0 :auto channel (default).
    1 :weapon channel (sounds from weapons).
    2 :voice channel (talking).
    3 :item channel (items on player making sounds).
    4 :body channel (falling to the ground, landing, bodyfalls).
    5 :dialog channel (formal dialog).
    6 :secondary dialog channel (formal dialog).
    7 :weaponidle channel (sounds your weapon makes, should
        only be on weapons).
attenuation of sound with distance. Value ranges from 0 - 3.
    0 :no attenuation (level-wide).
    1 :normal attenuation (default).
    2 :idle attenuation (falls off a little more quickly).
    3 :static attenuation (same as ambient sounds).
the pitch of the sound (has no effect on ambient sounds). Value must be >0 (floating point).
For example:
    0.5 :half speed.
    1.0 :normal speed (default).
    2.0 :double speed.
offset time in milliseconds till the sound starts (has no effect on ambient sounds) (0 is default).
how long the sound takes to fade in seconds (has no effect on ambient sounds) (0 is default).

To stop sounds started with this command, use the stopsound command.


randomsound
 
Function
 
Plays a .wav file in the game at random time intervals. Used for sounds emanating from solid entities or models. If the object moves, the sound will move along with it.

Syntax
 
$<entity_name> randomsound "<path>/<soundname>.wav" <volume> <channel> <attenuation> <pitch> <timeofs> <fadetime>

Notes & examples
 
The sound will originate from the entity used in the command. Here is the list of the function and possible values of the optional arguments for this command:

volume:

channel:











attenuation:




pitch:





timeofs:

fadetime:
loudness of sound (default 1). Value ranges from 0 - 4 (floating point). Volume has no effect on ambient sounds.
channel on which sound is generated (has no effect on ambient sounds). Value ranges from 0 - 8.
    0 :auto channel (default).
    1 :weapon channel (sounds from weapons).
    2 :voice channel (talking).
    3 :item channel (items on player making sounds).
    4 :body channel (falling to the ground, landing, bodyfalls).
    5 :dialog channel (formal dialog).
    6 :secondary dialog channel (formal dialog).
    7 :weaponidle channel (sounds your weapon makes, should
        only be on weapons).
    8 :no PHS channel (don't use PHS).
attenuation of sound with distance. Value ranges from 0 - 3.
    0 :no attenuation (level-wide).
    1 :normal attenuation (default).
    2 :idle attenuation (falls off a little more quickly).
    3 :static attenuation (same as ambient sounds).
the pitch of the sound (has no effect on ambient sounds). Value must be >0 (floating point).
For example:
    0.5 :half speed.
    1.0 :normal speed (default).
    2.0 :double speed.
offset time in milliseconds till the sound starts (has no effect on ambient sounds) (0 is default).
how long the sound takes to fade in seconds (has no effect on ambient sounds) (0 is default).

To stop sounds started with this command, use the stopsound command.


remove
 
Function
 
This will remove any entity from the game.

Syntax
 
$<entity_name> remove

Notes & examples
 

rendereffects  
 
Function
 
This can be used to set or clear a number of rendering effects for model based entities.

Syntax
 
$<entity_name> rendereffects ±<modifier>

Notes & examples
 
The modifiers can be preceded by a + or a -. A plus will set the modifier and a minus will clear it but in both cases, any other modifiers set previously will be unchanged. Using a modifier without a plus or minus will set that modifier but will clear all the others.

Here's the list of the modifiers and the effect they produce:

+minlight:
This sets the minimum non-lit level of the entity's model. Basically does the same thing as the minlight command.

+fullbright:
This sets the maximum non-lit level of the entity's model. Basically does the same thing as the lightoffset command with 125 used as its argument.

+glow:
This makes the entity's model non-lit lighting pulsate the same way as weapons and ammo in the game.

+envmapped:
This will skin the entity's model with an envmap chrome-like texture (generic/misc/envmap4.swl).

+dontdraw:
This causes the entity's model not be drawn and be invisible. Basically does the same thing as the hide command.


scale  
 
Function
 
This will change the size of a model based entity during the course of the game. If the entity makes sounds such as actors for example, the sounds will be "scaled" (pitch varies accordingly) along with the entity's model.

Syntax
 
$<entity_name> scale <value>

Notes & examples
 
An interesting aspect of this command is that when models are scaled in the game, they "lerp" from their old size to their new size. Lerping means they gradually change from one to the other. So the model actually appears to shrink or grow instead of instantly "switching to a new size". You can also control the time a model takes to grow or shrink by using several "scale" commands and inserting wait commands in between.

Here's an example. Let's say you place a scientist actor (Neutral_Scientist entity) in your map at the default scale (1.0) and give it a targetname of "otto". By using the following set of commands:

$otto scale 1.1
wait 0.2
$otto scale 1.2
wait 0.2
    |
    |
   etc.
    |
    |
$otto scale 1.9
wait 0.2
$otto scale 2.0


The scientist will grow to twice its original size in 2 seconds. By varying the wait times and the scale values, you can control the rate at which he will grow (or shrink). Also, in this example, the sounds that the scientist makes (footsteps, talking, etc.) will be played at half their normal pitch. This will give him a deep, low kind of voice.


setframe  
 
Function
 
This will immediately bring an animated model entity to a specific frame number of its current animation regardless if the model is animating or not when the command is issued. If the animation is running while the command is issued, it will freeze and jump to the frame number specified in the command argument. If the animation was already stopped while the command is issued, it will simply jump to the frame number specified in the command argument. The animation will then remain frozen until the next setframe command or until an animate command makes it resume animating.

Syntax
 
$<entity_name> setframe <frame_number>

Notes & examples
 
This command only applies to model based entities which have animations. There are 3 other commands for animation frame control: endanim, nextframe and prevframe.


setsize  
 
Function
 
This sets the bounding box size of a model based entity in the game. Useful for adjusting the bounding box of models which were scaled with the scale command.

Syntax
 
$<entity_name> setsize "<minX minY minZ>" "<maxX maxY maxZ>"

Notes & examples
 
This command is also useful for fixing the bounding box size of certain model entities which's bounding box size isn't "fitted" properly to its model's actual size such as vehicles_lamprey (lamprey.def) for example.


shatter
 
Function
 
This will make a model based or solid entity tesselate (tesselation is when a model spews fragments of itself) but the entity won't be destroyed as such, it will just thrown fragments with the same skin or texture as the model or brush they come from.

Syntax
 
$<entity_name> shatter "<dirX dirY dirZ>" <power> <minsize> <maxsize> <percentage> <thickness>

Notes & examples
 
Here's the description of the command arguments:

"dirX dirY dirZ":


power:


minsize:


maxsize:


percentage:

thickness:
the direction (pitch, yaw, roll) of the impulse.
The double quotes are required. Eg: "0 90 0"

the magnitude of the shatter impulse (damage). Determines how far the fragments are thrown.
This is required since default is 0.

the absolute smallest size a fragment can get.
This is required since default is 0.

the absolute biggest size a fragment can get.
If omitted, this will be the same as minsize.

the percentage of the whole to fragment. Default is based on object's size.

the thickness of each fragment. If thickness is 0 (default), the fragment is double-sided. If it is non-zero, then the thickness of the object will be ½ thickness + random (½ thickness).

The "<dirX dirY dirZ>" and <power> arguments are required no matter what. Since the default <minsize> is 0, this argument is also required otherwise, you will not see any fragments. However, it can be omitted if the parameter was set for the entity with the shatter_minsize command prior to using this command and provided you do not intend on including any of the command's optional arguments which follow the <minsize> argument.

The <maxsize>, <percentage> and <thickness> parameters can also be set in advance for the entity with the shatter_maxsize, shatter_percentage and shatter_thickness commands respectively.


shatter_maxsize  
 
Function
 
This presets the maximum size of the fragments that will be thrown from a model based or solid entity before it is made to tesselate with the shatter command. The value specified in the argument of this command becomes the new default maxsize for the entity.

Syntax
 
$<entity_name> shatter_maxsize <value>

Notes & examples
 
If a value is specified for the maxsize argument in the following shatter command, it will override the default value set by this command.


shatter_minsize  
 
Function
 
This presets the minimum size of the fragments that will be thrown from a model based or solid entity before it is made to tesselate with the shatter command. The value specified in the argument of this command becomes the new default minsize for the entity.

Syntax
 
$<entity_name> shatter_minsize <value>

Notes & examples
 
If a value is specified for the minsize argument in the following shatter command, it will override the default value set by this command.


shatter_percentage  
 
Function
 
This presets the percentage of the whole volume of a model based or solid entity to use for tesselation. This determines how many fragments will be thrown from the entity when it is made to tesselate with the shatter command. The value specified in the argument of this command becomes the new default percentage for the entity.

Syntax
 
$<entity_name> shatter_percentage <value>

Notes & examples
 
If a value is specified for the percentage argument in the following shatter command, it will override the default value set by this command.


shatter_thickness  
 
Function
 
This presets the thickness of the fragments that will be thrown from a model based or solid entity before it is made to tesselate with the shatter command. The value specified in the argument of this command becomes the new default thickness for the entity.

Syntax
 
$<entity_name> shatter_thickness <value>

Notes & examples
 
If a value is specified for the thickness argument in the following shatter command, it will override the default value set by this command.


show
 
Function
 
This "unhides" a visible entity. Makes any entity previously made invisible with the hide command visible in the game again.

Syntax
 
$<entity_name> show

Notes & examples
 

skin  
 
Function
 
This changes a model based entity's skin during the course of the game. The filename used in the argument must be a valid TGA skin filename but the file extension is omitted. See notes below.

Syntax
 
$<entity_name> skin <skin_filename>

Notes & examples
 
In order for this command to work, both the following 2 conditions must be met:
  1. The TGA file of the skin specified in the argument must reside in the entity's specific folder for the basic model, animations and skins as defined in the "path" statement inside the model's .def file.

  2. The skin name specified in the argument must be present in the "skin list" of the model's .def file.
A typical example of this is when you add custom skins for the Blade player. Let's say you just downloaded this brand new skin named kickass.tga and you copy it to the models/pl_blade folder. Of course, you will be able to select the skin for DM play but if you try to change the Blade's skin in a single player game with the command:

*1 skin kickass

The game will return an error message saying that "could not find kickass as a skin name". The reason for this is that the file kickass.tga, although it does reside in the proper folder, is not included in the skin list inside the default Blade player's .def file (pl_blade.def).

So in order to be able to set this skin in a SP game with this command, you have to open the file pl_blade.def in a text editor and manually add the name of the skin tga file in the section where all the skins are listed:

// Skins
normal    blade_base.tga
damage    blade_base_dam.tga

(add your new skins after this line)

kickass.tga    


Make sure to put a copy of this modified .def file in the game's base/models folder. This will make it take precedence over the default pl_blade.def file inside the Pak0.sin file. Of course, if you intend to distribute your SP map for others to play, you will also have to distribute both the skin TGA file and the modified .def file.


smoothangles  
 
Function
 
This will make a rotating entity in the game send its "angles" data as 16-bit values over the network. This makes the rotation movement look "smoother" but increases network traffic. This is the game's default setting. This command has no effect on SP games.

Syntax
 
$<entity_name> smoothangles

Notes & examples
 
This only applies to model based or solid entities which respond to rotation commands. To make a rotating entity send smaller 8-bit angles values over the network to save traffic, use the courseangles command.


solid
 
Function
 
Turns a model based or solid entity previously made non-solid with the notsolid command solid again. This command also works for entities which were created in the map editor with the NOT_SOLID spawnflag set: it will make them solid.

Syntax
 
$<entity_name> solid

Notes & examples
 

sparks
 
Function
 
This will generate a spark effect that will originate from a model based or solid brush entity. Won't work with point entities such as lights, waypoints, pathnodes, etc.

Syntax
 
$<entity_name> sparks "<dirX dirY dirZ>" <count> <style>

Notes & examples
 
Here's the description of the command arguments:

"dirX dirY dirZ":


count:

style:
the direction (pitch, yaw, roll) of the sparks.
The double quotes are required (default: "0 0 0")

the number of particles generated (default 10).

the style of the particles as defined in global/global.scr. Choice of styles are:

    120 :gunsmoke
    121 :blood
    122 :sparks (default)
    123 :orangeglow
    124 :blueyellow
    125 :debris trail
    126 :weird bubblegum
    127 :blood2
    128 :oil
    129 :water spray
    130 :blue - yellow - blue
    131 :blue fade


stopambientsound
 
Function
 
This stops ambient sounds previously started with either the ambientsound, randomambientsound or randomglobalambientsound commands.

Syntax
 
$<entity_name> stopambientsound

Notes & examples
 

stopanim  
 
Function
 
This is used to stop an animated model based entity from playing its current animation. When the command is issued, the animation will simply freeze. To re-animate the model again, use the animate command.

Syntax
 
$<entity_name> stopanim

Notes & examples
 
There is an example of the use of this command in the notes of the nextanim command.


stopsound
 
Function
 
This stops playing sounds previously started with either the phssound, playsound, randomphssound or randomsound commands.

Syntax
 
$<object_name> stopsound <channel>

Notes & examples
 
If the $<channel> argument is specified, only the sound being played on that channel will be stopped.


takedamage  
 
Function
 
This is used to make an entity previously made indestructible damageable again. Can be used with living things such as actors and sentients and destructible world objects. See notes below.

Syntax
 
$<entity_name> takedamage

Notes & examples
 
This is used most often in the case where a normally damageable entity such as an actor/sentient or a destructible world object was previously made indestructible either directly in the map editor with the NOT_DAMAGEABLE spawnflag (in the case of world objects) or with the nodamage command.


target  
 
Function
 
This will set or change the value of an entity's "target" key. Only applies to entities which support this key.

Syntax
 
$<entity_name> target "<new_value>"

Notes & examples
 
This seemingly innocuous command is in fact very powerful because it allows the possibility to change the value of a trigger's target key during the course of the game. Let's say, for example, you have a room with a trigger_multiple and 4 doors with a different item behind each. It is possible to use this capability to create a situation by which the value of the trigger's target key (and thus, which of the 4 doors it points to), would be set according to what the player did earlier in the game.

This is called an ABO (Action Based Outcome) situation and this simple command used along with variables set according to specific game events make these possible.

When in doubt whether an entity supports the "target" key or not, consult the documentation sheet for that particular entity.


targetname  
 
Function
 
This will set or change the value of an entity's "targetname" key. Applies to all entities (see notes below).

Syntax
 
$<entity_name> targetname "<new_value>"

Notes & examples
 
Almost all entities in SiN can be given a targetname key/value pair by which it be refered to in a script. For a reason unknown to me, the only exception to this are pickup-able items such as weapons, ammo, health, etc.

The wierdest part is that they can in fact be given a targetname but only through a script with the use of this command. Here's an example:

Let's say you insert a weapon_assaultrifle entity in the editor and give it the targetname "mygun". The compiled .bsp map will not register that value. Suppose that the entity happens to have the sequence number 40, by dropping the game console and using the "whatis" command, this is what you'll get (partial list):

]whatis 40
Entity #   : 40
Class ID   : weapon_assaultrifle
Classname  : AssaultRifle
Targetname :
Modelname  : models/asrifle.def
Animname   : idle1
Origin     : ( 54.410000, 194.360001, -111.928345 )
Bounds     : Mins( -6.41, -2.35, -8.04 ) Maxs( 19.58, 2.36, 6.71 )
etc...


As you can see, the Targetname field is there but it's empty even though you did assign a targetname to the assault rifle entity in the editor. Now you can use the entity's sequence number to refer to it in entity commands. So we can use it here to give the assault rifle a targetname:

*40 targetname "mygun"

Then, if you use the "whatis" console command again after the command was run in the script, you will get the following output (partial list):

]whatis 40
Entity #   : 40
Class ID   : weapon_assaultrifle
Classname  : AssaultRifle
Targetname : mygun
Modelname  : models/asrifle.def
Animname   : idle1
Origin     : ( 54.410000, 194.360001, -111.928345 )
Bounds     : Mins( -6.41, -2.35, -8.04 ) Maxs( 19.58, 2.36, 6.71 )
etc...


The targetname value was registered by the weapon_assaultrifle entity and can thereafter be refered to in the following commands which would apply to this entity. I agree this is a very tedious procedure and it requires that your 3D card responds to the sv_showentnums cvar to be able to display the entities' sequence numbers (this procedure is described in detail in the notes of the removeent Master command) but this is the only way to give a pickup-able item a targetname.


unbind
 
Function
 
This unbinds solid entities previously bound with the bind command.

Syntax
 
$<child_entity_name> unbind

Notes & examples