Difference between revisions of "KillEssential - Actor"
Jump to navigation
Jump to search
imported>Rhavlovick m (1 revision: Clobber re-import by Henning) |
(→Notes) |
||
(One intermediate revision by one other user not shown) | |||
Line 8: | Line 8: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Function KillEssential(Actor akKiller = None) | Function KillEssential(Actor akKiller = None) | ||
ActorBase akActorBase = GetBaseObject() as ActorBase | |||
if akActorBase.IsUnique() | |||
akActorBase.SetEssential(0) | |||
endif | |||
Kill(akKiller) | |||
endFunction | |||
</source> | </source> | ||
Line 22: | Line 28: | ||
ImportantPerson.KillEssential(Dragon) | ImportantPerson.KillEssential(Dragon) | ||
</source> | </source> | ||
== Notes == | |||
* KillEssential() does not work for essential actors whose actor base is not flagged as Unique. | |||
* This function does not work if the NPC has been made essential by virtue of being in an alias with the Essential flag. | |||
== See Also == | == See Also == |
Latest revision as of 22:27, 1 December 2021
Member of: Actor Script
Kills this actor with the passed-in actor being the culprit, even if he is essential.
Syntax[edit | edit source]
Function KillEssential(Actor akKiller = None)
ActorBase akActorBase = GetBaseObject() as ActorBase
if akActorBase.IsUnique()
akActorBase.SetEssential(0)
endif
Kill(akKiller)
endFunction
Parameters[edit | edit source]
- akKiller: The Actor who is the guilty party in killing this one.
- Default: None
Return Value[edit | edit source]
None.
Examples[edit | edit source]
; Have the dragon kill the important person, even if essential
ImportantPerson.KillEssential(Dragon)
Notes[edit | edit source]
- KillEssential() does not work for essential actors whose actor base is not flagged as Unique.
- This function does not work if the NPC has been made essential by virtue of being in an alias with the Essential flag.