Setup + Movement + Rotation + Jumping + Animation + Triggers + Distance Orders + Collision Orders + Called Orders + Points And Orders + Flags + Timers + Attributes + Health + Enemy + Sound + Special Effects + Debug + Misc
Scale(float Scale); Scale(float ScaleX, float ScaleY, float ScaleZ); |
Scale the pawn actor size by Scale.
If the actor was scaled in the definition in Pawn.ini then it will be scaled by that
amount times Scale. If the pawn has a weapon actor attached it is also scaled in the same fashion. |
SetScale(float Scale); SetScale(float ScaleX, float ScaleY, float ScaleZ); |
Set the scale of the pawn actor to Scale. |
SetFOV(float Angle); SetFOV(float Angle, string BoneName); |
Set the field of view of the Pawn to be Angle degrees.
This is the total number of degrees from left to right that the Pawn can see. The center of the FOV is the direction the Pawn is facing. |
StepHeight(float Distance); |
Set the step height of the Pawn's actor to Distance.
If Distance is zero or less then step up is disabled for the actor. |
Gravity(bool State); |
If State is true then actor is subject to gravity (default condition).
If it is false then the actor is unaffected by gravity. |
IsPushable(bool Flag); |
If Flag is true then the Pawn actor can be pushed by the player. |
IsVehicle(bool Flag); |
If Flag is true then the Pawn actor will be made a vehicle. |
SetLODDistance(float Distance1, float Distance2, float Distance3, float Distance4, float Distance5); |
Set the LOD distances used for the Pawn's actor. This overrides the default LOD distances already defined elsewhere. |
BoxWidth(float Width); |
Set the Pawn actor's bounding box width and depth to Width. The height remains unchanged. |
BoxHeight(float Height); |
Set the Pawn actor's bounding box height to Height. The width remains unchanged. |
SetNoCollision(); |
Set the actor's bounding box so that no collisions with it will occur.
The actor will appear in the level but not as a solid object. |
SetCollision(); |
Set the actor's bounding box so collisions will occur with other objects. |
Move(string Animation, float Speed, float Distance, float AngleX, float AngleY, float AngleZ, string Sound); |
Move the actor in the direction obtained by adding AngleX,
AngleY, and AngleZ to the forward direction for Distance texels at Speed texels per second
while playing the actor's Animation animation. |
MoveForward(string Animation, float Speed, float Distance, string Sound); |
Move the actor forward for Distance texels at Speed texels per second while
playing the actor's Animation animation. |
MoveBackward(string Animation, float Speed, float Distance, string Sound); |
Move the actor backward for Distance texels at Speed
texels per second while playing the actor's Animation animation. |
MoveRight(string Animation, float Speed, float Distance, string Sound); |
Move the actor right for Distance texels at Speed texels per second while playing
the actor's Animation animation. |
MoveLeft(string Animation, float Speed, float Distance, string Sound); |
Move the actor left for Distance texels at Speed texels per second while playing
the actor's Animation animation. |
MoveToPoint(string Animation, float Speed, string Sound); |
Move the actor to the current valid ScriptPoint at Speed texels per second while playing
the actor's Animation animation. |
MoveToTarget(string Animation, float Speed, string Sound); |
Moves the pawn towards the target. Speed determines the texels per second that the pawn will travel. |
TeleportToPoint(string PointName); TeleportToPoint(string PointName, float OffsetX, float OffsetY, float OffsetZ); TeleportToPoint(string PointName, float OffsetX, float OffsetY, float OffsetZ, bool UseAngle); TeleportToPoint(string PointName, float OffsetX, float OffsetY, float OffsetZ, bool UseAngle, string EntityName); |
Teleport the Pawn to the ScriptPoint called PointName. |
Rotate(string Animation,float RotationSpeed,float AngleX,float AngleY,float AngleZ,string Sound); |
Rotate the actor the number of degrees in AngleX, AngleY,
and AngleZ at a rotation speed of RotationSpeed degrees per second while playing the actor's Animation
animation. |
Align(); |
Rotate actor so it faces in the direction of the current valid ScriptPoint's direction vector. |
RotateToAlign(string Animation, float RotationSpeed, bool State, string Sound); |
Rotate the actor to face along the current valid ScriptPoint's direction vector at RotationSpeed
texels per second while playing the actor's Animation animation. If State is true then the rotation
will be in both the X and Y planes, rather than just the Y plane. |
RotateToPoint(string Animation, float RotationSpeed, bool State, string Sound); |
Rotate the actor to face the current valid ScriptPoint at RotationSpeed
texels per second while playing the actor's Animation animation. If State is true then the
rotation will be in both the X and Y planes, rather than just the Y plane. |
RotateAroundPointRight(string Animation, float RotationSpeed, float Time, string Sound); |
Rotate the actor to its right around the current valid ScriptPoint at a speed
of RotationSpeed texels per second for Time number of seconds. |
RotateAroundPointLeft(string Animation, float RotationSpeed, float Time, string Sound); |
Rotate the actor to its left around the current valid ScriptPoint at a speed
of RotationSpeed texels per second for Time number of seconds. |
RotateMoveToPoint(string Animation, float RotationSpeed, float Speed, bool State, string Sound); |
Rotate the actor to face the current valid ScriptPoint at RotationSpeed
texels per second while playing the actor's Animation animation. If State is true then the rotation
will be in both the X and Y planes, rather than just the Y plane. The actor will be moved forward at Speed
texels per second while the rotation is taking place. |
RotateMove(string Animation, float RotationSpeed, float Speed, float AngleX, float AngleY, float AngleZ, string Sound); |
Rotate the actor the number of degrees in AngleX, AngleY, and AngleZ at a
rotation speed of RotationSpeed degrees per second while playing the actor's Animation animation. The actor
will be moved forward at Speed texels per second while the rotation is taking place. |
RotateToTarget(string Animation, float RotationSpeed, bool Flag, string Sound); |
Rotates the pawn towards the current target. If Flag
is true, then the rotation will include pitch. |
RotateMoveToTarget(string Animation, float RotationSpeed, float Speed, bool Flag, string Sound); |
Simultaneously moves and rotates the pawn towards the current target. If Flag is true,
then the rotation will include pitch. |
RotateToPlayer(string Animation, float RotationSpeed, bool State, string Sound); |
Rotate the actor to face the player at RotationSpeed texels per second while playing the actor's
Animation animation. If State is true then the rotation will be in both the X and Y planes, rather than
just the Y plane. |
FacePlayer(bool State, bool Flag); |
If State is true then the Pawn will always face the player, regardless of any other
rotation actions that may follow. If State is false then normal rotations can occur. By default the Pawn
does not face the player. If Flag is true then the rotation will be in both the X and Y planes, rather than
just the Y plane. |
Jump(string Animation, float Speed, bool State, string Sound); |
Make the actor jump upward with a jump speed of Speed texels per second while playing the actor's
Animation animation. If State is true the next action will be executed immediately. Otherwise the actor
must land again before the next action takes place. |
Delay(string Animation, float Time, string Sound); |
Wait for Time seconds before continuing to the next action while playing the actor's Animation animation. |
PlayAnimation(string Animation, bool State, string Sound); |
Play the actor's Animation animation. If State is true then wait until
animation is complete before continuing on to the next action. |
BlendToAnimation(string Animation, float Time, bool State, string Sound); |
Blend from the current animation to Animation animation in Time amount of seconds,
then play that animation. If State is true then wait until animation is complete before continuing on to
the next action. |
LoopAnimation(string Animation, float Time, string Sound); |
Play the actor's Animation animation for Time seconds before continuing to the next action. |
AnimationSpeed(float AnimSpeed); |
Change the speed of the Pawn actor's animation by multiplying it by AnimSpeed. |
AnimateStop(string Animation, float Time, string Sound); |
Play the actor's Animation animation and then stop at the end of the animation for Time
seconds before continuing to the next action. If Time is less than 0 then continue on to the next action when the
animation has ended. The animation will remain stopped until a new animation is specified in an action. Note that if a sound is
specified it will only be played once rather than repeating. |
AddTriggerOrder(string Order, string Trigger, float Time); |
Add to list of triggers being checked by the Pawn a trigger called Trigger. When the state of this
trigger goes to on the Script Order called Order will be executed by this Pawn. If Time is greater than 0 then
the Script Order will wait this number of seconds before being executed. When the trigger goes on it is removed from the list of
active triggers. Any number of triggers can be added to the trigger list of a Pawn. |
DelTriggerOrder(string Trigger); |
Remove the trigger called Trigger from the list of triggers being checked by the Pawn. |
SetEventState(string Trigger, bool State); |
Set a trigger called Trigger to the true/false state of State.
These triggers can be checked by other entities or by Pawns by using Trigger as the name of the desired trigger.
If the state of the trigger has never been set then it will be off to other entities. |
bool GetEventState(string Trigger); |
Returns the trigger state |
PlayerDistOrder(float Distance, string Order); |
Set the minimum distance that you wish the player to approach the Pawn to Distance texels.
If Distance is 0 then the checking is disabled. When the player approaches within the minimum distance the Script
Order Order will be executed. If Distance is less than 0 then it represents the maximum distance that the
player can go from the Pawn before the Script Order Order will be executed. Once Order is executed the
distance checking is disabled. If the Pawn has had its FOV set by SetFOV(...) then the player must be within the
field of view before distance is checked. |
AddDistanceOrder(int Distance#, float Distance, string Order); |
This is the same as PlayerDistOrder(...) except that an order number, Distance#,
is associated with the checking. You can have multiple distance orders active at any time, each checking for a different
distance. |
DelDistanceOrder(int Distance#); |
Remove the distance check called Distance# from the list of distances being checked by the Pawn. |
AddCollisionOrder(string Order); |
If the player collides with the Pawn's actor then Script Order Order will be executed. |
DelCollisionOrder(); |
Disable the checking of collision by the player. |
AvoidOrder(string Order); |
If the Pawn hits an obstacle during the action MoveToPoint(...) it will run the Script
Order called Order before returning to the MoveToPoint(...) action. This is used to run a custom obstacle
avoidance routine to get around things that may be in the way. |
AddPainOrder(string Order, int Percent); |
If the Pawn has been given an attribute value using AttributeOrder(...), then Order
will be called when the attribute value decreases. The Percent amount determines what percent of the time this order
will be active. If Percent is 100 then the pain order will be called every time the attribute decreases. If it is 50
the order will be called only half the time. When this order is done (by reaching the end of the order or executing a Return()
command) control is returned to the point where the Pawn was before the order was run. |
Return(); |
Used to terminate the Script Order called by the obstacle avoidance of MoveToPoint(...)
or the AddPainOrder(...). The order will also terminate when the last action in it is encountered so Return()
is optional. |
RestartOrder(); |
Restart the current order from the beginning. |
NextPoint(); |
Get the NextPoint entry from the current ScriptPoint and make it the current ScriptPoint. If no entry
exists then the current ScriptPoint will be invalid and references to it will be ignored. |
NextOrder(); |
Get the NextOrder entry from the current Script Point and start executing the actions contained in it. |
NewPath(string PointName); |
Switch the Pawn to a ScriptPoint called PointName. This becomes the current ScriptPoint and the
order contained in the NextOrder entry will be executed. |
NewPoint(string PointName); |
Switch the Pawn to a ScriptPoint called PointName. This becomes the current ScriptPoint.
The current order is still maintained and will continue to be executed. |
NewOrder(string Order); |
Start executing the Script Order called Order. The current order is abandoned. |
SetFlag(int Flag#, bool State); |
Set the Pawn flag Flag# state to State. |
bool GetFlag(int Flag#); |
Get the state of the Pawn flag Flag#. |
AddFlagOrder(int Flag#, bool State, string Order); |
If the Pawn flag Flag# state is State then Script Order
Order will be executed. Once Order is executed the flag checking is disabled. |
DelFlagOrder(int Flag#); |
Remove the flag called Flag# from the list of flags being checked by the Pawn. |
AddTimerOrder(int Timer#, float Time, string Order); |
Create a timer with the number Timer# and an initial value of Time
seconds. When the timer counts down to 0 then Script Order Order will be executed. Once Order
is executed the timer checking is disabled. |
DelTimerOrder(int Timer#); |
Remove the timer with the number Timer# from the list of timers being checked by the Pawn. |
SetAttribute(string AttributeName, int Amount); SetAttribute(string AttributeName, int Amount, string EntityName); |
Sets the Pawn's attribute AttributeName to Amount. Sets the attribute AttributeName of the entity EntityName to Amount. EntityName can specify a Pawn, a StaticEntityProxy or the player ("Player"). |
int GetAttribute(string AttributeName); int GetAttribute(string AttributeName, string EntityName); |
Returns the amount of the pawn's attribute AttributeName. Returns the amount of the attribute AttributeName of the entity EntityName. EntityName can specify a Pawn, a StaticEntityProxy or the player ("Player"). |
ModifyAttribute(string AttributeName, int Amount); ModifyAttribute(string AttributeName, int Amount, string EntityName); |
Modifies the Pawn's attribute AttributeName by Amount. Modifies the attribute AttributeName of the entity EntityName by Amount. EntityName can specify a Pawn, a StaticEntityProxy or the player ("Player"). |
AddAttribute(string AttributeName); AddAttribute(string AttributeName, int Low, int High); AddAttribute(string AttributeName, string EntityName); AddAttribute(string AttributeName, int Low, int High, string EntityName); |
Gives the Pawn the attribute AttributeName and initializes it to 0. Low/high value limits are set to 0 / 100 by default. Gives the Pawn the attribute AttributeName and initializes it to 0. Low/high value limits are set to Low / High. Gives the entity EntityName the attribute AttributeName and initializes it to 0. Low/high value limits are set to 0 / 100 by default. EntityName can specify a Pawn, a StaticEntityProxy or the player ("Player"). Gives the entity EntityName the attribute AttributeName and initializes it to 0. Low/high value limits are set to Low / High. EntityName can specify a Pawn, a StaticEntityProxy or the player ("Player"). |
SetAttributeValueLimits(string AttributeName, int Low, int High); SetAttributeValueLimits(string AttributeName, int Low, int High, string EntityName); |
Sets the low/high value limits of the Pawn's attribute AttributeName to Low / High. Sets the low/high value limits of the attribute AttributeName of the entity EntityName to Low / High. EntityName can specify a Pawn, a StaticEntityProxy or the player ("Player"). |
AttributeOrder(string AttributeName, int Amount, string Order); |
Add to the Pawn the attribute named AttributeName and initialize it to Amount.
When the value of the attribute reaches 0 the Script Order Order will be executed. |
TestDamageOrder(float Amount, string Order); |
When the attribute defined in AttributeOrder(...) is decreased by damage this command tests for the actual amount of
damage that was supposed to have occurred. If the damage was greater than or equal to Amount then the Script Order
Order will be executed. |
Remove(bool State); |
Delete the Pawn's actor from the level. If State is false then the script will continue to run. Otherwise the script
ends and the Pawn is inoperable. When the script is running after the Pawn is removed none of the actions that require an actor will work! |
SetGroup(string Name); |
Set the name of the group the Pawn belongs to Name. |
HostilePlayer(bool State); |
If State is true then the Pawn will include the player in its list of potential targets. |
HostileSame(bool State); |
If State is true then the Pawn will include all Pawns with the same group name as it in
its list of potential targets. |
HostileDifferent(bool State ); |
If State is true then the Pawn will include all Pawns with a different group name than
it in its list of potential targets. |
TargetGroup(string Name); |
If the Pawn is set to be hostile to Pawns of a different group this will cause the Pawn to include in its
list of potential targets only those Pawns that are in the group Name. |
FindTargetOrder(float Distance, string Order, string Attribute); |
Search the area within Distance of the Pawn for a target to attack. The target must have the attribute
Attribute present to become a target. When a target is acquired the Script Order Order is executed. |
FindPointOrder(string Order); |
This command is similar to FindTargetOrder(...) but looks for Script Points instead.
Once a script point is visible, it becomes the current script point. The maximum distance is 3000 texels.
To turn off checking use FindPointOrder(""); |
SetWeapon(string Section); |
Activate the weapon defined in Pawn.ini as Section.
The weapon actor will attach to the Pawn actor. |
RemoveWeapon(); |
Remove the currently activated Pawn's weapon actor. |
FireProjectile(string Projectile, string FireBone, float OffsetX, float OffsetY, float OffsetZ, string Attribute, string Sound); |
Shoot a projectile in the direction the Pawn is facing. The projectile used is named Projectile
and the launch location is the Pawn actor's bone called FireBone. The launch point will be moved in the (left, up, in)
directions by the amount specified by (OffsetX, OffsetY, OffsetZ). The projectile will do damage to
the attribute Attribute of anything it hits. If the pawn has a weapon actor attached the launch location is taken from
the weapon actor's bone called FireBone. The sound named Sound is played when the projectile is launched. |
AudibleRadius(float Distance); |
Set the audible radius for all sounds played by this Pawn's script to Distance texels. |
AddRandomSound(int Sound#, float MinTime, float MaxTime, string Sound); |
Play Sound at an interval that is randomly chosen between MinTime and MaxTime
each time the sound is played. The Sound# is used to identify this sound for deletion. |
DelRandomSound(int Sound#); |
Remove Sound# from the list of playing sounds. |
SoundLoop(bool Flag); |
If Flag is true then when a sound is played it will be played looping until another sound
is played. If it is false then the sound will only play while the current command is being executed. |
ChangeMaterial(string MaterialSection); |
Do a ChangeMaterial on the Pawn's actor according to the MaterialSection of material.ini. |
AddExplosion(string Explosion, string BoneName, float OffsetX, float OffsetY, float OffsetZ); |
Attach a predefined explosion named Explosion to the actor bone named BoneName.
Offset the attachment point from the bone by the amounts in (OffsetX, OffsetY, OffsetZ). |
FadeIn(float Time, float Alpha); |
Increase the alpha of the actor from its present value to Alpha in Time seconds. The
next action is executed only after the alpha value is reached. If the pawn has a weapon actor attached its alpha is taken from
the current alpha of the pawn actor. |
FadeOut(float Time, float Alpha); |
Decrease the alpha of the actor from its present value to Alpha in Time seconds. The
next action is executed only after the alpha value is reached. If the pawn has a weapon actor attached its alpha is taken from
the current alpha of the pawn actor. |
Console(bool Flag); |
If Flag is true the console for this Pawn is activated. Information about this Pawn's
script is displayed on the screen, including any error messages generated at runtime. If Flag is false
the console is turned off. |
debug(string Variable); |
Output the contents of Variable to the console window for this Pawn, assuming the console is active.
The variable Variable can be any variable from the script and can be of any type (i.e. string, float, int or bool).
Used to debug scripts that are not working correctly. |
LowLevel(string Order); |
Switch script execution type from current high level commands to the low level C style
programming. Start the low level executing at Script Order Order. |
EndScript(); |
Stops the execution of the script without removing the Pawn's actor. |
Conversation(); Conversation(string StartOrder); |
Initiate
the Pawn's conversation, if one is defined. This is the same as if the
player used the Use key on the Pawn. If StartOrder
is specified, it is used as start order for the conversation. |
int GetConvReplyNr() |
Returns the number of the last reply message choosen in a conversation. |
ShowTextDelay(int Text#, string EntityName, string Animation, string Text, int Font#, int Time, string Sound, int ScreenX, int ScreenY, string Align, float Alpha); |
This command draws a text string
attached to an entity (Pawn, Attribute, StaticEntityproxy) or the
player. If the entity is moving, the string will keep the relative
position towards the entity.
|
ShowText(int Text#, string EntityName, string Animation, string Text, int Font#, string Sound, int ScreenX, int ScreenY, string Align, float Alpha); |
This command draws a text string attached to an entity (Pawn, Attribute, StaticEntityProxy) or the player.
If the entity is moving, the string will keep the relative position towards the entity.
|
RemoveText(int Text#); |
Removes the text Text# displayed by a ShowText(...)/ShowTextDelay(...)
command - from the screen. Text# is a number between 0 and 19. |
MouseControlledPlayer(bool Flag) |
Defines whether the player can be controlled with the mouse or not. |
SetKeyPause(bool Flag); |
If Flag is true then disable all keyboard input to the game. If it is false
then re-enable keyboard input. |
AllowUseKey(bool State); |
If State is false then conversations cannot be initiated by the player using the Use key
on the Pawn. If State is true then the Use key is enabled. The default state is enabled. |
SetHudDraw(bool Flag); |
If Flag is false then disable drawing of the HUD. If it is true
then enable the drawing again. |
HideFromRadar(bool Flag); |
If Flag is true then the Pawn actor will not appear on the HUD radar screen. |
AttachToActor(string PawnName, string SlaveBone, string MasterBone, float OffsetX, float OffsetY, float OffsetZ, float RotationX, float RotationY, float RotationZ); |
Attach the Pawn actor whose szEntityName is PawnName to this Pawn's actor. The actors are attached
from the bone named SlaveBone on the attaching actor to the bone named MasterBone on this Pawn's actor. The offsets
are applied to the attachment point and are calculated in the direction the master actor is facing. The rotations are applied to the
base rotation of the slave actor. The slave actor is initially aligned to face the same direction as the master actor, before the
rotations are applied. If no rotations are applied to the slave actor via its script then it will rotate to follow the master actor's
rotation. The slave actor will move with the master actor to maintain its attachment. |
DetachFromActor(string PawnName); |
If the Pawn actor whose szEntityName is PawnName is attached to this Pawn's actor then it will be
detached from the master actor.   |
AttachBlendActor(string SlaveName); AttachBlendActor(string SlaveName, string MasterName); |
Attach the actor of the entity SlaveName to this Pawn's actor. The attached actor will
use the same animation as its master. Attach the actor of the entity SlaveName to the actor of the entity MasterName. The attached actor will use the same animation as its master. |
DetachBlendActor(string SlaveName); DetachBlendActor(string SlaveName, string MasterName); |
If the actor of the entity SlaveName is attached to this Pawn's actor then it will be
detached from the master actor. If the actor of the entity SlaveName is attached to the actor of the entity MasterName then it will be detached from the master actor.   |
AttachAccessory(string SlaveName); AttachAccessory(string SlaveName, string MasterName); |
Attach the accessory defined in Pawn.ini as SlaveName to this Pawn's actor. The attached actor will
use the same animation as its master. Attach the accessory defined in Pawn.ini as SlaveName to the actor of the entity MasterName. The attached actor will use the same animation as its master. |
DetachAccessory(string SlaveName); DetachAccessory(string SlaveName, string MasterName); |
If the accessory defined in Pawn.ini as SlaveName is attached to this Pawn's actor then it will be
detached from the master actor. If the accessory defined in Pawn.ini as SlaveName is attached to the actor of the entity MasterName then it will be detached from the master actor.   |
int random(float Low, float High); |
Returns a random integer number in the range of Low to High. |
string Concat(string String1, string String2 [, string String3, ...]); |
Concatenate several strings to 1 new string. You may also use the Simkin syntax for string concatenation instead ("string1"
# "string2" results in "string1string2") |
float sin(float Value); float cos(float Value); float tan(float Value); float asin(float Value); float acos(float Value); float atan(float Value); |