Public Member Functions
PawnHigh Class Reference

All methods to control a pawn in high level mode. More...

List of all members.

Public Member Functions

void Scale (float scale)
 Scale the pawn actor size by scale.
void Scale (float scaleX, float scaleY, float scaleZ)
 Scale the pawn actor size by scaleX, scaleY and scaleZ.
void SetScale (float scaleX, float scaleY, float scaleZ)
 Set the scale of the pawn's actor to the given values.
void SetFOV (float angle, string boneName="")
 Set the field of view (FOV) of the pawn to the specified angle.
void StepHeight (float distance)
 Set the step height of the pawn to distance.
void Gravity (bool state)
 Set whether the pawn will be affected by gravity.
void IsPushable (bool flag)
 Set whether the pawn can be pushed by the player.
void IsVehicle (bool flag)
 Set whether the pawn will be made a vehicle.
void SetLODDistance (float distance1, float distance2, float distance3, float distance4, float distance5)
 Set the LOD distances used for the pawn's actor.
void BoxWidth (float width)
 Set the pawn actor's bounding box width and depth to width. The height remains unchanged.
void BoxHeight (float height)
 Set the pawn actor's bounding box height to height. The width and depth remain unchanged.
void SetCollision ()
 Set the actor's bounding box so collisions will occur with other objects.
void SetNoCollision ()
 Set the actor's bounding box so that no collisions with it will occur.
void Move (string animation, float speed, float distance, float angleX=0.0, float angleY=0.0, float angleZ=0.0, string sound="")
 Move the actor distance texels at speed texels per second in the direction obtained by adding angleX, angleY and angleZ to the forward direction while playing the specified actor animation.
void MoveForward (string animation, float speed, float distance, string sound)
 Move the actor forward for distance texels at speed texels per second while playing the specified actor animation.
void MoveBackward (string animation, float speed, float distance, string sound)
 Move the actor backward for distance texels at speed texels per second while playing the specified actor animation.
void MoveRight (string animation, float speed, float distance, string sound)
 Move the actor right for distance texels at speed texels per second while playing the specified actor animation.
void MoveLeft (string animation, float speed, float distance, string sound)
 Move the actor left for distance texels at speed texels per second while playing the specified actor animation.
void MoveToPoint (string animation, float speed, string sound)
 Move the actor to the current valid ScriptPoint at speed texels per second while playing the specified actor animation.
void MoveToTarget (string animation, float speed, string sound)
 Move the actor towards the current valid target at speed texels per second while playing the specified actor animation.
void TeleportToPoint (string pointName, float offsetX=0.0, float offsetY=0.0, float offsetZ=0.0, bool rotate=false, string szEntityName=self.EntityName)
 Teleport the entity szEntityName to the specified ScriptPoint.
void Rotate (string animation, float angularSpeed, 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 angularSpeed degrees per second while playing the specified actor animation.
void Align ()
 Rotate the actor so it faces in the direction of the current valid ScriptPoint's direction vector.
void RotateToAlign (string animation, float angularSpeed, bool flag, string sound)
 Rotate the actor to face along the current valid ScriptPoint's direction vector at angularSpeed degrees per second while playing the specified actor animation.
void RotateToPoint (string animation, float angularSpeed, bool flag, string sound)
 Rotate the actor to face the current valid ScriptPoint at angularSpeed degrees per second while playing the specified actor animation.
void RotateAroundPointRight (string animation, float angularSpeed, float time, string sound)
 Rotate the actor to its right around the current valid ScriptPoint at angularSpeed degrees per second for time number of seconds.
void RotateAroundPointLeft (string animation, float angularSpeed, float time, string sound)
 Rotate the actor to its left around the current valid ScriptPoint at angularSpeed degrees per second for time number of seconds.
void RotateMoveToPoint (string animation, float angularSpeed, float speed, bool flag, string sound)
 Rotate the actor to face the current valid ScriptPoint at angularSpeed degrees per second while playing the specified actor animation. The actor will be moved forward at speed texels per second while the rotation is taking place.
void RotateMove (string animation, float angularSpeed, float speed, float angleX, float angleY, float angleZ, string sound)
 Rotate the actor the number of degrees in angleX, angleY, and angleZ at angularSpeed degrees per second while playing the specified actor animation. The actor will be moved forward at speed texels per second while the rotation is taking place.
void RotateToTarget (string animation, float angularSpeed, bool flag, string sound)
 Rotate the actor to face the current target while playing the specified actor animation.
void RotateMoveToTarget (string animation, float angularSpeed, float speed, bool flag, string sound)
 Simultaneously move and rotate the actor towards the current target while playing the specified actor animation.
void RotateToPlayer (string animation, float angularSpeed, bool flag, string sound)
 Rotate the actor to face the player while playing the specified actor animation.
void FacePlayer (bool track, bool flag)
 Rotate the actor to face the player.
void Jump (string animation, float force, bool flag, string sound)
 Make the actor jump upward while playing the specified actor animation.
void Delay (string animation, float time, string sound)
 Wait for time seconds before continuing to the next action.
void PlayAnimation (string animation, bool flag, string sound)
 Play back the specified actor animation.
void BlendToAnimation (string animation, float time, bool flag, string sound)
 Blend from the current animation to the specified animation in time amount of seconds, then play that animation.
void LoopAnimation (string animation, float time, string sound)
 Loop the specified animation for the given time before continuing to the next action.
void AnimationSpeed (float speed)
 Change the speed of the pawn actor's animation by multiplying it by speed.
void AnimateStop (string animation, float time, string sound)
 Play the specified actor animation and then stop at the end of the animation for time seconds before continuing to the next action.
void AddTriggerOrder (string order, string trigger, float time)
 Add to the list of triggers being checked by the pawn the specified trigger.
void DelTriggerOrder (string trigger)
 Remove the trigger called trigger from the list of triggers being watched by the pawn.
void SetEventState (string event, bool state)
 Set the state of the named trigger to state.
bool GetEventState (string event)
 Return the state of the event trigger named event.
void PlayerDistOrder (float distance, string order)
 Register a Script Order that is to be executed when the player enters/leaves the specified range to the pawn.
void AddDistanceOrder (int distanceID, float distance, string order)
 This is the same as PlayerDistOrder() except that an ID, distanceID, is associated with the checking.
void DelDistanceOrder (int distanceID)
 Remove the distance check identified by distanceID from the list of distances being checked by the pawn.
void AddCollisionOrder (string order)
 If the player collides with the pawn's actor then the specified Script Order will be executed.
void DelCollisionOrder ()
 Remove the collision check order.
void 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.
void 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.
void Return ()
 Used to terminate the Script Order called by the obstacle avoidance of MoveToPoint() or the AddPainOrder().
void RestartOrder ()
 Restart the current order from the beginning.
void NextPoint ()
 Get the NextPoint entry from the current ScriptPoint and make it the current ScriptPoint.
void NextOrder ()
 Get the NextOrder entry from the current ScriptPoint and start executing the actions contained in it.
void NewPath (string pointName)
 Switch the pawn to a ScriptPoint named pointName.
void NewPoint (string pointName)
 Switch the pawn to a ScriptPoint named pointName.
void NewOrder (string order)
 Start executing the Script Order called order. The current order is abandoned.
void SetFlag (int flagID, bool state)
 Set the state of the pawn flag flagID to state.
bool GetFlag (int flagID)
 Get the state of the pawn flag flagID.
void AddFlagOrder (int flagID, bool state, string order)
 If the state of the pawn flag flagID is state then Script Order order will be executed.
void DelFlagOrder (int flagID)
 Remove the pawn flag identified by flagID from the list of flags being checked by the pawn.
void AddTimerOrder (int timerID, float time, string order)
 Create a timer with the number timerID and an initial value of time seconds. When the timer counts down to 0 the Script Order order will be executed.
void DelTimerOrder (int timerID)
 Remove the timer with the number timerID from the list of timers being checked by the pawn.
void SetAttribute (string attribute, int amount, string szEntityName=self.EntityName)
 Set the value of the attribute attribute of the entity szEntityName to amount.
int GetAttribute (string attribute, string szEntityName=self.EntityName)
 Get the amount of the attribute attribute of the entity szEntityName.
void ModifyAttribute (string attribute, int amount, string szEntityName=self.EntityName)
 Modify the amount of the attribute attribute of the entity szEntityName by amount.
void AddAttribute (string attribute, string szEntityName=self.EntityName)
 Give the entity szEntityName the attribute attribute, initialize it to 0 and set the low and high value limits to 0 and 100, respectively.
void AddAttribute (string attribute, int low=0, int high=100, string szEntityName=self.EntityName)
 Give the entity szEntityName the attribute attribute, initialize it to 0 and set the low and high value limits.
void SetAttributeValueLimits (string attribute, int low, int high, string szEntityName=self.EntityName)
 Set the low and high value limits of the attribute attribute of the entity szEntityName.
void AttributeOrder (string attribute, int amount, string order)
 Give the pawn the attribute named attribute and initialize it to amount. When the value of the attribute reaches 0 the Script Order order will be executed.
void TestDamageOrder (float amount, string order)
 When the attribute defined in AttributeOrder() is decreased by damage this method 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.
void Remove (bool state)
 Remove the actor from the level.
void SetGroup (string name)
 Set the name of the group the pawn belongs to.
void HostilePlayer (bool state)
 Set the attitude of the pawn towards the player.
void HostileSame (bool state)
 Set the attitude of the pawn towards pawns of the same group.
void HostileDifferent (bool state)
 Set the attitude of the pawn towards members of a different group.
void 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.
void FindTargetOrder (float distance, string order, string attribute)
 Search the area within distance of the pawn for a target to attack.
void FindPointOrder (string order)
 Search the area within 3000 texels of the pawn for the nearest visible ScriptPoint.
void SetWeapon (string section)
 Activate the weapon defined in pawn.ini as section.
void RemoveWeapon ()
 Remove the currently activated weapon actor of this pawn.
void FireProjectile (string projectile, string boneName, float offsetX, float offsetY, float offsetZ, string attribute, string sound)
 Shoot a projectile in the direction the pawn is facing.
void AudibleRadius (float distance)
 Set the audible radius for all sounds played by this pawn's script to distance.
void AddRandomSound (int soundID, float minTime, float maxTime, string sound)
 Play back the given sound file at an interval that is randomly chosen between minTime and maxTime each time the sound is played.
void DelRandomSound (int soundID)
 Remove the specified sound from the list of playing sounds.
void SoundLoop (bool flag)
 Set the looping behaviour of sounds played by this pawn's script.
void ChangeMaterial (string section)
 Change the material on the pawn's actor according to the specified section of material.ini.
void ChangeWeaponMaterial (string section)
 Change the material on the pawn's weapon actor according to the specified section of material.ini.
void AddExplosion (string explosion, string boneName, float offsetX, float offsetY, float offsetZ)
 Attach an explosion effect predefined in explosion.ini to the specified actor bone.
void FadeIn (float time, float alpha)
 Increase the alpha of the actor (and any attached weapon) from its present value to alpha in time seconds.
void FadeOut (float time, float alpha)
 Decrease the alpha of the actor (and any attached weapon) from its present value to alpha in time seconds.
void Console (bool flag)
 Set whether information about this pawn's script is displayed on the screen.
void debug (var variable)
 Output the contents of variable to the console window for this pawn, assuming the console is active.
void LowLevel (string order)
 Switch script execution type from current high level methods to the low level C style programming.
void EndScript ()
 Stop the execution of the script (without removing the pawn's actor).
void Conversation ()
 Initiate the pawn's conversation, if one is defined.
void Conversation (string order)
 Initiate the pawn's conversation, if one is defined.
void Speak (string textSection, string sound, float textScrollSpeed, float textDisplayTime)
 Show a text string and optionally play a sound at the pawn's position during a conversation. If not in a conversation, just play back the specified sound file.
void ShowTextDelay (int textID, string szEntityName, string animation, string text, string font, float time, string sound, int x, int y, string align, float alpha)
 Display the given text attached to an entity (Pawn, Attribute, StaticEntityProxy) or the player.
void ShowText (int textID, string szEntityName, string animation, string text, string font, string sound, int x, int y, string align, float alpha)
 Display the given text attached to an entity (Pawn, Attribute, StaticEntityProxy) or the player.
void RemoveText (int textID)
 Remove the text object with the ID textID displayed by the ShowText() or ShowTextDelay() method.
void SetHudDraw (bool show)
 Show or hide the HUD.
void HideFromRadar (bool hide)
 Show or hide the pawn on the HUD radar screen.
void MouseControlledPlayer (bool flag)
 Define whether the player can be controlled with the mouse or not.
void SetKeyPause (bool pause)
 Pause or restore the keyboard control.
void AllowUseKey (bool flag)
 Set the Use key control for this pawn.
void AttachToActor (string slave, string slaveBone, string masterBone, float offsetX, float offsetY, float offsetZ, float angleX, float angleY, float angleZ)
 Attach the pawn named slave to this pawn's actor.
void DetachFromActor (string slave)
 Detach the specified pawn from its master.
void AttachBlendActor (string slave, string master=self.EntityName)
 Attach the specified entity to the given master entity.
void DetachBlendActor (string slave, string master=self.EntityName)
 Detach the specified entity from its master.
void AttachAccessory (string slave, string master=self.EntityName)
 Attach the specified accessory to the given master entity.
void DetachAccessory (string slave, string master=self.EntityName)
 Detach the specified accessory from its master.
int random (int lower, int upper)
 Generate a random integer number in the range lower to upper.
float sin (float value)
 Get the sine of the given value.
float cos (float value)
 Get the cosine of the given value.
float tan (float value)
 Get the tangent of the given value.
float asin (float value)
 Get the arc sine of the given value.
float acos (float value)
 Get the arc cosine of the given value.
float atan (float value)
 Get the arc tangent of the given value.

Detailed Description

All methods to control a pawn in high level mode.


Member Function Documentation

void PawnHigh::Scale ( float  scale)

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 scaled in the same way.

Parameters:
scalefloat value specifying the scale factor in x, y and z direction.
Returns:
Nothing.
void PawnHigh::Scale ( float  scaleX,
float  scaleY,
float  scaleZ 
)

Scale the pawn actor size by scaleX, scaleY and scaleZ.

If the actor was scaled in the definition in pawn.ini then it will be scaled by that amount times scaleX, scaleY and scaleZ respectively. If the pawn has a weapon actor attached it is scaled in the same way.

Parameters:
scaleXfloat value specifying the scale factor in x direction.
scaleYfloat value specifying the scale factor in y direction.
scaleZfloat value specifying the scale factor in z direction.
Returns:
Nothing.
void PawnHigh::SetScale ( float  scaleX,
float  scaleY,
float  scaleZ 
)

Set the scale of the pawn's actor to the given values.

Parameters:
scaleXfloat value specifying the scale of the actor in x direction.
scaleYfloat value specifying the scale of the actor in y direction.
scaleZfloat value specifying the scale of the actor in z direction.
Returns:
Nothing.
void PawnHigh::SetFOV ( float  angle,
string  boneName = "" 
)

Set the field of view (FOV) of the pawn to the specified angle.

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 or the pawn actor's bone boneName is facing.

Parameters:
angleField of view in degrees.
boneNameString holding the name of a bone present in the pawn's actor, or empty to use the root bone.
Returns:
Nothing.
void PawnHigh::StepHeight ( float  distance)

Set the step height of the pawn to distance.

Parameters:
distanceSpecifies the maximum step height. If less than or equal to zero then step up is disabled for this pawn.
Returns:
Nothing.
void PawnHigh::Gravity ( bool  state)

Set whether the pawn will be affected by gravity.

Parameters:
state
  • true then the actor is subject to gravity (default condition).
  • false then the actor is unaffected by gravity.
Returns:
Nothing.
void PawnHigh::IsPushable ( bool  flag)

Set whether the pawn can be pushed by the player.

Parameters:
flag
  • true then the actor can be pushed by the player.
  • false then the actor cannot be pushed by the player.
Returns:
Nothing.
void PawnHigh::IsVehicle ( bool  flag)

Set whether the pawn will be made a vehicle.

Parameters:
flag
  • true then the actor will be made a vehicle.
  • false then the actor will not be made a vehicle.
Returns:
Nothing.
void PawnHigh::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 in the EnvironmentSetup entity.

Parameters:
distance1float value specifying the distance after which LOD actor 1 is rendered.
distance2float value specifying the distance after which LOD actor 2 is rendered.
distance3float value specifying the distance after which LOD actor 3 is rendered.
distance4float value specifying the distance after which the LOD image is rendered.
distance5float value specifying the distance after which rendering is disabled.
Returns:
Nothing.
void PawnHigh::BoxWidth ( float  width)

Set the pawn actor's bounding box width and depth to width. The height remains unchanged.

Parameters:
widthfloat value specifying the width and depth of the bounding box.
Returns:
Nothing.
void PawnHigh::BoxHeight ( float  height)

Set the pawn actor's bounding box height to height. The width and depth remain unchanged.

Parameters:
heightfloat value specifying the height of the bounding box.
Returns:
Nothing.
void PawnHigh::SetCollision ( )

Set the actor's bounding box so collisions will occur with other objects.

Returns:
Nothing.
void PawnHigh::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.

Returns:
Nothing.
void PawnHigh::Move ( string  animation,
float  speed,
float  distance,
float  angleX = 0.0,
float  angleY = 0.0,
float  angleZ = 0.0,
string  sound = "" 
)

Move the actor distance texels at speed texels per second in the direction obtained by adding angleX, angleY and angleZ to the forward direction while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while moving.
speedfloat value specifying the speed at which the pawn moves (in texels per second).
distancefloat value specifying the distance the pawn moves (in texels).
angleXfloat value specifying the rotation around the x-axis (in degrees).
angleYfloat value specifying the rotation around the y-axis (in degrees).
angleZfloat value specifying the rotation around the z-axis (in degrees).
soundString holding the name of the sound file to play while moving.
Returns:
Nothing.
void PawnHigh::MoveForward ( string  animation,
float  speed,
float  distance,
string  sound 
)

Move the actor forward for distance texels at speed texels per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while moving.
speedfloat value specifying the speed at which the pawn moves (in texels per second).
distancefloat value specifying the distance the pawn moves (in texels).
soundString holding the name of the sound file to play while moving.
Returns:
Nothing.
void PawnHigh::MoveBackward ( string  animation,
float  speed,
float  distance,
string  sound 
)

Move the actor backward for distance texels at speed texels per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while moving.
speedfloat value specifying the speed at which the pawn moves (in texels per second).
distancefloat value specifying the distance the pawn moves (in texels).
soundString holding the name of the sound file to play while moving.
Returns:
Nothing.
void PawnHigh::MoveRight ( string  animation,
float  speed,
float  distance,
string  sound 
)

Move the actor right for distance texels at speed texels per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while moving.
speedfloat value specifying the speed at which the pawn moves (in texels per second).
distancefloat value specifying the distance the pawn moves (in texels).
soundString holding the name of the sound file to play while moving.
Returns:
Nothing.
void PawnHigh::MoveLeft ( string  animation,
float  speed,
float  distance,
string  sound 
)

Move the actor left for distance texels at speed texels per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while moving.
speedfloat value specifying the speed at which the pawn moves (in texels per second).
distancefloat value specifying the distance the pawn moves (in texels).
soundString holding the name of the sound file to play while moving.
Returns:
Nothing.
void PawnHigh::MoveToPoint ( string  animation,
float  speed,
string  sound 
)

Move the actor to the current valid ScriptPoint at speed texels per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while moving.
speedfloat value specifying the speed at which the pawn moves (in texels per second).
soundString holding the name of the sound file to play while moving.
Returns:
Nothing.
void PawnHigh::MoveToTarget ( string  animation,
float  speed,
string  sound 
)

Move the actor towards the current valid target at speed texels per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while moving.
speedfloat value specifying the speed at which the pawn moves (in texels per second).
soundString holding the name of the sound file to play while moving.
Returns:
Nothing.
void PawnHigh::TeleportToPoint ( string  pointName,
float  offsetX = 0.0,
float  offsetY = 0.0,
float  offsetZ = 0.0,
bool  rotate = false,
string  szEntityName = self.EntityName 
)

Teleport the entity szEntityName to the specified ScriptPoint.

Parameters:
pointNameString holding the name of a ScriptPoint entity.
offsetXfloat value specifying the offset in x direction from the position of the ScriptPoint pointName.
offsetYfloat value specifying the offset in y direction from the position of the ScriptPoint pointName.
offsetZfloat value specifying the offset in z direction from the position of the ScriptPoint pointName.
rotateboolean value that determines whether or not the entity will match the SriptPoint angles after teleport.
szEntityNameString holding the name of the entity to teleport.
Returns:
Nothing.
void PawnHigh::Rotate ( string  animation,
float  angularSpeed,
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 angularSpeed degrees per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
angleXfloat value specifying the rotation around the x-axis (in degrees).
angleYfloat value specifying the rotation around the y-axis (in degrees).
angleZfloat value specifying the rotation around the z-axis (in degrees).
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::Align ( )

Rotate the actor so it faces in the direction of the current valid ScriptPoint's direction vector.

Returns:
Nothing.
void PawnHigh::RotateToAlign ( string  animation,
float  angularSpeed,
bool  flag,
string  sound 
)

Rotate the actor to face along the current valid ScriptPoint's direction vector at angularSpeed degrees per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
flag
  • true then the rotation will be in both the x and y planes.
  • false then the rotation will be just around the y-axis.
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateToPoint ( string  animation,
float  angularSpeed,
bool  flag,
string  sound 
)

Rotate the actor to face the current valid ScriptPoint at angularSpeed degrees per second while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
flag
  • true then the rotation will be in both the x and y planes.
  • false then the rotation will be just around the y-axis.
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateAroundPointRight ( string  animation,
float  angularSpeed,
float  time,
string  sound 
)

Rotate the actor to its right around the current valid ScriptPoint at angularSpeed degrees per second for time number of seconds.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
timefloat value specifying the time the rotation will last (in seconds).
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateAroundPointLeft ( string  animation,
float  angularSpeed,
float  time,
string  sound 
)

Rotate the actor to its left around the current valid ScriptPoint at angularSpeed degrees per second for time number of seconds.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
timefloat value specifying the time the rotation will last (in seconds).
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateMoveToPoint ( string  animation,
float  angularSpeed,
float  speed,
bool  flag,
string  sound 
)

Rotate the actor to face the current valid ScriptPoint at angularSpeed degrees per second while playing the specified actor animation. The actor will be moved forward at speed texels per second while the rotation is taking place.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
speedfloat value specifying the speed at which the pawn moves (in texels per second).
flag
  • true then the rotation will be in both the x and y planes.
  • false then the rotation will be just around the y-axis.
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateMove ( string  animation,
float  angularSpeed,
float  speed,
float  angleX,
float  angleY,
float  angleZ,
string  sound 
)

Rotate the actor the number of degrees in angleX, angleY, and angleZ at angularSpeed degrees per second while playing the specified actor animation. The actor will be moved forward at speed texels per second while the rotation is taking place.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
speedfloat value specifying the speed at which the pawn moves (in texels per second).
angleXfloat value specifying the rotation around the x-axis (in degrees).
angleYfloat value specifying the rotation around the y-axis (in degrees).
angleZfloat value specifying the rotation around the z-axis (in degrees).
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateToTarget ( string  animation,
float  angularSpeed,
bool  flag,
string  sound 
)

Rotate the actor to face the current target while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
flag
  • true then the rotation will be in both the x and y planes.
  • false then the rotation will be just around the y-axis.
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateMoveToTarget ( string  animation,
float  angularSpeed,
float  speed,
bool  flag,
string  sound 
)

Simultaneously move and rotate the actor towards the current target while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
speedfloat value specifying the speed at which the pawn moves (in texels per second).
flag
  • true then the rotation will be in both the x and y planes.
  • false then the rotation will be just around the y-axis.
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::RotateToPlayer ( string  animation,
float  angularSpeed,
bool  flag,
string  sound 
)

Rotate the actor to face the player while playing the specified actor animation.

Parameters:
animationString holding the name of the animation to play while rotating.
angularSpeedfloat value specifying the speed at which the pawn rotates (in degrees per second).
flag
  • true then the rotation will be in both the x and y planes.
  • false then the rotation will be just around the y-axis.
soundString holding the name of the sound file to play while rotating.
Returns:
Nothing.
void PawnHigh::FacePlayer ( bool  track,
bool  flag 
)

Rotate the actor to face the player.

Parameters:
track
  • true then the pawn will always face the player, regardless of any other rotation actions that may follow.
  • false then normal rotations can occur (default behaviour).
flag
  • true then the rotation will be in both the x and y planes.
  • false then the rotation will be just around the y-axis.
Returns:
Nothing.
void PawnHigh::Jump ( string  animation,
float  force,
bool  flag,
string  sound 
)

Make the actor jump upward while playing the specified actor animation.

If flag is true the next action will be executed immediately. Otherwise the actor must land again before the next action takes place.

Parameters:
animationString holding the name of the animation to play while jumping.
forcefloat value specifying the force to accelerate the pawn.
flag
  • true then the next action will be executed immediately.
  • false then the actor must land again before the next action takes place.
soundString holding the name of the sound file to play while jumping.
Returns:
Nothing.
void PawnHigh::Delay ( string  animation,
float  time,
string  sound 
)

Wait for time seconds before continuing to the next action.

Parameters:
animationString holding the name of the animation to play while waiting.
timefloat value specifying the seconds to wait.
soundString holding the name of the sound file to play while waiting.
Returns:
Nothing.
void PawnHigh::PlayAnimation ( string  animation,
bool  flag,
string  sound 
)

Play back the specified actor animation.

Parameters:
animationString holding the name of the animation to play.
flag
  • true then wait until animation is complete before continuing on to the next action.
  • false then the next action will be executed immediately.
soundString holding the name of the sound file to play.
Returns:
Nothing.
void PawnHigh::BlendToAnimation ( string  animation,
float  time,
bool  flag,
string  sound 
)

Blend from the current animation to the specified animation in time amount of seconds, then play that animation.

Parameters:
animationString holding the name of the animation to blend to.
timefloat value specifying the seconds to blend from the current to the new animation.
flag
  • true then wait until animation is complete before continuing on to the next action.
  • false then the next action will be executed immediately.
soundString holding the name of the sound file to play.
Returns:
Nothing.
void PawnHigh::LoopAnimation ( string  animation,
float  time,
string  sound 
)

Loop the specified animation for the given time before continuing to the next action.

Parameters:
animationString holding the name of the animation to play.
timefloat value specifying the seconds to play the animation.
soundString holding the name of the sound file to play.
Returns:
Nothing.
void PawnHigh::AnimationSpeed ( float  speed)

Change the speed of the pawn actor's animation by multiplying it by speed.

Parameters:
speedfloat value specifying the scale factor for the animation speed.
Returns:
Nothing.
void PawnHigh::AnimateStop ( string  animation,
float  time,
string  sound 
)

Play the specified actor animation and then stop at the end of the animation for time seconds before continuing to the next action.

The animation will remain stopped until a new animation is specified in an action.

Parameters:
animationString holding the name of the animation to play.
timefloat value specifying the seconds to wait after the animation has finished. If less than 0 then continue on to the next action when the animation has ended.
soundString holding the name of the sound file to play once.
Returns:
Nothing.
void PawnHigh::AddTriggerOrder ( string  order,
string  trigger,
float  time 
)

Add to the list of triggers being checked by the pawn the specified trigger.

When the state of this trigger goes to on it is removed from the list of watched triggers and the Script Order called order will be executed. Any number of triggers can be added to the watched trigger list of a pawn.

Parameters:
orderString holding the name of the order to execute.
triggerString holding the name of the trigger to check.
timefloat value specifying the number of seconds to wait before executing the new order.
Returns:
Nothing.
void PawnHigh::DelTriggerOrder ( string  trigger)

Remove the trigger called trigger from the list of triggers being watched by the pawn.

Parameters:
triggerString holding the name of the trigger.
Returns:
Nothing.
void PawnHigh::SetEventState ( string  event,
bool  state 
)

Set the state of the named trigger to state.

If the trigger does not exist it will be created.

Note:
Event triggers are shared among all pawns; not to be confused with a Trigger entity!
Parameters:
eventString holding the name of an event trigger.
stateboolean value specifying the new state of the event trigger.
Returns:
Nothing.
bool PawnHigh::GetEventState ( string  event)

Return the state of the event trigger named event.

Note:
Event triggers are shared among all pawns; not to be confused with a Trigger entity!
Parameters:
eventString holding the name of the event trigger.
Returns:
boolean value reflecting the state of the specified event trigger.
void PawnHigh::PlayerDistOrder ( float  distance,
string  order 
)

Register a Script Order that is to be executed when the player enters/leaves the specified range to the pawn.

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 the distance gets checked.

Parameters:
distancefloat value specifying the distance (in texels) to check:
  • if greater than 0 then the order will be executed when the player enters this range.
  • if 0 then the checking is disabled.
  • if less than 0 then it represents the maximum distance that the player can go from the pawn before the order will be executed.
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::AddDistanceOrder ( int  distanceID,
float  distance,
string  order 
)

This is the same as PlayerDistOrder() except that an ID, distanceID, is associated with the checking.

You can have multiple distance orders active at any time, each checking for a different distance.

Parameters:
distanceIDinteger value identifying the distance check.
distancefloat value specifying the distance (in texels) to check:
  • if greater than 0 then the order will be executed when the player enters this range.
  • if 0 then the checking is disabled.
  • if less than 0 then it represents the maximum distance that the player can go from the pawn before the order will be executed.
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::DelDistanceOrder ( int  distanceID)

Remove the distance check identified by distanceID from the list of distances being checked by the pawn.

Parameters:
distanceIDinteger value specifying the distance check to remove.
Returns:
Nothing.
void PawnHigh::AddCollisionOrder ( string  order)

If the player collides with the pawn's actor then the specified Script Order will be executed.

Parameters:
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::DelCollisionOrder ( )

Remove the collision check order.

Returns:
Nothing.
void PawnHigh::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.

Parameters:
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::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.

When this order is done (by reaching the end of the order or calling Return) control is returned to the point where the pawn was before the order was run.

Parameters:
orderString holding the name of the order to execute.
percentinteger value specifying the percent of the time this order will be active. If it 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.
Returns:
Nothing.
void PawnHigh::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 calling this method is optional.

Returns:
Nothing.
void PawnHigh::RestartOrder ( )

Restart the current order from the beginning.

Returns:
Nothing.
void PawnHigh::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.

Returns:
Nothing.
void PawnHigh::NextOrder ( )

Get the NextOrder entry from the current ScriptPoint and start executing the actions contained in it.

Returns:
Nothing.
void PawnHigh::NewPath ( string  pointName)

Switch the pawn to a ScriptPoint named pointName.

This becomes the current ScriptPoint and the order contained in the NextOrder entry will be executed.

Parameters:
pointNameString holding the name of the new ScriptPoint.
Returns:
Nothing.
void PawnHigh::NewPoint ( string  pointName)

Switch the pawn to a ScriptPoint named pointName.

This becomes the current ScriptPoint. The current order is still maintained and will continue to be executed.

Parameters:
pointNameString holding the name of the new ScriptPoint.
Returns:
Nothing.
void PawnHigh::NewOrder ( string  order)

Start executing the Script Order called order. The current order is abandoned.

Parameters:
orderString holding the name of the new order to execute.
Returns:
Nothing.
void PawnHigh::SetFlag ( int  flagID,
bool  state 
)

Set the state of the pawn flag flagID to state.

Note:
Pawn flags are shared among all pawns.
Parameters:
flagIDinteger value (0 - 499) identifying the pawn flag to be set.
stateboolean value specifying the new state of the pawn flag.
Returns:
Nothing.
bool PawnHigh::GetFlag ( int  flagID)

Get the state of the pawn flag flagID.

Note:
Pawn flags are shared among all pawns.
Parameters:
flagIDinteger value (0 - 499) identifying the pawn flag.
Returns:
boolean value reflecting the state of the specified pawn flag.
void PawnHigh::AddFlagOrder ( int  flagID,
bool  state,
string  order 
)

If the state of the pawn flag flagID is state then Script Order order will be executed.

Once order is executed the flag checking is disabled.

Parameters:
flagIDinteger value (0 - 499) identifying the pawn flag to check.
stateboolean value specifying the state of the pawn flag triggering the order execution.
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::DelFlagOrder ( int  flagID)

Remove the pawn flag identified by flagID from the list of flags being checked by the pawn.

Parameters:
flagIDinteger value (0 - 499) identifying the pawn flag check to remove.
Returns:
Nothing.
void PawnHigh::AddTimerOrder ( int  timerID,
float  time,
string  order 
)

Create a timer with the number timerID and an initial value of time seconds. When the timer counts down to 0 the Script Order order will be executed.

Once order is executed the timer checking is disabled.

Parameters:
timerIDinteger value identifying the timer to check.
timefloat value specifying the number of seconds to wait before executing the order.
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::DelTimerOrder ( int  timerID)

Remove the timer with the number timerID from the list of timers being checked by the pawn.

Parameters:
timerIDinteger value identifying the timer to remove.
Returns:
Nothing.
void PawnHigh::SetAttribute ( string  attribute,
int  amount,
string  szEntityName = self.EntityName 
)

Set the value of the attribute attribute of the entity szEntityName to amount.

szEntityName may specify a pawn, a StaticEntityProxy or the player ("Player").

Parameters:
attributeString holding the name of the attribute to change.
amountinteger value determining the new value of the specified attribute.
szEntityNameString holding the name of the entity owning the attribute.
Returns:
Nothing.
int PawnHigh::GetAttribute ( string  attribute,
string  szEntityName = self.EntityName 
)

Get the amount of the attribute attribute of the entity szEntityName.

szEntityName may specify a Pawn, a StaticEntityProxy or the player ("Player").

Parameters:
attributeString holding the name of the attribute.
szEntityNameString holding the name of the entity owning the attribute.
Returns:
value of the specified attribute.
void PawnHigh::ModifyAttribute ( string  attribute,
int  amount,
string  szEntityName = self.EntityName 
)

Modify the amount of the attribute attribute of the entity szEntityName by amount.

szEntityName may specify a Pawn, a StaticEntityProxy or the player ("Player").

Parameters:
attributeString holding the name of the attribute to change.
amountinteger value determining the amount the specified attribute will be modified by.
szEntityNameString holding the name of the entity owning the attribute.
Returns:
Nothing.
void PawnHigh::AddAttribute ( string  attribute,
string  szEntityName = self.EntityName 
)

Give the entity szEntityName the attribute attribute, initialize it to 0 and set the low and high value limits to 0 and 100, respectively.

szEntityName may specify a Pawn, a StaticEntityProxy or the player ("Player").

Parameters:
attributeString holding the name of the attribute to create.
szEntityNameString holding the name of the entity owning the attribute.
Returns:
Nothing.
void PawnHigh::AddAttribute ( string  attribute,
int  low = 0,
int  high = 100,
string  szEntityName = self.EntityName 
)

Give the entity szEntityName the attribute attribute, initialize it to 0 and set the low and high value limits.

szEntityName may specify a Pawn, a StaticEntityProxy or the player ("Player").

Parameters:
attributeString holding the name of the attribute to create.
lowinteger value determining the low value limit of the new attribute.
highinteger value determining the high value limit of the new attribute.
szEntityNameString holding the name of the entity owning the attribute.
Returns:
Nothing.
void PawnHigh::SetAttributeValueLimits ( string  attribute,
int  low,
int  high,
string  szEntityName = self.EntityName 
)

Set the low and high value limits of the attribute attribute of the entity szEntityName.

szEntityName may specify a Pawn, a StaticEntityProxy or the player ("Player").

Parameters:
attributeString holding the name of the attribute to modify.
lowinteger value determining the new low value limit of the attribute.
highinteger value determining the new high value limit of the attribute.
szEntityNameString holding the name of the entity owning the attribute.
Returns:
Nothing.
void PawnHigh::AttributeOrder ( string  attribute,
int  amount,
string  order 
)

Give the pawn the attribute named attribute and initialize it to amount. When the value of the attribute reaches 0 the Script Order order will be executed.

Parameters:
attributeString holding the name of the attribute to add.
amountinteger value specifying the initial amount of the attribute.
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::TestDamageOrder ( float  amount,
string  order 
)

When the attribute defined in AttributeOrder() is decreased by damage this method 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.

Parameters:
amountfloat value specifying the amount of damage to test for.
orderString holding the name of the order to execute.
Returns:
Nothing.
void PawnHigh::Remove ( bool  state)

Remove the actor from the level.

Note:
When the script is running after the pawn is removed none of the actions that require an actor will work.
Parameters:
state
  • true then the script ends and the pawn is inoperable.
  • false then the script will continue to run.
Returns:
Nothing.
void PawnHigh::SetGroup ( string  name)

Set the name of the group the pawn belongs to.

Parameters:
nameString holding the name of the group the pawn will belong to.
Returns:
Nothing.
void PawnHigh::HostilePlayer ( bool  state)

Set the attitude of the pawn towards the player.

Parameters:
state
  • true to include the player in the pawn's list of potential targets.
  • false to exclude the player from the pawn's list of potential targets.
Returns:
Nothing.
void PawnHigh::HostileSame ( bool  state)

Set the attitude of the pawn towards pawns of the same group.

Parameters:
state
  • true to include pawns of the same group in the pawn's list of potential targets.
  • false to exclude pawns of the same group from the pawn's list of potential targets.
Returns:
Nothing.
void PawnHigh::HostileDifferent ( bool  state)

Set the attitude of the pawn towards members of a different group.

Parameters:
state
  • true to include pawns of a different group in the pawn's list of potential targets.
  • false to exclude pawns of a different group from the pawn's list of potential targets.
Returns:
Nothing.
void PawnHigh::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.

Parameters:
nameString holding the name of the group the pawn will target.
Returns:
Nothing.
void PawnHigh::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 will be executed.

Parameters:
distancefloat value specifying the distance (in texels) to search for targets.
orderString holding the name of the order to execute.
attributeString holding the name of the attribute the target must have.
Returns:
Nothing.
void PawnHigh::FindPointOrder ( string  order)

Search the area within 3000 texels of the pawn for the nearest visible ScriptPoint.

Once a ScriptPoint is in the pawn's field of view, it becomes the current ScriptPoint.

Parameters:
orderString holding the name of the order to execute; empty ("") to turn off checking.
Returns:
Nothing.
void PawnHigh::SetWeapon ( string  section)

Activate the weapon defined in pawn.ini as section.

The weapon actor will attach to the pawn actor.

Parameters:
sectionString holding the name of a section in the pawn.ini file.
Returns:
Nothing.
void PawnHigh::RemoveWeapon ( )

Remove the currently activated weapon actor of this pawn.

Returns:
Nothing.
void PawnHigh::FireProjectile ( string  projectile,
string  boneName,
float  offsetX,
float  offsetY,
float  offsetZ,
string  attribute,
string  sound 
)

Shoot a projectile in the direction the pawn is facing.

Parameters:
projectileString holding the name of the projectile type to fire.
boneNameString holding the name of a bone in the pawn (or the pawn's weapon actor if present) acting as launch location.
offsetXSpecifies the offset in x-direction (left) from the bone's orientation.
offsetYSpecifies the offset in y-direction (up) from the bone's orientation.
offsetZSpecifies the offset in z-direction (in) from the bone's orientation.
attributeString holding the name of the attribute to damage.
soundString holding the name of the sound file to play while firing.
Returns:
Nothing.
void PawnHigh::AudibleRadius ( float  distance)

Set the audible radius for all sounds played by this pawn's script to distance.

Parameters:
distancefloat value specifying the audible radius (in texels).
Returns:
Nothing.
void PawnHigh::AddRandomSound ( int  soundID,
float  minTime,
float  maxTime,
string  sound 
)

Play back the given sound file at an interval that is randomly chosen between minTime and maxTime each time the sound is played.

Parameters:
soundIDinteger value used to identify the sound for deletion.
minTimefloat value specifying the minimum time interval.
maxTimefloat value specifying the maximum time interval.
soundString holding the name of the sound file to play.
Returns:
Nothing.
void PawnHigh::DelRandomSound ( int  soundID)

Remove the specified sound from the list of playing sounds.

Parameters:
soundIDinteger value identifying the sound to remove.
Returns:
Nothing.
void PawnHigh::SoundLoop ( bool  flag)

Set the looping behaviour of sounds played by this pawn's script.

Parameters:
flag
  • true then sounds will be played looping until another sound is played.
  • false then sounds will only play while the current method is being executed.
Returns:
Nothing.
void PawnHigh::ChangeMaterial ( string  section)

Change the material on the pawn's actor according to the specified section of material.ini.

Parameters:
sectionString holding the name of a section in the material.ini file.
Returns:
Nothing.
void PawnHigh::ChangeWeaponMaterial ( string  section)

Change the material on the pawn's weapon actor according to the specified section of material.ini.

Parameters:
sectionString holding the name of a section in the material.ini file.
Returns:
Nothing.
void PawnHigh::AddExplosion ( string  explosion,
string  boneName,
float  offsetX,
float  offsetY,
float  offsetZ 
)

Attach an explosion effect predefined in explosion.ini to the specified actor bone.

Offset the attachment point from the bone by the amounts in (offsetX, offsetY, offsetZ).

Parameters:
explosionString holding the name of a section in the explosion.ini file.
boneNameString holding the name of a bone present in the pawn.
offsetXfloat value specifying the offset in x-direction.
offsetYfloat value specifying the offset in y-direction.
offsetZfloat value specifying the offset in z-direction.
Returns:
Nothing.
void PawnHigh::FadeIn ( float  time,
float  alpha 
)

Increase the alpha of the actor (and any attached weapon) from its present value to alpha in time seconds.

The next action is executed only after the specified alpha value is reached.

Parameters:
timefloat value specifying the time (in seconds) the fade will take.
alphafloat value specifying the transparency of the actor with 0 being fully transparent and 255 being fully opaque.
Returns:
Nothing.
void PawnHigh::FadeOut ( float  time,
float  alpha 
)

Decrease the alpha of the actor (and any attached weapon) from its present value to alpha in time seconds.

The next action is executed only after the specified alpha value is reached.

Parameters:
timefloat value specifying the time (in seconds) the fade will take.
alphafloat value specifying the transparency of the actor with 0 being fully transparent and 255 being fully opaque.
Returns:
Nothing.
void PawnHigh::Console ( bool  flag)

Set whether information about this pawn's script is displayed on the screen.

This includes any error messages generated at runtime.

Parameters:
flag
  • true then the console for this pawn is activated.
  • false then the console is turned off.
Returns:
Nothing.
void PawnHigh::debug ( var  variable)

Output the contents of variable to the console window for this pawn, assuming the console is active.

Used to debug scripts that are not working correctly.

Parameters:
variableSpecifies any variable from the script and can be of any type (i.e. string, float, int or bool).
Returns:
Nothing.
void PawnHigh::LowLevel ( string  order)

Switch script execution type from current high level methods to the low level C style programming.

Parameters:
orderString holding the name of the low level order that will be executed next.
Returns:
Nothing.
void PawnHigh::EndScript ( )

Stop the execution of the script (without removing the pawn's actor).

Returns:
Nothing.
void PawnHigh::Conversation ( )

Initiate the pawn's conversation, if one is defined.

This is the same as if the player used the Use key on the pawn.

Returns:
Nothing.
void PawnHigh::Conversation ( string  order)

Initiate the pawn's conversation, if one is defined.

This is the same as if the player used the Use key on the pawn.

Parameters:
orderString holding the name of the order used as starting point for the conversation.
Returns:
Nothing.
void PawnHigh::Speak ( string  textSection,
string  sound,
float  textScrollSpeed,
float  textDisplayTime 
)

Show a text string and optionally play a sound at the pawn's position during a conversation. If not in a conversation, just play back the specified sound file.

Note:
Sync points for the camera are automatically inserted after each Speak command. When pressing the space bar to skip the text display and/or the audio playback also the camera will fast-forward its movements till the next sync point is reached.
Parameters:
textSectionString holding the name of a section in the conversation text file.
soundString holding the name of the sound file (WAV, OGG, MP3) in the dubbing directory to play (optional).
textScrollSpeedfloat value specifying the speed at which the individual letters of the text will be diplayed (optional).
textDisplayTimefloat value specifying the amount of time (in seconds) the text will be shown once it is completely displayed (optional).
Returns:
Nothing.
void PawnHigh::ShowTextDelay ( int  textID,
string  szEntityName,
string  animation,
string  text,
string  font,
float  time,
string  sound,
int  x,
int  y,
string  align,
float  alpha 
)

Display the given text attached to an entity (Pawn, Attribute, StaticEntityProxy) or the player.

The text will move along with the entity keeping its relative position.

Note:
textIDs are shared among all scripts. Hence, when using the ShowText() or ShowTextDelay() methods to display multiple text objects simultaneously each method has to use a unique textID. To display a text in multiple lines <CR> can be used as a separator.
Parameters:
textIDinteger value used to identify this text object (0 - 19).
szEntityNameString holding the name of the entity to attach the text to ("Player" to specify the player). Use an empty string ("") for absolute screen coordinates.
animationString holding the name of the animation the entity/player will play while the text is shown. If left empty ("") the previously active animation will continue.
textString holding the text to display.
fontString specifying the font to use.
timefloat value specifying the number of seconds to wait before continuing to the next action.
soundString holding the name of a WAV file to play once while the text is displayed. (not implemented)
xinteger value defining the relative or absolute x-position to draw the text on the screen.
yinteger value defining the relative or absolute y-position to draw the text on the screen.
alignString defining the alignment of the text relative to the origin of the entity/player ("left", "right", "center").
alphafloat value specifying the transparency of the text with 0 being fully transparent and 255 being fully opaque.
Returns:
Nothing.
void PawnHigh::ShowText ( int  textID,
string  szEntityName,
string  animation,
string  text,
string  font,
string  sound,
int  x,
int  y,
string  align,
float  alpha 
)

Display the given text attached to an entity (Pawn, Attribute, StaticEntityProxy) or the player.

The text will move along with the entity keeping its relative position.

Note:
textIDs are shared among all scripts. Hence, when using the ShowText() or ShowTextDelay() methods to display multiple text objects simultaneously each method has to use a unique textID. To display a text in multiple lines <CR> can be used as a separator.
Parameters:
textIDinteger value used to identify this text object (0 - 19).
szEntityNameString holding the name of the entity to attach the text to ("Player" to specify the player). Use an empty string ("") for absolute screen coordinates.
animationString holding the name of the animation the entity/player will play while the text is shown. If left empty ("") the previously active animation will continue.
textString holding the text to display.
fontString specifying the font to use.
soundString holding the name of a WAV file to play once while the text is displayed. (not implemented)
xinteger value defining the relative or absolute x-position to draw the text on the screen.
yinteger value defining the relative or absolute y-position to draw the text on the screen.
alignString defining the alignment of the text relative to the origin of the entity/player ("left", "right", "center").
alphafloat value specifying the transparency of the text with 0 being fully transparent and 255 being fully opaque.
Returns:
Nothing.
void PawnHigh::RemoveText ( int  textID)

Remove the text object with the ID textID displayed by the ShowText() or ShowTextDelay() method.

Parameters:
textIDinteger value used to identify a text object (0 - 19).
Returns:
Nothing.
void PawnHigh::SetHudDraw ( bool  show)

Show or hide the HUD.

Parameters:
show
  • true to show the HUD.
  • false to hide the HUD.
Returns:
Nothing.
void PawnHigh::HideFromRadar ( bool  hide)

Show or hide the pawn on the HUD radar screen.

Parameters:
hide
  • true to hide the pawn.
  • false to show the pawn.
Returns:
Nothing.
void PawnHigh::MouseControlledPlayer ( bool  flag)

Define whether the player can be controlled with the mouse or not.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Player.SetMouseControlled() instead.
Parameters:
flag
  • true to control the player with the mouse.
  • false to disable mouse control for the player.
Returns:
Nothing.
void PawnHigh::SetKeyPause ( bool  pause)

Pause or restore the keyboard control.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Input.SetEnabled() instead.
Parameters:
pause
  • true to pause the keyboard control.
  • false to restore the keyboard control.
Returns:
Nothing.
void PawnHigh::AllowUseKey ( bool  flag)

Set the Use key control for this pawn.

Parameters:
flag
  • true to allow the initiation of conversations via the Use key (default behaviour).
  • false to disable the initiation of conversations via the Use key.
Returns:
Nothing.
void PawnHigh::AttachToActor ( string  slave,
string  slaveBone,
string  masterBone,
float  offsetX,
float  offsetY,
float  offsetZ,
float  angleX,
float  angleY,
float  angleZ 
)

Attach the pawn named slave 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.

Parameters:
slaveString holding the name of the pawn to attach.
slaveBoneString holding the name of a bone of the pawn's actor to be attached.
masterBoneString holding the name of a bone of this pawn's actor.
offsetXfloat value specifying the offset in x-direction.
offsetYfloat value specifying the offset in y-direction.
offsetZfloat value specifying the offset in z-direction.
angleXfloat value specifying the angle to rotate around the x-axis (in degrees).
angleYfloat value specifying the angle to rotate around the y-axis (in degrees).
angleZfloat value specifying the angle to rotate around the z-axis (in degrees).
Returns:
Nothing.
void PawnHigh::DetachFromActor ( string  slave)

Detach the specified pawn from its master.

Parameters:
slaveString holding the name of the attached pawn.
Returns:
Nothing.
void PawnHigh::AttachBlendActor ( string  slave,
string  master = self.EntityName 
)

Attach the specified entity to the given master entity.

The attached actor will use the same animation as its master.

Parameters:
slaveString holding the name of the entity to attach.
masterString holding the name of the master entity.
Returns:
Nothing.
void PawnHigh::DetachBlendActor ( string  slave,
string  master = self.EntityName 
)

Detach the specified entity from its master.

Parameters:
slaveString holding the name of the attached entity.
masterString holding the name of the master entity.
Returns:
Nothing.
void PawnHigh::AttachAccessory ( string  slave,
string  master = self.EntityName 
)

Attach the specified accessory to the given master entity.

The attached actor will use the same animation as its master.

Parameters:
slaveString holding the name of the accessory to attach as defined in the pawn.ini file.
masterString holding the name of the master entity.
Returns:
Nothing.
void PawnHigh::DetachAccessory ( string  slave,
string  master = self.EntityName 
)

Detach the specified accessory from its master.

Parameters:
slaveString holding the name of the attached accessory as defined in the pawn.ini file.
masterString holding the name of the master entity.
Returns:
Nothing.
int PawnHigh::random ( int  lower,
int  upper 
)

Generate a random integer number in the range lower to upper.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Math.rand() instead.
Parameters:
lowerSpecifies the lower limit of the random number.
upperSpecifies the upper limit of the random number.
Returns:
a random integer number in the given range.
float PawnHigh::sin ( float  value)

Get the sine of the given value.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Math.sin instead.
Parameters:
valuefloat value to calculate the sine of (in radians).
Returns:
the sine of the given value.
float PawnHigh::cos ( float  value)

Get the cosine of the given value.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Math.cos instead.
Parameters:
valuefloat value to calculate the cosine of (in radians).
Returns:
the cosine of the given value.
float PawnHigh::tan ( float  value)

Get the tangent of the given value.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Math.tan instead.
Parameters:
valuefloat value to calculate the tangent of (in radians).
Returns:
the tangent of the given value.
float PawnHigh::asin ( float  value)

Get the arc sine of the given value.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Math.asin instead.
Parameters:
valuefloat value to calculate the arc sine of.
Returns:
the principal value of the arc sine of the given value (in radians).
float PawnHigh::acos ( float  value)

Get the arc cosine of the given value.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Math.acos instead.
Parameters:
valuefloat value to calculate the arc cosine of.
Returns:
the principal value of the arc cosine of the given value (in radians).
float PawnHigh::atan ( float  value)

Get the arc tangent of the given value.

Deprecated:
This function is redundant and will be removed for the 0.80.0 release. Use Math.atan instead.
Parameters:
valuefloat value to calculate the arc tangent of.
Returns:
the principal value of the arc tangent of the given value (in radians).