I'm a doctor, not a mechanic

Legacy:Pawn (UT)/AI Functions

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT :: Actor (UT) >> Pawn (UT) / AI Functions

Note: This page was written for the UT version of the Pawn class.

AI Functions[edit]

Native Functions[edit]

bool actorReachable (Actor (UT) anActor) 
This function returns true if the Actor (UT) passed is directly reachable using the current locomotion method.
bool CanSee (Actor (UT) Other) 
This function behaves in the same way as LineOfSightTo() but takes into account the Pawn (UT)'s peripheral vision (hence, preventing pawns from seeing actors directly behind them).
ClearPaths ( ) 
I believe that this function clears the internal path list held by the bot. It is only used in one function from UScript function, Bot (UT).PickDestination.
vector EAdjustJump ( ) 
This function seems to work on the Velocity property of the pawn. It adjusts the velocity of the Pawn such that it will actually end its jump at the right point.
Actor (UT) FindBestInventoryPath (out float MinWeight, bool bPredictRespawns ) 
This function returns an actor than can be used to cause the pawn to run towards the "best" inventory. How the "best inventory item" is defined is unknown. The bPredictRespawns parameter can be used to allow the pawn to move towards items that will have respawned by the time they get there.
Actor (UT) FindPathTo (vector aPoint, optional bool bSinglePath, optional bool bClearPaths) 
It's not entirely clear what this function does as it's not used that much. As far as I can tell it returns an Actor (UT) at the location specified by aPoint, or None if there is no actor there. You can see examples of it's use in the classes Engine.PlayerPawn and UnrealShare.ScriptedPawn. The bSinglePath and bClearPaths are used by the AI internal functions to find the most appropriate route to the given actor. I believe that bSinglePath avoids routes with alternate paths if true, and bClearPaths will clear the pawn's current internal path list – but that's all guesswork. Krash: From my experience this function fills up the pawn's internal path list with the paths that will lead it to the location specified by aPoint. It will then return the first navigation point that the pawn should move towards. If aPoint connot be reached by using paths then this function will return None.
Actor (UT) FindPathToward (Actor (UT) anActor, optional bool bSinglePath, optional bool bClearPaths) 
This function returns an Actor than is used by the native movement code to travel to the destination specified by anActor. In Unreal Tournament this function is used to cause the Bot (UT)s to travel towards things like flag bases, and travel down alternate paths. The bSinglePath and bClearPaths are used by the AI internal functions to find the most appropriate route to the given actor. I believe that bSinglePath avoids routes with alternate paths if true, and bClearPaths will clear the pawn's current internal path list – but that's all guesswork. Krash: From my experience this function fills up the pawn's internal path list with the paths that will lead it to the location of the actor specified by anActor. It will then return the first navigation point that the pawn should move towards. If anActor connot be reached by using paths then this function will return None.
NavigationPoint (UT) FindRandomDest (optional bool bClearPaths) 
This function returns a navigation point randomly selected (in some unknown manner). Examples of the use of this function can be found in the classes UnrealShare.ScriptedPawn and UnrealShare.Nali.
int FindStairRotation (float DeltaTime) 
One presumes this is used to handle spiral stair cases - but as it's not used anywhere it's difficult to say. Dma: It is used in PlayerPawn to automatically look up or down stairs if the user has that option selected (bLookUpStairs).
bool LineOfSightTo (Actor (UT) Other) 
This function returns true if any of the origin, top, or bottom of the Actor (UT) passed in Other are visible. NOTE: This does NOT account for solid, transparent glass... This function merely makes use of standard traces.
Actor (UT) PickAnyTarget (out float bestAim, out float bestDist, vector FireDir, vector projStart) 
This function is used to pick any target to shoot at - presumably anything that's around will do. The function is not used by the UT code.
Pawn (UT) PickTarget (out float bestAim, out float bestDist, vector FireDir, vector projStart) 
This function is used by the weapon code to select a target to shoot at. The weapon code is also responsible for calling WarnTarget() if appropriate. Targets are any actor with bProjTarget=true.
bool PickWallAdjust ( ) 
Check to see if an obstruction can be jumped (only if there is a knee height obstruction). If this is the case start the jump and return the current destination. If the obstacle cannot be lept then try to step around it by returning a destination 90 degrees right or left depending on traces out and floor checks.
bool PointReachable (vector aPoint) 
This function returns true if the point passed is directly reachable using the current locomotion method.
WaitForLanding ( ) [latent] 
This function is used in the pre-begin and begin states to wait for the pawn to land on the floor (guess alert! guess alert!).

Scripted Functions[edit]

bool CheckFutureSight (float DeltaTime) 
This function attempts to determine if the current target of the pawn will be visible in deltatime seconds. The calculation is based upon the target's current velocity. If the target is expected to be visible then the function returns true.
DamageAttitudeTo (Pawn (UT) Other) 
This function is not implemented within UT. At its most basic it is simply used to set the enemy of the pawn to the source of the damage (Other). In the Nali class this function is also used to change the state of the pawn.
FearThisSpot (Actor (UT) ASpot) 
This function is called to make pawns avoid a particular spot.
float GetRating ( ) 
This function returns the "skill rating" of the pawn. The base rating for all UT pawns is 1000.
WarnTarget (Pawn (UT) shooter, float projSpeed, vector FireDir) 
Does nothing at this level but can be used to cause pawns to duck incoming projectiles.

Related Topics[edit]

Discussion[edit]