Difference between revisions of "SetProtected - ActorBase"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rasikko
(Can't change the flag if the flag is set on an alias.)
m
 
Line 29: Line 29:
== Notes ==
== Notes ==
* This function is overridden by the flag on a quest alias.
* This function is overridden by the flag on a quest alias.
* When an actor is protected they can only be killed by the player.
== See Also ==
== See Also ==
*[[ActorBase Script]]
*[[ActorBase Script]]
*[[IsProtected - ActorBase]]
*[[IsProtected - ActorBase]]

Latest revision as of 01:02, 12 November 2023

Member of: ActorBase Script

Sets or clears this actor's protected flag. If you set the flag, and the actor is essential, the essential flag will be cleared.

Syntax[edit | edit source]

Function SetProtected(bool abProtected = true) native

Parameters[edit | edit source]

  • abProtected: Whether to set or clear this actor's protected flag.
    • Default: True

Return Value[edit | edit source]

None.

Examples[edit | edit source]

; Flag the Emperor as protected
EmperorBaseActorProperty.SetProtected()


; Flag RedShirt as non-protected
RedShirtBaseActorProperty.SetProtected(false)

Notes[edit | edit source]

  • This function is overridden by the flag on a quest alias.
  • When an actor is protected they can only be killed by the player.

See Also[edit | edit source]