Difference between revisions of "IsOffLimits - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
(Throwing in template info for start)
 
(i took a brief look at TESObjectREFR::IsOffLimits in a disassembler, though i didn't dig too deeply. spent maybe 30 minutes to an hour looking at it.)
 
(6 intermediate revisions by one other user not shown)
Line 4: Line 4:
'''SKSE Member of:''' [[ObjectReference Script]]
'''SKSE Member of:''' [[ObjectReference Script]]


This Function will set a ObjectReference's charge to the specified amount.
This Papyrus function provides access to one of the internal game engine functions that Skyrim's UI uses to determine whether interacting with some object may be a crime. It's one of the functions that the game engine calls when it wants to know whether to override an object's activation prompt with "Steal" or "Steal from," for example.


== Syntax ==
== Syntax ==
<source lang="papyrus">
<source lang="papyrus">
Function SetItemCharge(float charge) native
Bool Function IsOffLimits() Native
</source>
</source>
== Parameters ==
* charge - The amount, as a float you wish to set the Objects charge to.


== Examples ==
== Examples ==


<source lang="papyrus">
<source lang="papyrus">
ObjectReference Property weaponRef Auto
ObjectReference ErikursBooze boozeRef  Auto
Float charge


Function setWeaponcharge()
Function takeButDontSteal()
Charge = weaponRef.GetItemCharge()
If !boozeRef.IsOffLimits()
weaponref.SetItemCharge((Charge + 100.0)); Adds 100 to the Current Charge.
boozeRef.Activate(playerRef) ; takes it
EndIf
EndFunction
EndFunction
</source>
</source>
*Do note that this will only work on a weapon that is currently loaded and not in a container.


== Notes ==
== Notes ==
* This function can only be run on items outside of containers, as when they are put into containers member functions cannot be called on them.
* This function will always return false for any [[furniture]] that is not a bed.
* This function runs special-case checks for [[door]]s. As of this writing, these checks have not been reverse-engineered in detail, but may include things like ownership checks for the cell that the door leads to.
* In all other cases, this function runs typical ownership checks, which include things like "is this object owned by a [[Faction]] that the player is a member of, with the player's faction rank high enough to grant ownership?"
* This function is coded to run special-case checks when called on an [[actor]] while the player is sneaking. However, these checks are exactly identical to the normal checks run for most objects.


== See Also ==
== See Also ==
*[[ObjectReference Script]]
*[[ObjectReference Script]]
*[[GetItemCharge - ObjectReference]]
*[[GetItemMaxCharge - ObjectReference]]

Latest revision as of 18:14, 10 April 2022

SKSE Member of: ObjectReference Script

This Papyrus function provides access to one of the internal game engine functions that Skyrim's UI uses to determine whether interacting with some object may be a crime. It's one of the functions that the game engine calls when it wants to know whether to override an object's activation prompt with "Steal" or "Steal from," for example.

Syntax[edit | edit source]

Bool Function IsOffLimits() Native

Examples[edit | edit source]

ObjectReference ErikursBooze boozeRef  Auto  

Function takeButDontSteal()
	If !boozeRef.IsOffLimits()
		boozeRef.Activate(playerRef) ; takes it
	EndIf
EndFunction

Notes[edit | edit source]

  • This function will always return false for any furniture that is not a bed.
  • This function runs special-case checks for doors. As of this writing, these checks have not been reverse-engineered in detail, but may include things like ownership checks for the cell that the door leads to.
  • In all other cases, this function runs typical ownership checks, which include things like "is this object owned by a Faction that the player is a member of, with the player's faction rank high enough to grant ownership?"
  • This function is coded to run special-case checks when called on an actor while the player is sneaking. However, these checks are exactly identical to the normal checks run for most objects.

See Also[edit | edit source]