
|
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.
Retreat 0.25, 0.25, 2000.0, 1.0
Argument 1: Health fail rate - if number drops below, then AI CAN flee (%: ranges from 0=never worries to 1=retreat as soon as hit)
Argument 2: Morale fail rate - if number drops below, then AI WILL flee (%: ranges from 0=never worry to 1=retreat immediately)
Argument 3: Time interval for morale checks (msec)
Argument 4: Maximum number of times to retreat before not retreating any more
[ Cross-Reference: Flee ]
This instinct allows the AI to retreat if certain conditions are met, triggering a loss of confidence or composure. It is interesting to note that this instinct can also trigger the Flee instinct (as defined by arguments 1 and 2). At present, it is purely speculative whether argument 1's value is a percentage of a thing's health (as set in its template setting). Argument 2 is usually the same or lower, than the value given to argument 1, although how the morale level is calculated by JK/MotS engine is currently unclear (and because argument 1 gives the AI the possibility of fleeing, it is difficult to ascertain, for certain, which argument is responsible for invoking the Flee instinct). Due to the damage amounts of the default weapons in JK, it is suggested to keep argument 4 at either 0.0 or 1.0, as if argument 1 has already been reached and invoked the Flee instinct, then the AI is already likely to have very little health left with which to continue attacking 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.
This instinct needs to be invoked by LookForTarget before any effect occurs, otherwise you can repeatedly hit the AI but it will not react; the AI remains stationary until LookForTarget instinct is completed.
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 testing has monitored the extreme range of values for this instinct's arguments. Valid values range from 0.0 to 1.0 - if a 50/50 choice is desired then set the argument values to 0.5. It is highly recommended to peruse existing pedestrian/civilian AI files, to find a balance that best suits the tone of the character when applying this AI instinct.