Difference between revisions of "PlayIdleWithTarget - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Terra Nova2
(→‎Notes: Add a note about interference that can be caused by using PushActorAway and PlayIdleWithTarget on the same target.)
 
Line 30: Line 30:
*This function will cause the initiating actor to be stuck in combat alert status and unable to come out of it, no matter what combat based functions is called. To fix this, the package running must have the Weapon drawn flag checked. When checked, the alert status is back to normal when the package ends. See [http://forums.bethsoft.com/topic/1447688-issue-with-playidlewithtarget-and-killer-staying-in-combat-alert/?hl=%2Balert#entry22342004 source] for more info on how to use this in scenes.
*This function will cause the initiating actor to be stuck in combat alert status and unable to come out of it, no matter what combat based functions is called. To fix this, the package running must have the Weapon drawn flag checked. When checked, the alert status is back to normal when the package ends. See [http://forums.bethsoft.com/topic/1447688-issue-with-playidlewithtarget-and-killer-staying-in-combat-alert/?hl=%2Balert#entry22342004 source] for more info on how to use this in scenes.
*A weapon needs to be equipped before an idle that normally requires a weapon is played. If you don't have a weapon equipped, the idle will still play, but you will not be able to equip spells/weapons after the idle is complete. You will have to reload. This is similar to the issue above, except you don't need to have the weapon drawn in this case.
*A weapon needs to be equipped before an idle that normally requires a weapon is played. If you don't have a weapon equipped, the idle will still play, but you will not be able to equip spells/weapons after the idle is complete. You will have to reload. This is similar to the issue above, except you don't need to have the weapon drawn in this case.
*[[DrawWeapon - Actor]] will prevent this function from firing if one decides to use it to handle the issue above.
*[[DrawWeapon - Actor|DrawWeapon]] will prevent this function from firing if one decides to use it to handle the issue above.
*The [[PushActorAway - ObjectReference|PushActorAway]] function can interfere with idles. For example, if a weapon has a scripted effect to push an actor away on strike and that weapon is used in a kill move played with PlayIdleWithTarget, the targeted actor may fall from the kill move, get up, and then fall again several seconds later. This behavior can occur even if the targeted actor has been decapitated.


== See Also ==
== See Also ==

Latest revision as of 18:36, 26 November 2023

Member of: Actor Script

Plays the idle passed and overrides the actor's target with the given target. If no target is passed, then the idle will use the actor's current target instead.

Syntax[edit | edit source]

bool Function PlayIdleWithTarget(Idle akIdle, ObjectReference akTarget) native

Parameters[edit | edit source]

  • akIdle: The idle to play on this actor.
  • akTarget: The target the actor should play the idle with - usually used for paired animations.

Return Value[edit | edit source]

True if the idle was successfully loaded and played, false otherwise.

Examples[edit | edit source]

; Start Hadvar's backstab paired idle against the thief
if Hadvar.PlayIdleWithTarget(Backstab, Thief)
  Debug.Trace("Hadvar just backstabbed the thief!")
else
  Debug.Trace("Something went wrong")
endIf

Notes[edit | edit source]

  • This function will cause the initiating actor to be stuck in combat alert status and unable to come out of it, no matter what combat based functions is called. To fix this, the package running must have the Weapon drawn flag checked. When checked, the alert status is back to normal when the package ends. See source for more info on how to use this in scenes.
  • A weapon needs to be equipped before an idle that normally requires a weapon is played. If you don't have a weapon equipped, the idle will still play, but you will not be able to equip spells/weapons after the idle is complete. You will have to reload. This is similar to the issue above, except you don't need to have the weapon drawn in this case.
  • DrawWeapon will prevent this function from firing if one decides to use it to handle the issue above.
  • The PushActorAway function can interfere with idles. For example, if a weapon has a scripted effect to push an actor away on strike and that weapon is used in a kill move played with PlayIdleWithTarget, the targeted actor may fall from the kill move, get up, and then fall again several seconds later. This behavior can occur even if the targeted actor has been decapitated.

See Also[edit | edit source]