Difference between revisions of "IsAttacking"
Jump to navigation
Jump to search
imported>Haama (Created) |
imported>Shademe m (Fixed formatting) |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 8: | Line 8: | ||
== Notes == | == Notes == | ||
* Will return 1 while the | * Will return 1 while the Actor is attacking, but sometimes even longer than [[IsCasting]]. So this will not work reliably: | ||
if MyRef.isattacking == 1 && MyRef.iscasting == 0 | |||
message"I am attacking but not casting!" | |||
endif | |||
Use this instead: | |||
if MyRef.AnimPathIncludes "attack" == 1 && MyRef.AnimPathIncludes "cast" == 0 | |||
message"I am attacking but not casting!" | |||
endif | |||
* Will return 1 for a few frames while the player is power attacking as well. In cases where a normal and a power attack is to be differentiated, [[onControlDown]] and [[isControlPressed]] can be substituted for [[isAttacking]] and [[isPowerAttacking]] respectively, with appropriate checks. | |||
== See Also == | == See Also == | ||
* [[IsPowerAttacking]] | * [[IsPowerAttacking]] | ||
* [[IsRecoiling]] | * [[IsRecoiling]] | ||
* [[IsAnimPlaying]] | |||
* [[IsAnimGroupPlaying]] | * [[IsAnimGroupPlaying]] | ||
Line 19: | Line 33: | ||
[[Category: Actor State Functions]] | [[Category: Actor State Functions]] | ||
[[Category: Actor State Functions (OBSE)]] | [[Category: Actor State Functions (OBSE)]] | ||
[[Category: Animation Functions]] | |||
[[Category: Animation Functions (OBSE)]] | [[Category: Animation Functions (OBSE)]] |
Latest revision as of 10:12, 4 June 2011
A command for Oblivion Script Extender
Syntax:
(IsAttacking:bool) actor:ref.IsAttacking
Returns 1 if the calling actor is attacking.
Notes[edit | edit source]
- Will return 1 while the Actor is attacking, but sometimes even longer than IsCasting. So this will not work reliably:
if MyRef.isattacking == 1 && MyRef.iscasting == 0 message"I am attacking but not casting!" endif
Use this instead:
if MyRef.AnimPathIncludes "attack" == 1 && MyRef.AnimPathIncludes "cast" == 0 message"I am attacking but not casting!" endif
- Will return 1 for a few frames while the player is power attacking as well. In cases where a normal and a power attack is to be differentiated, onControlDown and isControlPressed can be substituted for isAttacking and isPowerAttacking respectively, with appropriate checks.