Ai: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
rename 'type' to 'moveflags', add ellipsis so that it's clear there can be 0+ of them, reword slightly, tell where the moveflag defs come from
mNo edit summary
 
Line 1: Line 1:
The ai command is used in two different ways:
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.


#To define a combination of [[action]]s and [[move]]ments for an [[actor]] to execute.
== Declaration ==
#To execute a predefined ai within the actor's code.


''Define'' an ai outside of the actor code using the following syntax:
<span {{code}}>'''ai''' <name> <action> <move> <moveflags>... </span>


:'''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.


:<name> is the name of the ai routine.
==== Arguments ====
:<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.


:Values for each <moveflag> (defined in DEFS.CON) are:
* <span {{code}}><name></span> is the name of the ai routine.
:faceplayer, geth, getv, randomangle, faceplayerslow, spin, faceplayersmart, fleeenemy, jumptoplayer, seekplayer, furthestdir, and dodgebullet. See [[move]] for more information.


''Execute'' a predefined ai inside the actor code using the following syntax:
* <span {{code}}><action></span> is the [[action]] the [[actor]] will display when the ai routine is called.


:'''ai''' <ainame>
* <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]]
[[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>.