The Pawn entity is used to make scriptable friendly nonplayer characters. They work in conjunction with the ScriptPoint entity, which provides paths for the Pawn to travel on.
The fields for the Pawn entity are:
Field | Description |
---|---|
Angle | direction pawn will face when spawned |
ChangeMaterial | name of section containing material change info (see Material.ini) |
ConvLayout | name of layout file used for conversation instead of default layout |
ConvOrder | name of conversation order to run at the start of a conversation |
ConvScriptName | name of script file used for conversations |
HideFromRadar | If true then does not show on radar |
PawnType | name of the pawn type as defined in Pawn.ini |
ScriptName | name of the script file used by this pawn |
SpawnOrder | name of the Script Order run at spawn time |
SpawnPoint | name of a ScriptPoint associated with this pawn |
SpawnTrigger | trigger name used to spawn this entity |
szEntityName | name of this entity |
The details of the Pawn's actor are defined in a file called Pawn.ini, which is stored in the install folder. Each Pawn type is defined by a section in the file defined by enclosing its name in square brackets. A Pawn type called 'BigRat' would be defined by a section like the following:
[BigRat] |
|
actorname = rat.act |
name of actor to use |
actorrotation = 0 180 0 |
rotation (in degrees) to stand actor up |
actorscale = 1 |
scale of actor |
actoralpha = 255 |
initial alpha of actor, default is 255 |
animationspeed = 1 |
multiplier for speed of actor animation |
fillcolor = 255 255 255 |
color of actor |
ambientcolor = 255 255 255 |
brightness of actor |
subjecttogravity = true |
true if subject to gravity |
boundingboxanimation = idle1 |
name of animation used for size of bounding box |
shadowsize = 0 |
size of shadow bitmap |
shadowalpha = 128 |
transparency of shadow bitmap |
shadowalphamap = shadowalpha.bmp |
name of alpha bitmap for shadow |
shadowbitmap = shadow.bmp |
name of bitmap used as shadow |
projectedshadows = false |
whether this pawn casts a projected shadow or not |
stencilshadows = false |
whether this pawn casts stencil shadows or not |
icon = set:pawns image:rat |
CEGUI image used as the conversation icon |
speakbone = head |
name of the bone in the actor at which the speak sounds will be played |
environmentmapping = true |
if true then apply environment mapping to actor material |
allmaterial = true |
if true apply environment mapping to all actor materials |
percentmapping = 75 |
percentage of mapping to apply to material (0 to 100) |
percentmaterial = 75 |
percentage of material to use while mapping (0 to 100) |
icon
is optional and can be used to identify the Pawn on the conversation
screen.
speakbone
is the name of the bone in the pawn actor at which the speak sounds
will be played. If no bone name is provided the sound will be positioned at the bottom of
the pawn actor.
If environmentmapping
is set to true
and allmaterial
is false
then only those actor materials whose name starts with env_
will have environment mapping applied to them.
If actoralpha
is not specified a value of 255 is used.
To make a Pawn with no bounding box and that is invisible (used for camera movement) use
boundingboxanimation = nocollide
Shadows are disabled for Pawns of this type.
See the document on Pawn Scripting for details on controlling the Pawn at run time.
You can define weapons in the Pawn.ini file that can be attached to the Pawn actor similar to the 3rd person weapons for the player. These weapon actors must have the same skeleton as the Pawn actor and require no animations, as they are animated by the Pawn actor's current animation. A Pawn weapon called '9mmAR' would be defined as follows
[9mmAR] |
|
type = weapon |
mark this definition as a pawn weapon |
actorname = 9mmar.act |
name of actor to use |
actorrotation = 0 180 0 |
rotation (in degrees) to stand actor up |
actorscale = 1 |
scale of actor |
fillcolor = 255 255 255 |
color of actor |
ambientcolor = 255 255 255 |
brightness of actor |
environmentmapping = true |
if true then apply environment mapping to actor material |
allmaterial = true |
if true apply environment mapping to all actor materials |
percentmapping = 75 |
percentage of mapping to apply to material (0 to 100) |
percentmaterial = 75 |
percentage of material to use while mapping (0 to 100) |
If environmentmapping
is set to true
and allmaterial
is false
then only those actor materials whose name starts with env_
will have environment mapping applied to them.
You can define accessories in the Pawn.ini file that can be attached to the other
actor similar to the 3rd person weapons for the player. These accessory
actors must have the same skeleton as the actor they get attached to and require no
animations, as they are animated by the actor's current animation. The definition is
the same as for Pawn weapons except for the type
value which has to be
accessory
.