Difference between revisions of "GetShouldAttack"
Jump to navigation
Jump to search
imported>Maturin |
imported>Haama |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 5: | Line 5: | ||
Return value indicates the desire of the calling actor to attack the TargetActor. If the return value is greater than 0, the actor will attack the target under normal circumstances (i.e. the actor is aggressive, can detect the target, is not restrained or unconscious, etc.). | Return value indicates the desire of the calling actor to attack the TargetActor. If the return value is greater than 0, the actor will attack the target under normal circumstances (i.e. the actor is aggressive, can detect the target, is not restrained or unconscious, etc.). | ||
==Notes== | |||
*This function takes several factors into consideration, so the value returned does not always reflect the calling actor's hostility toward the target. For instance, the return value decreases as the distance between the two actors increases, and is zero if the actors are in different cells. | |||
*A more reliable way to determine if one actor is hostile toward another: | |||
<pre>if ( callingActor.getAV aggression > 5 ) | |||
if ( callingActor.getDisposition target < callingActor.getAV aggression ) | |||
; actor is hostile toward target | |||
endif | |||
endif</pre> | |||
[[Category: Functions]] | [[Category: Functions]] | ||
[[Category:Functions (CS)]] | |||
[[Category: Functions (CS 1.0)]] | |||
[[Category: Combat Functions]] | [[Category: Combat Functions]] | ||
[[Category: Combat Functions (CS 1.0)]] | |||
[[Category: Condition Functions]] | [[Category: Condition Functions]] | ||
[[Category: Condition Functions (CS 1.0)]] | |||
<!-- Begin Search Terms | |||
Get | |||
Should | |||
Attack | |||
End Search Terms --> |
Latest revision as of 23:40, 14 October 2008
Syntax:
GetShouldAttack TargetActor
Example:
EvilBanditBoss.GetShouldAttack player
Return value indicates the desire of the calling actor to attack the TargetActor. If the return value is greater than 0, the actor will attack the target under normal circumstances (i.e. the actor is aggressive, can detect the target, is not restrained or unconscious, etc.).
Notes[edit | edit source]
- This function takes several factors into consideration, so the value returned does not always reflect the calling actor's hostility toward the target. For instance, the return value decreases as the distance between the two actors increases, and is zero if the actors are in different cells.
- A more reliable way to determine if one actor is hostile toward another:
if ( callingActor.getAV aggression > 5 ) if ( callingActor.getDisposition target < callingActor.getAV aggression ) ; actor is hostile toward target endif endif