Ai: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A set of code used in a routine to operate an [[actor]]. Not usually needed.
The command '''ai''' refers to both the declaration, which defines a combination of [[action]]s and [[move]]ments for an [[actor]] to execute, and to the statement that executes a predefined ai within the [[actor]]'s code.


ai <name> <action> <move> <type>
== Declaration ==


<name> is the name of the ai routine.
<span {{code}}>'''ai''' <name> <action> <move> <moveflags>... </span>


<action> is the [[action]] the [[actor]] will display when the ai routine is called.
Defines action and movement for the actor to use. This statement must be placed outside of any actor or event code.


<move> is the [[move]] used during the ai routine.
==== Arguments ====


<type> is a parameter set used for directional functions on the [[move]] command.
* <span {{code}}><name></span> is the name of the ai routine.


Values for <type> are:
* <span {{code}}><action></span> is the [[action]] the [[actor]] will display when the ai routine is called.


faceplayer, geth, getv, randomangle, faceplayerslow, spin, faceplayersmart, fleeenemy, jumptoplayer, seekplayer, furthestdir, and dodgebullet. See [[move]] for more information.
* <span {{code}}><move></span> is the [[move]] used during the ai routine.
 
* <span {{code}}><moveflags...></span> is a (possibly empty) sequence of parameters that specify certain hardcoded movement behavior.
 
:See [[move#moveflags|moveflags]] for more information.
 
== Runtime Command ==
 
<span {{code}}>'''ai''' <ainame></span>
 
Executes a predefined '''ai''' inside the actor code, identified by its ''<ainame>''.


[[Category:Duke3D 1.3/1.5 commands]]
[[Category:Duke3D 1.3/1.5 commands]]
[[Category:Sprite manipulation]]

Latest revision as of 06:22, 10 January 2021

The command ai refers to both the declaration, which defines a combination of actions and movements for an actor to execute, and to the statement that executes a predefined ai within the actor's code.

Declaration

ai <name> <action> <move> <moveflags>...

Defines action and movement for the actor to use. This statement must be placed outside of any actor or event code.

Arguments

  • <name> is the name of the ai routine.
  • <action> is the action the actor will display when the ai routine is called.
  • <move> is the move used during the ai routine.
  • <moveflags...> is a (possibly empty) sequence of parameters that specify certain hardcoded movement behavior.
See moveflags for more information.

Runtime Command

ai <ainame>

Executes a predefined ai inside the actor code, identified by its <ainame>.