IsOffLimits

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

A command for Oblivion Script Extender

Syntax:

(isOffLimits:bool) reference.IsOffLimits actor:ref

Returns 1 if it is illegal for the specified actor to activate the calling reference, based on the calling reference's ownership.

Notes[edit | edit source]

  • The second reference flag (actor:ref) requires a base object ID (just like all other functions).
    • In particular, to check whether it's illegal for the player, use 7 (player's base object ID).
  • Objects that are owned by an evil faction may be counted as Off-Limits, even though they're OK to pick up.
    • Fixed as of v0014a
  • This is a condensation of this code
ref owner
short reqRank

begin onActivate
  set reqRank to 255
  set owner to getOwner
  if (owner == 0)
    set owner to getParentCellOwner
    if (owner == 0)
   ; it is legal for player to take this thing
      return
    elseif (getObjectType owner == 6); faction
      set reqRank to GetParentCellOwningFactionRequiredRank; that's fun to type...
    endif
  elseif (getObjectType owner == 6); faction
    set reqRank to GetOwningFactionRequiredRank
  endif
  if (reqRank < 255)
    if ( player.GetFactionRank owner >= reqRank ) || ( IsFactionEvil owner )
   ; it's legal for him to take this thing
      return
    endif
  elseif (owner == player); player owns it
; legal
    return
  endif
; if you get here, it's illegal for player to take this thing
end