
|
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.
LookForOpposingTarget 500.0, 30000.0
Argument 1: Time interval before checking for targets (msec)
Argument 2: Time interval to go back to sleep if target is not visible (msec)
This MotS instinct allows the AI to attack other AI characters that do not share the same "alignment" value as itself (as set in the AI Setup line). By default, pedestrians and other neutral civilians possess a different AI alignment (0.0) value than Rebel soldiers (1.0). Therefore, the Rebel AI could begin to attack these passive AI characters. Mercifully, the editors of MotS realised this and created the cog verb "AIGetAlignment()" as a means of getting a handle on a potential target and be able to accurately evaluate the correct response for the AI. This information is documented in the actual class cogs for the Rebel actors (officers and commandos).
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 is without a doubt the most useful new addition to the Sith engine! In conjunction with the MotS COG verb "AIGetAlignment()" it is possible to query a character's AI file for their alignment:
alignment = AIGetAlignment();
if (alignment == 0) {
// 0 is usually used for pedestrians
}
else
if (alignment == -1) {
// -1 usually used for enemies
}
else
if (alignment == 1) {
// 1 usually used for friends/allies
}
Whilst LookForTarget is a valid instinct in MotS, this instinct seems to be an enhanced replacement, enabling the AI to establish any level thing's alignment (assuming it has an AI file). If this instinct is present, LookForTarget is not required for the AI file.
This communication between AI files and COG scripting is one of the reasons (aside from coloured lighting) that the Sith engine is sigificantly better than the Jedi engine.