Actor commands
 
These are the commands which control actor entities: monsters, civilians and animals. Actor entities are a subclass of sentient entities, they also respond to sentient and many entity commands (gameX86 source code reference: actor.cpp).

Actor commands are colored in gold in my custom SinScript syntax coloring wordfile for UltraEdit32.


animal  
 
Function
 
This changes an actor's default type to animal type. The actor type determines how actors will react to each other. Animal type actors hate the player and are neutral to all the other actor types.

Syntax
 
$<actor_name> animal

Notes & examples
 
The animal type is used for animals. The default animal type actors in SiN are:
  • Bats (Animals_Bat entity) and Rats (Animals_Rat entity).
  • Animals like pigeons (Animals_Pigeon entity) and fishes (Animals_Fish and Animals_TropicalFish_* entities) don't attack the player because they have no attack AI.
  • There is a "friendly" version of the bat (Animals_BatLow entity) which doesn't attack the player because it is "neutralized" in its AI script file (global/bat_nice.scr) with the ignoreall command.
Possible actor types are: animal, civilian, enemy, friend, inanimate and monster. A chart of the reactions of actor types toward each other can be found in the notes of the enemy command.


attack
 
Function
 
Makes a game actor attack the entity specified in the command argument. The entity can be another actor or a solid world object.

Syntax
 
$<actor_name> attack $<entity_name>

Notes & examples
 
The actor must have attack AI and animations implemented in the model's .def file for this command to work. He will keep attacking the entity specified in the command argument until he dies or the actor or object he is attacking dies or is destroyed.

If the actor is an enemy type (a monster) and was instructed to attack a neutral object (a computer monitor for example), he will stop attacking the object if he sees what he considers to be an enemy (the player or a HC officer for example) and attack him instead. To prevent the actor from being distracted from his main task, you can make insensitive to seeing enemies with the "ignore sightenemy" command


attackmode  
 
Function
 
This sets an actor's attack mode. There are 3 choices: 0 (normal), 1 (stanground) or 2 (blitzkreig).

Syntax
 
$<actor_name> attackmode 0|1|2

Notes & examples
 
Mode 0 (normal):

actor will use duck and cover pathnodes while attacking an enemy.

Mode 1 (standground):


actor will remain in place while attacking (unless he has no weapon and can only melee attack).

Mode 2 (blitzkrieg):

actor will rush his enemy and won't use duck and cover pathnodes.

The actor must have attack AI and animations implemented in the model's .def file for this command to have any effect.


attackplayer  
 
Function
 
This makes an actor attack the player.

Syntax
 
$<actor_name> attackplayer

Notes & examples
 
The actor must have attack AI and animations implemented in the model's .def file for this command to work.


attackrange  
 
Function
 
This sets the maximum distance at which an actor will attack an enemy.

Syntax
 
$<actor_name> attackrange <distance>

Notes & examples
 
The actor must have attack AI and animations implemented in the model's .def file for this command to have any effect.


behavior
 
Function
 
AI command. Puts the actor in a predetermined behavior pattern. A behavior is often (but not always) associated with the name of an animation. The descriptions for the game's predefined behaviors are listed in global/baseai.scr. Custom behaviors can also be defined with this command.

Syntax
 
$<actor_name> behavior <behavior_name> <arg1> <arg2> ...

Notes & examples
 
Unfortunately, I can only provide sketchy explanations on how behaviors work and how to use them since I don't fully understand them myself. From the examples I have seen in baseai.scr, behaviors are usually set within an actor's AI state.

However, behaviors are not likely to be used often compared to the other actor commands. A few of them (like Idle and Repel) are simple and can be very useful. What follows is a list of the game's configurable behaviors (as can be found in global/baseai.scr). I grouped them in several tables according to their usefulness and what I know or don't know about them.

Behaviors most likely to be useful:

The following 3 behaviors are simple to grasp and can be used in several situations.

Idle [animname]
Sets the name of the animation associated to an actor's Idle behavior.
Repel [animname] ["slide down" node] [max speed]
Sets the name of the animation, the name of the pathnode to "slide down" to and the maximum speed to at which to repel associated to this behavior. Repel is the behavior given to thugs when they repel from the ceiling windows in the Bank level.
PickupAndThrow [throwobject name]
Sets the name of the throwobject to use with this behavior. PickupAndThrow is the behavior given to the Manumit when it throws barrels at the player in the Subway level.
Jump [animname] [name of node to jump to]
Sets the name of the animation and the name of the pathnode associated to this behavior. Jump is the behavior that fighting actors (such as monsters and HC officers) are given when placed in the "jump" state. This can be used to change an actor's default jump animation when making him jump to a pathnode.

Repel behavior mini-tutorial:


Here's how you make thugs repel from a ledge with the Repel behavior. First, make a small rectangular room about 512 units high and add a ledge about 384 units above the floor.

Place a Monster_Thug_Magnum somewhere on that ledge and give him a targetname of "thug1" (any Monster_Thug_* and Monster_Guerilla_* type actor can be used for this because they all have a repel animation named "repel1").

Then, insert 2 info_pathnode entities. Place one on the ledge so the middle of its bounding box is lined up with the edge of the ledge brush. Place the other one on the floor and line up the side of it's bounding box so it's a bit farther ahead of the first one. Observe the green dashed line in Figure 1 and Figure 2 below to see how the pathnodes should line up.



Fig. 1
Fig. 2
Figure 1: Side View

Figure 2: Front View

Note:
The placement of the top pathnode is critical in order for this to work properly. If it's placed too far back on the ledge, the actor will be blocked by the ledge and won't be able to repel to the bottom node. If it's placed too far out, the actor won't be able to walk or run to it because he figures it's sitting in "mid-air".

The placement of the bottom pathnode is also important. Just make sure it's completely clear of the ledge when seen from above. If it's placed underneath the ledge, the actor will be blocked by the ledge when trying to repel down to it.


Now give the info_pathnode on the ledge a targetname of "node1" and give the one on the floor a targetname of "node2". Don't forget to add an info_player_start and a couple of light entities. Save your map and compile it.

Next, you will need to write the following script.

$thug1 thread thug1_repel_thread
waitForPlayer
end

thug1_repel_thread:
local.self ignoreall
local.self respondto weaponsound
local.self definestate weaponsound thug1_repel
pause

thug1_repel:
local.self runto $node1
waitFor local.self
local.self behavior Repel repel1 $node2 48
waitFor local.self
end


Here, I chose to define the custom "thug1_repel" state to be activated by a weaponsound event because this is convenient. Since the map is small and only has one room, no matter where you stand, just firing a shot in the air will activate the "thug1_repel" state and execute the commands under that label. The ignoreall command is to make sure the monster doesn't attack the player on sight.


PickupAndThrow behavior mini-tutorial:

Here's how you make a Manumit throw objects at you with the PickupAndThrow behavior. First, make a small rectangular room about 512 units wide by 512 units long and about 256 units high.

Place a Monster_Manumit close to the west wall and give him a targetname of "manu1".

Then, insert a func_throwobject entity in one of the corners of the room. Give it a model key and set the value to "can.def". Click on the Scale + and - buttons once in the entity dialog so the model shows up in the views. Place the bottom of the barrel flush with the floor and give it a targetname of "barrel1".

While in the editor's XY view (top) and with the barrel still selected, use the X key to make 3 eXact copies of it and place them in the remaining 3 corners. Name them "barrel2", "barrel3" and "barrel4" in clockwise order around the room. Take a look at Figure 1 below to see how the entities should be placed.



Fig. 1
Figure 1: Top View

Now add an info_player_start in the middle of the room and a couple of light entities. Save your map and compile it.

Next, you will need to write the following script.

$manu1 thread manu1_initstate
waitForPlayer
stuffcmd "god"
end

manu1_initstate:
local.self definestate sightenemy manu1_findbarrel
end

manu1_findbarrel:
local.self ifnear ThrowObject 8192 goto manu1_shootbarrel
print "I'm out of barrels so gotta whoop your ass!\n"
local.self copystate sightenemy default_sightenemy
local.self state sightenemy
end

manu1_shootbarrel:
local.barrel string local.other
local.self runto local.barrel
waitFor local.self
local.self behavior PickupAndThrow local.barrel
waitFor local.self
goto manu1_findbarrel
end


Here, I inserted the godmode cheat with the stuffcmd command to give the player a chance to observe what's going on in the game without being killed.

In the manu1_initstate thread, the definestate command is used to define a custom state thread (manu1_findbarrel) for the when the Manumit witnesses a sightenemy event (IOW, when he sees the player). So now, when the Manumit sees the player, the manu1_findbarrel thread is called instead of the default state thread defined for that event (global/baseai.scr::sightenemy).

The manu1_findbarrel thread uses the ifnear command to make the Manumit locate all the barrels (ThrowObject server class) within a distance of 8192 units (across the entire map IOW). So the condition will test true as long as there is a barrel left in the map and each time, the commands in the manu1_shootbarrel thread will be executed.

The manu1_shootbarrel thread is the part that handles the Manumit running up to the barrels, picking them up and throwing them at the player. The part to note is the use of the local.other variable. This is an implicit variable which contains the name of the activator of the current state. In this case, it's the targetname of the barrel found by the Manumit through the ifnear command. The value is passed to the variable local.barrel which is then used to tell the Manumit which barrel to run to, pick up and throw.

Once there are no barrels left (because they have all been thrown), the Manumit reverts to his default sightenemy state (copystate and state commands) and attacks the player.

Note:
The use of the copystate command is essential in this example because you cannot use a definestate command to define a state from within that state thread itself.


When you spawn in the map, the Manumit will be facing the wall and you will be sitting in the middle of the room. Stay right where you are so you don't get in his way when he runs for barrels from one corner of the room to the next. Just fire a shot in the air to make him turn around and see you. This will set things in motion. If you like, you can download the example map and script of this tutorial here.


Jump behavior mini-tutorial:

Here's how you can make an actor jump while using a different animation than its default jump animation with the Jump behavior. For this example, I'll use the hero_Blade actor because he has a cool "frontflip" animation especialy suitable for this.

First, make a small rectangular room about 512 units in all directions (width, length and height). Place a Hero_Blade entity at one end of the room and give him a targetname of "blade1".

Then, insert 2 info_pathnode entities. Place one at the opposite end of the room from where the actor is. Place the other one between the actor and the pathnode that's at the end of the room. Make sure the 3 entities line up with one another as can be seen in Figure 1 and Figure 2 below.



Fig. 1
Fig. 2
Figure 1: Side View

Figure 2: Top View

Now give the info_pathnode closest to the actor a targetname of "node1" and give the one farthest from him a targetname of "node2". Don't forget to add an info_player_start and a light entity. Save your map and compile it.

Next, you will need to write the following script.

$blade1 thread blade1_flip_thread
waitForPlayer
end

blade1_flip_thread:
local.self ignoreall
local.self respondto weaponsound
local.self definestate weaponsound blade1_flip
pause

blade1_flip:
local.self walkto $node1
waitFor local.self
local.self behavior Jump frontflip $node2
waitFor local.self
end


Here, I chose to define the custom "blade1_flip" state to be activated by a weaponsound event because this is convenient. Since the map is small and only has one room, no matter where you stand, just firing a shot in the air will activate the "blade1_flip" state and execute the commands under that label. The ignoreall command is to make sure the actor doesn't continuously run around like mad.

What will happen here is that when you fire a shot in the air, the Blade actor will walk to node1 and then jump from node1 to node2 while using a frontflip animation instead of his regular jump animation.


Behaviors less likely to be useful:

The following behaviors are harder grasp and less useful because most would not benefit much from being modified unless you really know what you're doing. These apply mostly to human type enemies like thugs.

Investigate [animname] [position]
Sets the name of the animation and default coordinates location associated to this behavior. Investigate is the behavior that make fighting actors (such as monsters and HC officers) walk or run to the location of a suspicious sound (weapon sounds for example) when they hear it.
FindCover [animname]
Sets the name of the animation associated to this behavior. FindCover is one of the behaviors that fighting actors (such as monsters and HC officers) are given when placed in the "duckandcover" state. It makes them search and go to pathnodes which have the COVER spawnflag set.
FindEnemy [animname]
Sets the name of the animation associated to this behavior. FindEnemy is one of the behaviors that fighting actors (such as monsters and HC officers) are given when placed in the "duckandcover" state. It makes them search for enemies.
AimAndShoot [number of shots to take]
Sets the number of weapon shots to take when given this behavior. AimAndShoot is one of the behaviors that fighting actors (such as monsters and HC officers) are given when placed in the "duckandcover" state. It controls how many shots they fire at an enemy when they stop moving and shoot.
AimAndMelee [number of shots to take]
Sets the number of punch or kick shots to take when given this behavior. AimAndMelee is one of the behaviors that fighting actors (such as thugs) are given when placed in the "duckandcover" state. It becomes active when an actor is close enough to an enemy for melee attack.
StrafeAttack [animname]
Sets the name of the animation associated to this behavior. StrafeAttack is one of the behaviors that fighting actors (such as thugs) are given when placed in the "duckandcover" state. It determines what animation to use during strafing attacks.
StrafeTo [animname] [position/node name]
Sets the name of the animation and default coordinates/pathnode location associated to this behavior. StrafeTo is one of the behaviors that fighting actors (such as thugs) are given when placed in the "duckandcover" state. It determines what animation to use and where to go during strafing attacks.


Behaviors specific to a certain type of actor:


The following behaviors would not benefit much from being modified either unless you really know what you're doing. These are used for specific actors like nautics, bats, rats and civilians (neutrals).

SwimCloseAttack [animname]
Sets the name of the animation associated to this behavior. SwimCloseAttack is one of the behaviors that Nautics are given when placed in the "swimmeleeattack" state. It determines what animation to use when the Nautic rushes an enemy before melee attack.
FlyCloseAttack [animname]
Sets the name of the animation associated to this behavior. FlyCloseAttack is one of the behaviors that Bats are given when placed in the "flymeleeattack" state. It determines what animation to use when the Bat rushes an enemy before melee attack.
Wander [animname] [maxdistance]
Sets the name of the animation and maximum distance to wander from a Rat's initial spawn location associated to this behavior. Wander is the behavior given to rats in their "idle" state.
WanderCloseAttack [animname]
Sets the name of the animation associated to this behavior. WanderCloseAttack is one of the behaviors that Rats are given when placed in the "wandermeleeattack" state. It determines what animation to use when the Rat rushes an enemy before melee attack.
Melee
Melee is one of the behaviors that Nautics, Bats and Rats are given when placed in the "swimmeleeattack", "flymeleeattack" and "wandermeleeattack" states respectively. It simply makes the actor melee attack.
Hide [animname]
Sets the name of the animation associated to this behavior. Hide is the behavior that non-fighting actors (civilians) are given when placed in the "hide" or "flee" state. It makes them cower when they hear certain sounds (weapon shots, pain, etc.) or get hurt.
FleeAndRemove [animname]
Sets the name of the animation associated to this behavior. FleeAndRemove is the behavior that non-fighting actors (civilians) are given when placed in the "flee" state. It makes them cower when they hear certain sounds (weapon shots, pain, etc.) or get hurt.


Behaviors not likely to be useful:


Since I haven't been able to find any examples for these, I can't figure out what they do and how they work. In fact, I can't even figure whether they work at all (except for the last 2). I have included them here for the sake of completeness but their use is definitely not recommended.

Flee [animname]
Sets the name of the animation associated to this behavior. I can't find any examples of this so experiment at your own risk.
GotoPathNode [animname] [position/node name]
Sets the name of the animation and default coordinates/pathnode location associated to this behavior. I can't find any examples of this so experiment at your own risk.
FireFromCover [animname]
Sets the name of the animation associated to this behavior. I can't find any examples of this so experiment at your own risk.
FireOnSight [animname]
Sets the name of the animation associated to this behavior. I can't find any examples of this so experiment at your own risk.
PlayAnim [animname]
Sets the name of the animation associated to this behavior. I can't find any examples of this so experiment at your own risk.
OpenDoor [direction of door]
Sets the direction a rotating door will open when the actor walks up to it. Not much reason to change this since the default works properly (door opens away from him).
ObstacleAvoidance
Probably sets an actor's obstacle avoidance AI. Pretty much default so I can't see any reason to use this.


canstrafe  
 
Function
 
This restores the ability to strafe to an actor. Normally used after the actor's strafing ability was previously taken away with the nostrafe command.

Syntax
 
$<actor_name> canstrafe

Notes & examples
 
This only works with actors which are capable of strafing by default like thugs, grunts and guerillas.


civilian  
 
Function
 
This changes an actor's default type to civilian type. The actor type determines how actors will react to each other. Civilian type actors are completely neutral to all the other actor types (they have no enemies).

Syntax
 
$<actor_name> civilian

Notes & examples
 
The civilian type is used for civilians. The default civilian type actors in SiN are:
  • All the Innocent_* and Neutral_* actors (except Neutral_Scientist and Neutral_LabWorker which are enemy types)
  • All cinematic_* actors (except cinematic_mancini and cinematic_thug which are enemy types).
  • Additionally, there are 4 actors in the Monster_* entity family which are civilian types: Monster_ConstructForeman, Monster_SecurityRover, Monster_WarehouseForeman and Monster_Thug_4Cinematic.
Possible actor types are: animal, civilian, enemy, friend, inanimate and monster. A chart of the reactions of actor type toward each other can be found in the notes of the enemy command.


clearenemy  
 
Function
 
This clears the actor's sightenemy state (if the actor is currently in that state). The actor will then revert to its default idle state.

Syntax
 
$<actor_name> clearenemy

Notes & examples
 
Clearing a state is nothing more than forcing the actor's currently running state thread to terminate. This command specifically terminates the state thread defined for the "sightenemy" event. The default state associated to the "sightenemy" event in global/baseai.scr is the 'sightenemy' thread for fighting actors (monsters and HardCorps officers) and the 'flee' thread for non-fighting actors like civilians.

A state can be also cleared by using the generic clearstate command which can clear any state. So, assuming that the sightenemy state is the actor's currently defined state for the "sightenemy" event, the clearenemy command does the same thing as using:

$actor clearstate sightenemy

For information on how to set custom states for actors, refer to the notes of the definestate command.


clearstate  
 
Function
 
This clears the actor's current state. The actor will then revert to its default idle state.

Syntax
 
$<actor_name> clearstate

Notes & examples
 
Clearing a state is nothing more than forcing the actor's currently running state thread to terminate.


copystate  
 
Function
 
This assigns a pre-defined state thread to an additional game event by associating it to the an event for which the state was originally defined. This makes it possible to assign the same state thread to several game events.

Syntax
 
$<actor_name> copystate <new_event> <defined_event>

Notes & examples
 
The <defined_event> specified in the command argument must be an event which has already been associated to a state thread with the definestate command. Here's an example:

Place a Neutral_Technician_Freeport actor in a map and name it "charlie". Add 2 info_pathnode's at floor level and name them "node1" and "node2". Then write the following script:

$charlie thread init_charlie end

init_charlie:
local.self ignoreall
local.self respondto use
local.self definestate use lets_take_a_walk
end

lets_take_a_walk:
local.self walkto $node1
waitFor local.self
local.self walkto $node2
waitFor local.self
end


Here, when you walk up to the actor and use him, the lets_take_a_walk thread is called and he will walk to the location of the $node1 pathnode and then walk to $node2. But he won't respond to any other event. Now let's say we want to make charlie do the same thing with a different type of event, a weapon sound for example, while preserving his presently set response to being used. The copystate command can be used for that. So by adding the following commands to the init_charlie thread:

init_charlie:
local.self ignoreall
local.self respondto use
local.self respondto weaponsound
local.self definestate use lets_take_a_walk
local.self copystate weaponsound use
end


Now, to make charlie do his little walk, you can either use him or produce a weapon sound event by firing a weapon close enough to him that he can hear it. What I just did with the copystate command was to tie the state thread that's already defined for the use event to the weaponsound event. A complete list of all the possible game events can be found in the notes of the respondto command.

This command is particularly useful when an event which was associated to a custom state (with the definestate command) needs to be re-assigned to the default state thread for that event from within the custom state thread itself. There is an example of this in the PickupAndThrow behavior mini-tutorial in the notes of the behavior command.


dead  
 
Function
 
This makes the actor dead. Specifically, it freezes the actor's model and makes it non-solid. After a while, the model will fade out of the game the same as if it had been killed by the player.

Syntax
 
$<actor_name> dead

Notes & examples
 
This command doesn't make the actor play it's death animation. If you need to kill an actor so the death animation will play, use the kill Entity command instead.

If the actor was previously given extra items (keys, coins, cards, etc) with the item Sentient command, it won't fade out right away. It will wait until the the player tries to loot him in the usual manner (standing over the actor and pressing the use key) before fading out.


definestate  
 
Function
 
This can be used to assign a custom state thread to a game event. This is the command that makes it possible to give actors custom AI. Once the state is defined, the state thread will be called when the actor witnesses the event that's tied to that thread.

Syntax
 
$<actor_name> definestate <event_name> <thread_label>

Notes & examples
 
A state thread is just a regular thread (owned by the actor) in which you can make the actor do a variety of things: walk to a certain place, play certain animations, attack another actor, etc. For an example of the use of this command, please refer to notes of the copystate command.

A complete list of all the possible game events can be found in the notes of the respondto command.


enemy  
 
Function
 
This changes an actor's default type to enemy type. The actor type determines how actors will react to each other. Enemy type actors are allies to monster type actors and other enemy type actors. They hate the player and friend type actors and will attack them if they have fighting capability. They are neutral to all the other actor types.

Syntax
 
$<actor_name> enemy

Notes & examples
 
The enemy type is generally used for human baddies. The default enemy type actors in SiN are:
  • All the thugs (Monster_Thug_* entities), grunts (Monster_Grunt_* and Monster_GruntCapt_* entities) and guerillas (Monster_Guerilla_* entities).
  • The worker slugs: Monster_ConstructWorker, Monster_MetalWorker and Monster_OilRigWorker.
  • The divers: Monster_Seabonite and Monster_SeaboniteCaptain.
  • Monster_DarkCaptain, Monster_EvilBlade, Monster_Mancini (unable to fight), MonsterSergeant and Monster_Sniper.
  • Boss_ThrallMaster, Monster_Beecadrone and Monster_Securton (exceptions to the "human" rule).
  • Neutral_Scientist (can fight) and Neutral_LabWorker (unable to fight).
  • cinematic_mancini, cinematic_thug and Hero_Elexis (all unable to fight).
Possible actor types are: animal, civilian, enemy, friend, inanimate and monster. Here's a chart of the reactions of actor types toward each other:

Actor type
Hates
Allied to
Neutral to
animal
player
none
enemy, friend, civilian, inanimate, monster
civilian
none
none
all
enemy
player, friend
enemy, monster
animal, civilian, inanimate
friend
enemy, monster
player, friend
animal, civilian, inanimate
inanimate
none
none
all
monster
player, friend
enemy, monster
animal, civilian, inanimate


Actor conversion chart:


The following chart resumes how actors will behave when changed from their default actor type to another type. These commands create a virtually unlimited number of possibilities and scenarios for player to actor and actor to actor interaction in the game.

Default actor type
When changed to
Will behave as follows
animal
civilian
Becomes neutral to the player and won't attack him.
animal
enemy
Will hate and attack friend actors as well as the player. This will also make friend actors hate and attack him.
animal
friend
Will hate and attack enemy and monster actors and leave the player alone. This will also make enemy and monster actors hate and attack him.
animal
monster
Will hate and attack friend actors as well as the player. This will also make friend actors hate and attack him.
animal
inanimate
Will turn inanimate and stop moving.
civilian
animal
Will hate the player but just cower when he sees him since civilians can't fight.
civilian
enemy
Will hate the player and friend actors but just cower when he sees them since civilians can't fight. This will also make friend actors hate and attack him.
civilian
friend
Will hate enemy and monster actors but just cower when he sees him since civilians can't fight. This will also make enemy and monster actors hate and attack him.
civilian
monster
Will hate the player and friend actors but just cower when he sees them since civilians can't fight. This will also make friend actors hate and attack him.
civilian
inanimate
Will turn inanimate and stop moving.
enemy
animal
Will still hate the player but will leave friend actors alone. This will also make friend actors leave him alone.
enemy
civilian
Becomes neutral to the player and friend actors and won't attack them. This will also make friend actors leave him alone. But if he is attacked by the player or by another actor (accidentally), he will retaliate against his attacker.
enemy
friend
Will hate and attack enemy and monster actors and fight alongside the player and friend actors. This will also make enemy and monster actors hate and attack him.
enemy
monster
No change. Will behave the same as before.
enemy
inanimate
Will turn inanimate and stop moving.
friend
animal
Will still hate the player but will leave friend actors alone. This will also make friend actors leave him alone.
friend
civilian
Becomes neutral to the player and friend actors and won't attack them. This will also make friend actors leave him alone. But if he is attacked by the player or by another actor (accidentally), he will retaliate against his attacker.
friend
enemy
Will hate and attack enemy and monster actors and fight alongside the player and friend actors. This will also make enemy and monster actors hate and attack him.
friend
monster
No change. Will behave the same as before.
friend
inanimate
Will turn inanimate and stop moving.
monster
animal
Will still hate the player but will leave friend actors alone. This will also make friend actors leave him alone.
monster
civilian
Becomes neutral to the player and friend actors and won't attack them. This will also make friend actors leave him alone. But if he is attacked by the player or by another actor (accidentally), he will retaliate against his attacker.
monster
enemy
No change. Will behave the same as before.
monster
friend
Will hate and attack enemy and monster actors and fight alongside the player and friend actors. This will also make enemy and monster actors hate and attack him.
monster
inanimate
Will turn inanimate and stop moving.
inanimate
animal
Changing the actor type of an inanimate actor won't change the way it behaves since it can't move. Since no actor types hate animal actors, this produces no change.
inanimate
civilian
Changing the actor type of an inanimate actor won't change the way it behaves since it can't move. Since no actor types hate civilian actors, this produces no change.
inanimate
enemy
Changing the actor type of an inanimate actor won't change the way it behaves since it can't move. This will, however, make friend actors hate and attack it.
inanimate
friend
Changing the actor type of an inanimate actor won't change the way it behaves since it can't move. This will, however, make enemy and monster actors hate and attack it.
inanimate
monster
Changing the actor type of an inanimate actor won't change the way it behaves since it can't move. This will, however, make friend actors hate and attack it.


eyeoffset  
 
Function
 
This can be used to change an actor's default eye position offset. The eye position offset is relative to the origin of the actor's model.

Syntax
 
$<actor_name> eyeoffset "<X Y Z>"

Notes & examples
 
In order to understand this, just consider an actor's vision as a single eye that is positioned somewhere inside the actor's model. By default, it is positionned around the actor's head. Since the origin of the model is normally at the bottom center of it's bounding box, the eye position is relative to that coordinate.

Let's take a common thug for example: his default eye position offset is "0 0 64". Take a look at Figure 1 below to see what this means:

Fig. 1
Figure 1: Eye position offset

So with this command, you can modify the position an actor's eye. By default, it is located around the actor's head so his vision will be normal. But if you want, you can offset his eye so his vision will be completely outside it's "body" and in a completely different room anywhere in the map.

You can also control an actor's maximum vision range with the visiondistance command or the width of his field of view with the fov command.



fly  
 
Function
 
This specifies an actor as being able to fly. The net effect will be that he won't be affected by gravity and just float when he moves around.

Syntax
 
$<actor_name> fly

Notes & examples
 
This command is used for actors like pigeons (Animals_Pigeon) and bats (Animals_Bat and Animals_BatLow) which can fly. This is already set by default for bats in global/bat.scr and global/bat_nice.scr.

However, this is not set by default for pigeons which basically have no AI. So the command is useful mainly for those. For an example on the use of this command, see the notes of the Animals_Pigeon entity in the entity docs.

There are 2 other commands of the same type for actors: noland and swim.


forwardspeed  
 
Function
 
This gives an actor a constant forward speed of displacement completely independent of animations, walking, running, jumping, etc.

Syntax
 
$<actor_name> forwardspeed <value>

Notes & examples
 
This command is meant to be used for actors which can fly such as bats and pigeons or actors which can swim such as fishes. It can be particularly useful for changing those actor's default flying or swimming speed. Not meant for regular "land" actors which can walk, run and jump.

For an example on the use of this command, see the notes of the Animals_Pigeon entity in the entity docs.


fov  
 
Function
 
This sets the angle of the actor's field of view. The default is the same as the player's default FOV: 90 degrees.

Syntax
 
$<actor_name> fov <angle>

Notes & examples
 
You can also control an actor's maximum vision range with the visiondistance command or the position offset of his vision with the eyeoffset command.


friend  
 
Function
 
This changes an actor's default type to friend type. The actor type determines how actors will react to each other. Friend type actors are allies to the player and other friend type actors. They hate enemy and monster type actors and will attack them if they have fighting capability. They are neutral to all the other actor types.

Syntax
 
$<actor_name> friend

Notes & examples
 
The friend type is used for actors which are allies to the player. The default friend type actors in SiN are:
  • All the Hero_* entities except Hero_Elexis (which is an enemy type).
  • All the HardCorps officers (Hero_HCOfficer1_* and Hero_HCOfficer2_* entities) can fight except Hero_HCOfficer1_NoWeapon and Hero_HCOfficer2_NoWeapon.
  • Hero_Blade, Hero_JC and all the Hero_Military_* actors are unable to fight.
Possible actor types are: animal, civilian, enemy, friend, inanimate and monster. A chart of the reactions of actor type toward each other can be found in the notes of the enemy command.


idle  
 
Function
 
This sets the actor's default animation when in the idle state. The animation name used in the command argument must be one from the list of animation names in the actor's .def file.

Syntax
 
$<actor_name> idle <anim_name>

Notes & examples
 
For more information on states, see the definestate and state commands.


ifcanhideat  
 
Function
 
Conditional test command. If the actor can hide at the info_pathnode entity specified in the command argument, the command that follows that argument will be executed.

Syntax
 
$<actor_name> ifcanhideat <pathnode_name> <command>

Notes & examples
 
The <command> argument can be any valid SinScript command.

Note:
I haven't really tested this command so I don't really know how an actor determines whether he can hide at a given pathnode or not. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



ifcanmeleeattack  
 
Function
 
Conditional test command. If the actor can melee attack, the command used as the argument will be executed.

Syntax
 
$<actor_name> ifcanmeleeattack <command>

Notes & examples
 
The <command> argument can be any valid SinScript command.

Note:
I haven't really tested this command. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



ifcanshoot  
 
Function
 
Conditional test command. If the actor has a clear line of sight to shoot at his enemy while attacking, the command used as the argument will be executed.

Syntax
 
$<actor_name> ifcanshoot <command>

Notes & examples
 
The <command> argument can be any valid SinScript command.

Note:
I haven't really tested this command. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



ifcanstrafeattack  
 
Function
 
Conditional test command. If the actor is able to strafe attack, the command used as the argument will be executed.

Syntax
 
$<actor_name> ifcanstrafeattack <command>

Notes & examples
 
The <command> argument can be any valid SinScript command.

Note:
I haven't really tested this command. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



ifenemyvisible  
 
Function
 
Conditional test command. If the actor can see an enemy, the command used as the argument will be executed.

Syntax
 
$<actor_name> ifenemyvisible <command>

Notes & examples
 
The <command> argument can be any valid SinScript command.

Note:
I haven't really tested this command. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



ifenemywithin  
 
Function
 
Conditional test command. If, from where the actor is standing, there's an enemy within the distance specified in the command argument, the command that follows that argument will be executed.

Syntax
 
$<actor_name> ifenemywithin <distance> <command>

Notes & examples
 
The <command> argument can be any valid SinScript command.

Note:
I haven't really tested this command. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



ifnear  
 
Function
 
Conditional test command. If, from where the actor is standing, there's an entity class (server classname) within the distance specified in the command argument, the command that follows that argument will be executed.

Syntax
 
$<actor_name> ifnear <server_classname> <distance> <command>

Notes & examples
 
For an example of the use of this command, refer to the PickupAndThrow behavior mini-tutorial in the notes of the behavior command.

Note:
Do not confuse an entity's server classname with the "classname" key of the entity as set in the map editor. Those are 2 entirely different things. In order to determine the server classname of an entity, open the entity's .def file with a text editor and look for the "server classname ***" command. That is the name you must use in this command.



ignore
 
Function
 
This makes an actor ignore one or several specific game events. Actors have a set of predefined AI states which are activated by these events. By making an actor ignore a certain event, it prevents him from calling the state thread defined as the response to that particular game event in his AI script. By default, actors are set to respond to all events.

Syntax
 
$<actor_name> ignore <game_event1> <game_event2> ...

Notes & examples
 
Game events range from many different types of game sounds, seeing an enemy, getting hurt, etc. One or several event names can be specified as the command argument(s). A complete list of all the game events (as listed in global/baseai.scr) can be found in the notes of the respondto command which is the opposite of this command.


ignoreall
 
Function
 
This makes an actor ignore all game events. Actors have a set of predefined AI states which are activated by these events. By making an actor ignore all events, it "turns off" all its responses and effectively turns it into a "puppet". By default, actors are set to respond to all events.

Syntax
 
$<actor_name> ignoreall

Notes & examples
 
Game events range from many different types of game sounds, seeing an enemy, getting hurt, etc. One or several event names can be specified as the command argument(s). A complete list of all the game events (as listed in global/baseai.scr) can be found in the notes of the respondto command.

The actor's responses can be reactivated partially with the respondto or respondtosounds commands or integrally with the respondtoall command which is the opposite of this command.


ignoresounds  
 
Function
 
This makes an actor ignore all sound events. Actors have a set of predefined AI states which are activated by these events. By making an actor ignore all sound events, it "turns off" all its responses to sound events and effectively "makes him deaf". By default, actors are set to respond to all sound events.

Syntax
 
$<actor_name> ignoresounds

Notes & examples
 
A complete list of all the game's sound events (as listed in global/baseai.scr) can be found in the notes of the respondto command.

The actor's responses to sound events can be reactivated partially with the respondto command or integrally with the respondtoall command or respondtosounds command which is the opposite of this command.


inanimate
 
Function
 
This changes an actor's default type to inanimate type. The actor type determines how actors will react to each other. Inanimate type actors are completely neutral to all the other actor types (they have no enemies).

Syntax
 
$<actor_name> inanimate

Notes & examples
 
The inanimate type is used for inanimate objects which need to react to players when used. Examples of inanimate actors are sinks (world_sink entity), toilets (world_toilet entity) and urinals (world_urinal entity).

Possible actor types are: animal, civilian, enemy, friend, inanimate and monster. A chart of the reactions of actor type toward each other can be found in the notes of the enemy command.


jumpto  
 
Function
 
Makes an actor jump from where he's currently standing to the location of an entity. The entity specified in the command argument must be located in a place where the actor is physically able to jump to (IOW not in mid-air).

Syntax
 
$<actor_name> jumpto <entity_name>

Notes & examples
 
Virtually any kind of entity can be specified in the command argument but info_pathnode entities are typically used for making actors jump from one place to another in maps. It is also possible to make actors walk or run to the location of an entity with the walkto and runto commands.

This command can only work with actors which have jumping animations.

The actor will play his default jump animation while jumping but it's possible to change the animation used by an actor while jumping. For an example of this, refer to the Jump behavior mini-tutorial in the notes of the behavior command.

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



killthread  
 
Function
 
This sets or changes the value of the actor entity's "killthread" key to the string specified in the command argument. The value must be the name of an existing thread in the script.

Syntax
 
$<actor_name> killthread <thread_name>

Notes & examples
 
The "killthread" key sets the name of the thread to call when the actor dies. All actors support this key except Animals_* entities.


lookat  
 
Function
 
This makes an actor turn to look at the entity specified in the command argument.

Syntax
 
$<actor_name> lookat <entity_name>

Notes & examples
 

meleedamage  
 
Function
 
This sets the amount of damage the actor inflicts on his enemy per melee attack (IOW with each punch, kick, bite or scratch). Only works with actors which can melee attack (attack without using a weapon IOW).

Syntax
 
$<actor_name> meleedamage <value>

Notes & examples
 
You can also set the range at which an actor can melee attack with the meleerange command.


meleerange  
 
Function
 
This sets the maximum distance at which an actor can melee attack an enemy. Only works with actors which can melee attack (attack without using a weapon IOW).

Syntax
 
$<actor_name> meleerange <distance>

Notes & examples
 
You can also set the damage the actor inflicts with his melee attack by using the meleedamage command.


monster  
 
Function
 
This changes an actor's default type to monster type. The actor type determines how actors will react to each other. Monster type actors are allies to enemy type actors and other monster type actors. They hate the player and friend type actors and will attack them if they have fighting capability. They are neutral to all the other actor types.

Syntax
 
$<actor_name> monster

Notes & examples
 
The monster type is used for mutant baddies. The default monster type actors in SiN are:
  • Boss_EonAndPeon, Monster_Bachrodai, Monster_Manumit, Monster_Nautic, Monster_Peon, Monster_Pinphat, Monster_Reconah, Monster_Vultorn and Monster_VultornSmall.
  • Monster_Eon which is unable to fight (or do much else for that matter).
Possible actor types are: animal, civilian, enemy, friend, inanimate and monster. A chart of the reactions of actor type toward each other can be found in the notes of the enemy command.


nochatter  
 
Function
 
This turns off an actor's random chatter while in idle state.

Syntax
 
$<actor_name> nochatter

Notes & examples
 
Many actors, while in idle state, will talk and say a certain number of sentences at random. An example of this are the Neutral_Technician_* type actors. They say things like: "Hey Bob, did you check those lateral sensors?", etc. This command simply turns this off. It doesn't turn off the actor's normal pain and death sounds however.


nodeathfade  
 
Function
 
This prevents the actor's body from fading out automatically after dying. The body will only fade out once the player has looted the actor's default items (usually armor) in the usual way (standing over him and pressing the use key).

Syntax
 
$<actor_name> nodeathfade

Notes & examples
 
The actor will wait to fade out provided he has at least one default item to loot.

Note:
If you give actors additional items (keys, cards, etc.) to give away once they die with the item Sentient command, you don't need to use the nodeathfade command to prevent them from fading away before the player tries to loot them. Actors which have been given extra items don't death fade by default.

The game performs a "useless check" at regular time intervals to remove useless dead bodies. Giving an actor an extra item or using the nodeathfade command prevent it's body from being removed by a "useless check" or by a remove_useless command (which is a manual "useless check") until the player loots him.



noland  
 
Function
 
This specifies an actor as not being able to walk on land. The net effect will be just that: he won't be able to walk on land.

Syntax
 
$<actor_name> noland

Notes & examples
 
This command is used for actors like fishes (Animals_Fish and Animals_TropicalFish_*) and Nautics (Monster_Nautic) which are meant to be underwater only creatures. This is already set by default for fishes in global/fish.scr and Nautics in global/nautic.scr.

There are 2 other commands of the same type for actors: fly and swim.


nostrafe  
 
Function
 
This takes away the ability to strafe from an actor. The actor's strafing ability can be restored afterwards with the canstrafe command.

Syntax
 
$<actor_name> nostrafe

Notes & examples
 
This only works with actors which are capable of strafing by default like thugs, grunts and guerillas.


painthreshold  
 
Function
 
This sets the minimum amount of pain that must be inflicted in one shot to the actor in order for him to witness a pain event and be placed in the pain state. The default pain state thread for actors (global/baseai.scr::pain) is what makes the actor play its various pain animations.

Syntax
 
$<actor_name> painthreshold <value>

Notes & examples
 
The actual threshold value is dependent on the current skill of the game and is calculated as follows:

<value_argument> * <current_skill> * 0.66 = threshold value

Note:
Do not confuse an actor's pain state and damage. If you continuously inflict damage to the actor which is below the default threshold level or the level set by this command, the damage is still cumulated and the actor will eventually die. The only difference is that he will never play its pain animations while you're hurting him.



releasenode  
 
Function
 
This makes an actor release a pathnode previously reserved for him by the reservenode command.

Syntax
 
$<actor_name> releasenode <pathnode_name>

Notes & examples
 
Note:
I haven't really tested this command so I don't know how this works or even whether it works or not. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



remove_useless  
 
Function
 
This forces an immediate "useless check" on an actor independent of the game's own automatic "useless check" which is run at regular time intervals during gameplay.

Syntax
 
$<actor_name> remove_useless

Notes & examples
 
A forced "useless check" does the same thing as an automatic periodical "useless check" which is to check for and fade out dead bodies of actors which have died since the last "useless check". If the actor is dead, this command will automatically fade out and remove his body from the game unless:
  • The actor was initially given an additional item (keys, cards, etc.) with the item Sentient command and the body hasn't been looted by the player yet.
  • The actor was previously issued a nodeathfade command and the body hasn't been looted by the player yet.

reservenode  
 
Function
 
This apparently makes an actor reserve a pathnode to use it for hiding and ducking.

Syntax
 
$<actor_name> reservenode <pathnode_name>

Notes & examples
 
To make an actor release a pathnode reserved for him so it will become available to other actors, use the releasenode command.

Note:
I haven't really tested this command so I don't know how this works or even whether it works or not. Since this is an advanced AI command, I assumed that it's usefulness in common scripts might be somewhat limited. Experiment.



respondto
 
Function
 
This makes a game actor respond to one or several specific game events. Actors have a set of predefined AI states which are activated by these events. By making an actor respond to a certain event, it enables him to call the state thread defined as the response to that particular game event. By default, actors are set to respond to all events and this command is normally used to re-enable an actor's response to one or several specific events after it was previously disabled by either the ignore, ignoresounds or ignoreall commands.

Syntax
 
$<actor_name> respondto <game_event1> <game_event2> ...

Notes & examples
 
Game events range from many different types of game sounds, seeing an enemy, getting hurt, etc. One or several event names can be specified as the command argument(s). The <game_event> argument can be any event chosen from SiN's list of possible game events as listed in global/baseai.scr:

Common events:

These are the game's most common events.

idle
An "idle" event is witnessed by a player when no actual event has occured or right after the completion of a state caused by another event. It is basically a "null" event and puts the actor in the "idle" state by default.
twitch
The "twitch" event is called periodically by the "idle" state (while no other event is occuring). This briefly puts the actor in the "twitch" state which plays a short twitch animation before going back to the "idle" state.
opendoor
An "opendoor" event is witnessed by an actor when he walks up to a door and is blocked while trying to walk or run through it. It puts the actor in the "opendoor" state by default (which in turn gives him the OpenDoor behavior to open the door).
activate
An "activate" event is witnessed by an actor when he is triggered either by an entity that targets him or by the trigger or doActivate commands. It puts enemy type actors in the "attackentity" state by default.
use
A "use" event is witnessed by an actor when he is used by the player or by the doUse command. It puts enemy type actors in the "attackentity" state by default.


Attack related events:


These events are generated when actors see an enemy and get into a fight.

sightenemy
A "sightenemy" event is witnessed by an actor when he sees what he considers to be his enemy. If the actor is an enemy or monster type, the event occurs if he sees the player or a friend type actor. If the actor is a friend type, the event occurs if he sees an enemy or monster type actor. It puts enemy type actors in the "sightenemy" state, friend type actors in the "duckandcover" state and civilian type actors in the "flee" state by default.
range_far
A "range_far" event is witnessed by an actor when the enemy he is attacking is more than 1000 map units away from him.
range_mid
A "range_mid" event is witnessed by an actor when the enemy he is attacking is less than 1000 map units (but more than 500 units) away from him.
range_near
A "range_near" event is witnessed by an actor when the enemy he is attacking is less than 500 map units (but more than 120 units) away from him.
range_melee
A "range_melee" event is witnessed by an actor when the enemy he is attacking is less than 120 map units away from him.
enemydead
A "enemydead" event is witnessed by an actor when the enemy he is attacking dies.


Damage related events:


These events are generated when actors sustain damage.

pain
A "pain" event is witnessed by an actor when he is hurt by something in the game. It puts the actor in the "pain" state by default.
health_ok
A "health_ok" event is witnessed by an actor when his current health is less than 75% (but more than 50%) of his maximum health.
health_med
A "health_med" event is witnessed by an actor when his current health is less than 50% (but more than 25%) of his maximum health.
health_low
A "health_low" event is witnessed by an actor when his current health is less than 25% (but more than 10%) of his maximum health.
health_danger
A "health_danger" event is witnessed by an actor when his current health is less than 10% of his maximum health.
killed
A "killed" event is witnessed by an actor when he is killed. It triggers one of the actor's death animations (provided the actor has one or more death animations defined in its .def file).


Sound events:


These are all the sound type events that can occur in the game. An actor can be made to ignore all sound events with the ignoresounds command or respond to all sound events with the respondtosounds command.

weaponsound
A "weaponsound" event is witnessed by an actor when he hears the sound of a weapon being fired (punch and kick sounds don't apply). It puts enemy and friend type actors in the "urgent_investigate" state and civilian type actors in the "flee" state by default. The sound can be heard by the actor if its source is within a range of 840 map units.
breakingsound
A "breakingsound" event is witnessed by an actor when he hears the sound of something breaking (glass, wood, etc.). It puts enemy and friend type actors in the "urgent_investigate" state and civilian type actors in the "hide" state by default. The sound can be heard by the actor if its source is within a range of 512 map units.
deathsound
A "deathsound" event is witnessed by an actor when he hears a death sound. It puts enemy and friend type actors in the "urgent_investigate" state and civilian type actors in the "hide" state by default. The sound can be heard by the actor if its source is within a range of 512 map units.
painsound
A "painsound" event is witnessed by an actor when he hears a pain sound. It puts enemy and friend type actors in the "investigate" state and civilian type actors in the "hide" state by default. The sound can be heard by the actor if its source is within a range of 512 map units.
mutantsound
A "mutantsound" event is witnessed by an actor when he hears a Mutant sound (Manumit, Bachrodai, Vultorn, etc.). It puts enemy and friend type actors in the "urgent_investigate" state and civilian type actors in the "hide" state by default. The sound can be heard by the actor if its source is within a range of 256 map units.
doorsound
A "doorsound" event is witnessed by an actor when he hears the sound of a door opening or closing. It puts enemy type actors in the "investigate" state by default. The sound can be heard by the actor if its source is within a range of 320 map units.
movementsound
A "movementsound" event is witnessed by an actor when he hears footsteps or a jumping sound. It puts an enemy type actor in the "investigate" state by default. The sound can be heard by the actor if its source is within a range of 256 map units.
voicesound
A "voicesound" event is witnessed by an actor when he hears the sound an actor talking. It puts enemy and friend type actors in the "investigate" state by default. The sound can be heard by the actor if its source is within a range of 256 map units.
radiosound
A "radiosound" event is witnessed by an actor when he hears the sound of radio chatter. It puts enemy and friend type actors in the "investigate" state by default. The sound can be heard by the actor if its source is within a range of 8192 map units (anywhere in the map IOW).
machinesound
A "machinesound" event is witnessed by an actor when he hears a machinery sound (generators, fans, lifts, etc.). The sound can be heard by the actor if its source is within a range of 512 map units.


respondtoall
 
Function
 
This makes an actor respond to all game events. Actors have a set of predefined AI states which are activated by these events. By making an actor respond to all events, it "turns on" all its responses. By default, actors are set to respond to all events.

Syntax
 
$<actor_name> respondtoall

Notes & examples
 
Game events range from many different types of game sounds, seeing an enemy, getting hurt, etc. One or several event names can be specified as the command argument(s). A complete list of all the game events (as listed in global/baseai.scr) can be found in the notes of the respondto command.

This command is normally used to re-enable an actor's response to all possible game events after they were previously disabled either partially by the ignore or ignoresounds commands or integrally with the ignoreall command which is the opposite of this command.


respondtosounds  
 
Function
 
This makes an actor respond to all sound events. Actors have a set of predefined AI states which are activated by these events. By making an actor respond to all sound events, it "turns on" all its responses to sound events and effectively "restores its hearing". By default, actors are set to respond to all sound events.

Syntax
 
$<actor_name> respondtosounds

Notes & examples
 
A complete list of all the game's sound events (as listed in global/baseai.scr) can be found in the notes of the respondto command.

This command is normally used to re-enable an actor's response to sound events after they were previously disabled either partially by the ignore command or integrally with the ignoreall command or the ignoresounds command which is the opposite of this command.


runto
 
Function
 
Makes an actor run from where he's currently standing to the location of an entity. The entity specified in the command argument must be located in a place where the actor is physically able to run to (IOW not in mid-air).

Syntax
 
$<actor_name> runto $<entity_name>

Notes & examples
 
Virtually any kind of entity can be specified in the command argument but info_pathnode entities are typically used for making actors run from one place to another in maps. It is also possible to make actors walk or jump to the location of an entity with the walkto and jumpto commands.

This command can only work with actors which have running animations.


script  
 
Function
 
External script call. This makes the actor call and own an external script. Used mainly for custom AI scripts in which there is a single thread owned by the actor.

Syntax
 
$<actor_name> script <path/script_filename>

Notes & examples
 
The most current use of this command is in the actor's .def file. For example, if you open the Monster_Thug_AssaultRifle actor's .def file (thug_ass.def) with a text editor, in the SERVER Initialization Commands section, there is the command:

server script global/enemy.scr

This makes the actor call and own an instance of the thread in the "global/enemy.scr" script. It's effectively the actor's default AI script in which his responses and default states are set. The state threads defined in enemy.scr by the definestate command point to threads inside the global/baseai.scr script file. This is the basic AI script scheme for all actors in SiN.


shotsperattack  
 
Function
 
This sets the maximum amount of shots fired per attack cycle while the actor is in the attack state.

Syntax
 
$<actor_name> shotsperattack <value>

Notes & examples
 
This only works for fighting actors with weapons.


state
 
Function
 
This puts the actor in a predefined AI state. States are in fact threads which are called by an actor when he witnesses a game event. All the actor's basic state threads are in the global/baseai.scr script.

Syntax
 
$<actor_name> state <state_name>

Notes & examples
 
Since states are basically threads, using this command is equivalent to making the actor call a thread which is named after the state. For this reason, completely new states with user defined names can be created from scratch to modify an actor's response to a particular game event. These custom AI states can be defined by using the definestate command and writing a custom state thread.

To clear the state in which the actor was put in with this command, use the clearstate command.


swim  
 
Function
 
This specifies an actor as being able to swim. The net effect will be that he won't be affected by gravity and just float when he moves around plus he can stay underwater for an unlimited amount of time without drowning.

Syntax
 
$<actor_name> swim

Notes & examples
 
This command is used for actors like fishes (Animals_Fish and Animals_TropicalFish_*), Nautics (Monster_Nautic) and Seabonite divers (Monster_Seabonite & Monster_SeaboniteCaptain) which are meant to swim underwater. This is already set by default for fishes in global/fish.scr, for Nautics global/nautic.scr and for Seabonites in global/seabonite.scr.

There are 2 other commands of the same type for actors: fly and noland.


thread
 
Function
 
Thread call. This makes the actor call and own an instance of a thread in the script. Used mainly for custom AI threads to set an actor's responses and custom states.

Syntax
 
$<actor_name> thread <thread_name>

Notes & examples
 
Many instances of the same thread can be called by several different actors in the game. When an instance of a thread is called by an actor, the implicit variable local.self is automatically set to the targetname of the actor which called that particular instance of the thread. For example, if you have 2 Neutral_Technican_Freeport actors in your map and you name one "charlie" and the other "bob", in the script:

$charlie thread init_techies
$bob thread init_techies
end

init_techies:
local.self ignoreall
local.self anim usepanel1
end


In the instance of the thread called by "charlie", the value of local.self is "$charlie" and in the instance of the thread called by "bob", the value of local.self is "$bob".


turnto
 
Function
 
Makes an actor turn to the angle specified in the command argument.

Syntax
 
$<actor_name> turnto <angle>

Notes & examples
 
The angle argument is in degrees and is consistent with the angle values given to orient entities in the map editor.

Note:
Do not confuse this command with the turnto Camera command. It is an entirely different command with a different function even though it has the same name and some similarities.



visiondistance  
 
Function
 
This sets the maximum distance at which an actor can see. Useful for setting the distance at which a monster will spot the player in a large room.

Syntax
 
$<actor_name> visiondistance <distance>

Notes & examples
 
You can also control the width of an actor's field of view with the fov command or the position offset of his vision with the eyeoffset command.


walkto
 
Function
 
Makes an actor walk from where he's currently standing to the location of an entity. The entity specified in the command argument must be located in a place where the actor is physically able to walk to (IOW not in mid-air).

Syntax
 
$<actor_name> walkto $<entity_name>

Notes & examples
 
Virtually any kind of entity can be specified in the command argument but info_pathnode entities are typically used for making actors walk from one place to another in maps. It is also possible to make actors run or jump to the location of an entity with the runto and jumpto commands.

This command can only work with actors which have walking animations.