Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Difference between revisions of "Legacy:AIController"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
 
(more subclasses)
Line 4: Line 4:
  
 
==Properties ==
 
==Properties ==
; bool bHunting : This is true if the controlled [[Legacy:Pawn|pawn]] is hunting another [[Legacy:Pawn|pawn]].
+
;bool bHunting : This is true if the controlled [[Legacy:Pawn|pawn]] is hunting another [[Legacy:Pawn|pawn]].
; bool bAdjustFromWalls : Auto-adjust around corners, with no hitwall notification for [[Legacy:Controller|controller]] or [[Legacy:Pawn|pawn]] (???)
+
;bool bAdjustFromWalls : auto-adjust around corners, with no hitwall notification for [[Legacy:Controller|controller]] or [[Legacy:Pawn|pawn]] (???)
; [[Legacy:AIScript|AIScript]] MyScript : The AIScript that controls this AIController.
+
;AIScript MyScript : If this [[Legacy:AIController|AIController]] is based on a script, the script is in this variable.
; float Skill : The skill of the AI. Generally, from 0 to 7.
+
;float Skill : The skill of the AI. Generally, from 0 to 7.
  
 
==Functions ==
 
==Functions ==
; WaitToSeeEnemy() (native, final, latent) : Returns when the [[Legacy:Pawn|pawn]] is looking directly at a visible enemy.
+
;native final latent function WaitToSeeEnemy() : returns when the [[Legacy:Pawn|pawn]] is looking directly at a visible enemy.
; bool WeaponFireAgain( float RefireRate, bool bFinishedFire ) : Called by [[Legacy:Weapon|Weapon]]. Returns true if the weapon should fire.
+
;function bool WeaponFireAgain(float RefireRate, bool bFinishedFire) : called by [[Legacy:Weapon|Weapon]]. Returns true if the weapon should fire.
; bool TriggerScript( [[Legacy:Actor|Actor]] Other, [[Legacy:Pawn|Pawn]] EventInstigator ) : Any trigger is sent to this function, which in turn triggers MyScript if it exists.
+
;function bool TriggerScript(actor Other, pawn EventInstigator) : Any trigger is sent to this function, which in turn triggers MyScript if it exists.
; DisplayDebug( [[Legacy:Canvas|Canvas]] Canvas, out float YL, out float YPos ) : If the "showdebug" console command is on, this is called to display debug information on the screen.
+
;function DisplayDebug(Canvas Canvas, out float YL, out float YPos) : If the "showdebug" console command is on, this is called to display debug information on the screen.
; float AdjustDesireFor( [[Legacy:Pickup|Pickup]] P ) : In subclasses, returns a float indicating how much the AI wants the [[Legacy:Pickup|Pickup]] P. In this class, it always returns 0.
+
;function float AdjustDesireFor(Pickup P) : In subclasses, returns a float indicating how much the AI wants the [[Legacy:Pickup|Pickup]] P. In this class, it always returns 0.
; int GetFacingDirection() : Returns direction faced relative to movement dir, where 0 = forward, 16384 = right, 32768 = back, and 49152 = left
+
;function int GetFacingDirection() : returns direction faced relative to movement dir, where 0 = forward, 16384 = right, 32768 = back, and 49152 = left
; AdjustView( float DeltaTime ) : Called if Controller's pawn is the viewtarget of a player
+
;function AdjustView(float DeltaTime) : called if Controller's pawn is the viewtarget of a player
; SetOrders( name NewOrders, [[Legacy:Controller|Controller]] OrderGiver ) :
+
;function SetOrders(name NewOrders, Controller OrderGiver), function actor GetOrderObject(), function name GetOrders() : In subclasses, sets and gets info about the AI's orders, but in this class they don't do anything.
; Actor GetOrderObject():
+
;event PrepareForMove(NavigationPoint Goal, ReachSpec Path) : Called if the reachspec doesn't support the pawn's current configuration. The code should tell the [[Legacy:Pawn|pawn]] what to do to deal with it (e.g. crouch). It's implemented in subclasses; here it doesn't do anything.
; name GetOrders() : In subclasses, sets and gets info about the AI's orders, but in this class they don't do anything.
+
;function WaitForMover(Mover M) : Sets up the AI to wait for Mover M to tell the AI that it has completed its move. Sets PendingMover.
; WaitForMover( [[Legacy:Mover|Mover]] M ) : Sets up the AI to wait for Mover M to tell the AI that it has completed its move. Sets PendingMover.
+
;function MoverFinished() : Called by Mover when it finishes a move, and this pawn has the mover set as its PendingMover.
; MoverFinished() : Called by Mover when it finishes a move, and this pawn has the mover set as its PendingMover.
+
;function UnderLift(Mover M) : called by mover when it hits a pawn with that mover as its pendingmover while moving to its destination.
; UnderLift( [[Legacy:Mover|Mover]] M ) : Called by mover when it hits a pawn with that mover as its pendingmover while moving to its destination.
+
;function bool PriorityObjective() : This always returns false here.
; bool PriorityObjective() : This always returns false here.
+
;function Startle(Actor A) : "Startles" the AI. Basically, this is a message to the AI to stop everything and re-evaluate its situation as soon as possible. Something calls this when the AI absolutely needs to know about it RIGHT NOW.
; Startle( [[Legacy:Actor|Actor]] A ) : "Startles" the AI. Basically, this is a message to the AI to stop everything and re-evaluate its situation as soon as possible. Something calls this when the AI absolutely needs to know about it RIGHT NOW.  The Actor A being the cause of the startle.
+
  
==Events==
+
==Subclasses ==
; PrepareForMove( [[Legacy:NavigationPoint|NavigationPoint]] Goal, [[Legacy:ReachSpec|ReachSpec]] Path ) : Called if the reachspec doesn't support the pawn's current configuration. The code should tell the Pawn what to do to deal with it (e.g. crouch). It's implemented in subclasses; here it doesn't do anything.
+
+-[[Legacy:AIController|AIController]]
 
+
    +-[[Legacy:ScriptedController|ScriptedController]]
==Known Subclasses==
+
        +-[[Legacy:Bot|Bot]]
AIController
+
        |  +-[[Legacy:XBot|xBot]]
  +- [[Legacy:ScriptedController|ScriptedController]]
+
        |      +-[[Legacy:InvasionBot|InvasionBot]] ''(Epic Bonuspack)''
  |  +- [[Legacy:Bot|Bot]]
+
        +-[[Legacy:MonsterController|MonsterController]] ''(Epic Bonuspack)''
  |  |  +- [[Legacy:XBot|xBot]]
+
  |  |      +- [[Legacy:InvasionBot|InvasionBot]] (Epic Bonuspack & UT2004)
+
  |  +- [[Legacy:MonsterController|MonsterController]] (Epic Bonuspack & UT2004)
+
  |  +- [[Legacy:ScriptedTriggerController|ScriptedTriggerController]]
+
  +- [[Legacy:TurretController|TurretController]] (UT2004)
+
      +- [[Legacy:LinkTurretController|LinkTurretController]]
+
      +- [[Legacy:ONSTurretController|ONSTurretController]]
+
      +- [[Legacy:SentinelController|SentinelController]]
+
            +- [[Legacy:ASSentinelController|ASSentinelController]]
+
 
+
==Relevant Links==
+
* [[Legacy:AIScript|AIScript]]
+
* [[Legacy:AI Scripting Reference|AI Scripting Reference]]
+
* [[Legacy:Controller Overview|Controller Overview]]
+
* [[Legacy:PlayerController|PlayerController]] – Controllers for player characters
+
 
+
==Discussion==
+
 
+
'''SuperApe:''' Updated known subclasses.
+
 
+
[[Category:Legacy Class (UT2003)|{{PAGENAME}}]]
+

Revision as of 07:21, 14 March 2003

UT2003 :: Actor >> Controller >> AIController

This is the parent class of all AI-based controllers.

Properties

bool bHunting 
This is true if the controlled pawn is hunting another pawn.
bool bAdjustFromWalls 
auto-adjust around corners, with no hitwall notification for controller or pawn (???)
AIScript MyScript 
If this AIController is based on a script, the script is in this variable.
float Skill 
The skill of the AI. Generally, from 0 to 7.

Functions

native final latent function WaitToSeeEnemy() 
returns when the pawn is looking directly at a visible enemy.
function bool WeaponFireAgain(float RefireRate, bool bFinishedFire) 
called by Weapon. Returns true if the weapon should fire.
function bool TriggerScript(actor Other, pawn EventInstigator) 
Any trigger is sent to this function, which in turn triggers MyScript if it exists.
function DisplayDebug(Canvas Canvas, out float YL, out float YPos) 
If the "showdebug" console command is on, this is called to display debug information on the screen.
function float AdjustDesireFor(Pickup P) 
In subclasses, returns a float indicating how much the AI wants the Pickup P. In this class, it always returns 0.
function int GetFacingDirection() 
returns direction faced relative to movement dir, where 0 = forward, 16384 = right, 32768 = back, and 49152 = left
function AdjustView(float DeltaTime) 
called if Controller's pawn is the viewtarget of a player
function SetOrders(name NewOrders, Controller OrderGiver), function actor GetOrderObject(), function name GetOrders() 
In subclasses, sets and gets info about the AI's orders, but in this class they don't do anything.
event PrepareForMove(NavigationPoint Goal, ReachSpec Path) 
Called if the reachspec doesn't support the pawn's current configuration. The code should tell the pawn what to do to deal with it (e.g. crouch). It's implemented in subclasses; here it doesn't do anything.
function WaitForMover(Mover M) 
Sets up the AI to wait for Mover M to tell the AI that it has completed its move. Sets PendingMover.
function MoverFinished() 
Called by Mover when it finishes a move, and this pawn has the mover set as its PendingMover.
function UnderLift(Mover M) 
called by mover when it hits a pawn with that mover as its pendingmover while moving to its destination.
function bool PriorityObjective() 
This always returns false here.
function Startle(Actor A) 
"Startles" the AI. Basically, this is a message to the AI to stop everything and re-evaluate its situation as soon as possible. Something calls this when the AI absolutely needs to know about it RIGHT NOW.

Subclasses

+-AIController
    +-ScriptedController
        +-Bot
        |   +-xBot
        |       +-InvasionBot (Epic Bonuspack)
        +-MonsterController (Epic Bonuspack)