
|
With regard to unit clarification, 1 JKU is the equivalent of 1 meter, a time value of 3000.0 msec is the equivalent of 3 seconds and boolean values within are assigned by either a 0 (false) or 1 (true) value. Interestingly, both integer and floating-point numbers seem to be legal values for boolean arguments (but must be of the form 0.0 or 1.0).
Each instinct has a set number of arguments which must be set, in order for the AI character to use that instinct. The following details show examples, as well as listing each argument effect and type.
SenseDanger 0.10, 1.00 [ Flee on sight of the player ]
SenseDanger 0.10, 0.0 [ Flee on sight of combat ]
SenseDanger 100.0, 0.0 [ Flee only when damaged ]
Argument 1: Sensibility to danger (%: ranges from 0=danger sensed at "first sight of combat" to 100=AI has to be hit once to be "intimidated")
Argument 2: If <> 0, AI flees at first sight, else (=0) at the condition in Argument 1
[ Cross-Reference: Flee and Retreat ]
This instinct specifies conditions upon which the AI should initiate its Flee instinct. Unlike Retreat which can make an enemy flee, SenseDanger will explicity make the AI character flee upon completion of its conditions. With regard to argument information, argument 1 is unusual in-so-far-as its maximum setting is 100 (rather than 1.0) and sets the AI's perception towards any potential danger. Argument 2 is used to set the conditions of this instinct if the result of argument 1 has had no effect (or whether no effect was intended). What *can* be confusing for editors is trying to work out which of the two arguments initially invokes this instinct. Logically, argument 2 takes precedence; argument 1 is initialised and despite the value it is assigned, as long as argument 2 isn't 0 or 0.0, then the AI will not run away from the player (however - agressive behaviour or the AI receiving damage will trigger this instinct, culminating with the "Flee" instinct being activated). Effectively, what this means is that argument 1 is the minimum requirement to trigger this instinct (if 0, it will always be triggered), whilst argument 2 will trigger this instinct on sight (a non-0 value will make the AI flee if it sees the player).
This section details how the instinct is initiated. In some cases, a charactor's AI are dependent upon certain actions/events occurring before the instinct is triggered.
With the assumption that LookForTarget is present in the AI file, the results of testing are as follows (where A[number] means Argument[number]):
Please note that valid values range from 0.0 to 100.0 for argument 1 - if a 50/50 choice is desired then set the argument values to 0.5. It is highly recommended to peruse the default pedestrian/civilian AI files, to find a balance that best suits the tone of the character when applying this AI instinct.