SetRefEssential

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

A command for Oblivion Script Extender

Syntax:

reference.SetRefEssential isEssential:bool
[Ref.]setRefEssential booleanFlag

Sets the calling ref to be essential or not.

Notes[edit | edit source]

  • Essential actors cannot be killed, only knocked unconscious.
  • Must be called on a reference to an actor.
  • Set to 1 to flag the reference as essential or 0 to clear the flag.
  • Although used on a reference, this function changes the Essential flag on the Base Object, thus affecting all references from that Base Object

Example:

if ( myNPCRef.isRefEssential == 0 )
  myNPCRef.setRefEssential 1 ; make the reference essential
endif

See Also[edit | edit source]

IsRefEssential