Difference between revisions of "ReferenceAlias Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
 
imported>Texashokies
(Added a Special Edition Exclusive section and added events relevant to the section.)
 
(6 intermediate revisions by 3 users not shown)
Line 19: Line 19:


== Member Functions ==
== Member Functions ==
*Function [[AddInventoryEventFilter - ObjectReference|AddInventoryEventFilter]](Form akFilter)
 
**Adds an inventory event filter to this alias.
:'''[[AddInventoryEventFilter - ObjectReference|AddInventoryEventFilter]](Form ''akFilter'')'''
*Function [[Clear - ReferenceAlias|Clear]]()
:*Adds an inventory event filter to this alias.
**Clears this alias from pointing at anything.
 
*bool Function [[ForceRefIfEmpty - ReferenceAlias|ForceRefIfEmpty]](ObjectReference akNewRef)
:'''[[Clear - ReferenceAlias|Clear]]()'''
**Tries to force a reference into the alias, but only if it's already empty.
:*Clears this alias from pointing at anything.
*Function [[ForceRefTo - ReferenceAlias|ForceRefTo]](ObjectReference akNewRef)
 
**Forces this alias to use the specified [[ObjectReference Script|ObjectReference]]
:'''Bool [[ForceRefIfEmpty - ReferenceAlias|ForceRefIfEmpty]](ObjectReference ''akNewRef'')'''
*Actor Function [[GetActorReference - ReferenceAlias|GetActorRef]]()
:*Tries to force a reference into the alias, but only if it's already empty.
**Alias for GetActorReference().
 
*Actor Function [[GetActorReference - ReferenceAlias|GetActorReference]]()
:'''[[ForceRefTo - ReferenceAlias|ForceRefTo]](ObjectReference ''akNewRef'')'''
**Retrieves the alias's [[ObjectReference Script|ObjectReference]] cast as an [[Actor Script|Actor]].
:*Forces this alias to use the specified [[ObjectReference Script|ObjectReference]]
*ObjectReference Function [[GetReference - ReferenceAlias|GetRef]]()
 
**Alias for GetReference().
:'''Actor [[GetActorReference - ReferenceAlias|GetActorRef]]()'''
*ObjectReference Function [[GetReference - ReferenceAlias|GetReference]]()
:*Shorthand for GetActorReference().
**Attempts to retrieve the [[ObjectReference Script|ObjectReference]] that this alias is pointing at
 
*Function [[RemoveAllInventoryEventFilters - ObjectReference|RemoveAllInventoryEventFilters]]()
:'''Actor [[GetActorReference - ReferenceAlias|GetActorReference]]()'''
**Remove all inventory event filters on this alias.
:*Shorthand for GetReference() as [[Actor Script|Actor]].
*Function [[RemoveInventoryEventFilter - ObjectReference|RemoveInventoryEventFilter]](Form akFilter)
 
**Remove a specific inventory event filter.
:'''ObjectReference [[GetReference - ReferenceAlias|GetRef]]()'''
*bool Function [[TryToAddToFaction - ReferenceAlias|TryToAddToFaction]](Faction FactionToAddTo)
:*Shorthand for GetReference().
**Attempts to add the reference this alias points to to a faction
 
*bool Function [[TryToClear - ReferenceAlias|TryToClear]]()
:'''ObjectReference [[GetReference - ReferenceAlias|GetReference]]()'''
**Attempts to clear this alias
:*Attempts to retrieve the [[ObjectReference Script|ObjectReference]] that this alias is pointing at
*bool Function [[TryToDisable - ReferenceAlias|TryToDisable]]()
 
**Attempts to disable the reference this alias points at
:'''[[RemoveAllInventoryEventFilters - ObjectReference|RemoveAllInventoryEventFilters]]()'''
*bool Function [[TryToDisableNoWait - ReferenceAlias|TryToDisableNoWait]]()
:*Remove all inventory event filters on this alias.
**Attempts to disable the reference this alias points at (the no-wait version)
 
*bool Function [[TryToEnable - ReferenceAlias|TryToEnable]]()
:'''[[RemoveInventoryEventFilter - ObjectReference|RemoveInventoryEventFilter]](Form ''akFilter'')'''
**Attempts to enable the reference this alias points at
:*Remove a specific inventory event filter.
*bool Function [[TryToEnableNoWait - ReferenceAlias|TryToEnableNoWait]]()
 
**Attempts to enable the reference this alias points at (no-wait version)
:'''Bool [[TryToAddToFaction - ReferenceAlias|TryToAddToFaction]](Faction ''FactionToAddTo'')'''
*bool Function [[TryToEvaluatePackage - ReferenceAlias|TryToEvaluatePackage]]()
:*Attempts to add the reference this alias points to to a faction
**Attempts to get the actor this alias points at to re-evaluate his package stack
 
*bool Function [[TryToKill - ReferenceAlias|TryToKill]]()
:'''Bool [[TryToClear - ReferenceAlias|TryToClear]]()'''
**Attempts to kill the actor this alias points at
:*Attempts to clear this alias
*bool Function [[TryToMoveTo - ReferenceAlias|TryToMoveTo]](ObjectReference RefToMoveTo)
 
**Attempts to move the reference this alias points to to the target reference
:'''Bool [[TryToDisable - ReferenceAlias|TryToDisable]]()'''
*bool Function [[TryToRemoveFromFaction - ReferenceAlias|TryToRemoveFromFaction]](Faction FactionToRemoveFrom)
:*Attempts to disable the reference this alias points at
**Attempts to remove the reference this alias points to from a faction
 
*bool Function [[TryToReset - ReferenceAlias|TryToReset]]()
:'''Bool [[TryToDisableNoWait - ReferenceAlias|TryToDisableNoWait]]()'''
**Attempts to reset the reference this alias points at
:*Attempts to disable the reference this alias points at (the no-wait version)
*bool Function [[TryToStopCombat - ReferenceAlias|TryToStopCombat]]()
 
**Attempts to remove the actor this alias points at from combat
:'''Bool [[TryToEnable - ReferenceAlias|TryToEnable]]()'''
:*Attempts to enable the reference this alias points at
 
:'''Bool [[TryToEnableNoWait - ReferenceAlias|TryToEnableNoWait]]()'''
:*Attempts to enable the reference this alias points at (no-wait version)
 
:'''Bool [[TryToEvaluatePackage - ReferenceAlias|TryToEvaluatePackage]]()'''
:*Attempts to get the actor this alias points at to re-evaluate his package stack
 
:'''Bool [[TryToKill - ReferenceAlias|TryToKill]]()'''
:*Attempts to kill the actor this alias points at
 
:'''Bool [[TryToMoveTo - ReferenceAlias|TryToMoveTo]](ObjectReference ''RefToMoveTo'')'''
:*Attempts to move the reference this alias points to to the target reference
 
:'''Bool [[TryToRemoveFromFaction - ReferenceAlias|TryToRemoveFromFaction]](Faction ''FactionToRemoveFrom'')'''
:*Attempts to remove the reference this alias points to from a faction
 
:'''Bool [[TryToReset - ReferenceAlias|TryToReset]]()'''
:*Attempts to reset the reference this alias points at
 
:'''Bool [[TryToStopCombat - ReferenceAlias|TryToStopCombat]]()'''
:*Attempts to remove the actor this alias points at from combat


== Events ==
== Events ==
Line 68: Line 90:


ReferenceAliases may also receive [[Actor Script#Events|additional events]] if they are pointing at an [[Actor Script|Actor]].
ReferenceAliases may also receive [[Actor Script#Events|additional events]] if they are pointing at an [[Actor Script|Actor]].
== Special Edition Exclusive Events ==
'''[[OnLycanthropyStateChanged - ReferenceAlias|OnLycanthropyStateChanged]](Bool ''abIsWerewolf'')'''
*Event received when the lycanthropy state of this actor changes
'''[[OnPlayerFastTravelEnd - ReferenceAlias|OnPlayerFastTravelEnd]](Float ''afTravelGameTimeHours'')'''
*Event received when the player finishes fast travel.
'''[[OnVampirismStateChanged - ReferenceAlias|OnVampirismStateChanged]](bool ''abIsVampire'')'''
*Event received when the vampirism state of this actor changes
'''[[OnVampireFeed - ReferenceAlias|OnVampireFeed]](Actor ''akTarget'')'''
*Event received when this actor feeds on another, as a vampire

Latest revision as of 19:11, 3 October 2017


Extends: Alias Script

Script for the manipulation of reference aliases.

Definition[edit | edit source]

ScriptName ReferenceAlias extends Alias

Properties[edit | edit source]

None

Global Functions[edit | edit source]

None

Member Functions[edit | edit source]

AddInventoryEventFilter(Form akFilter)
  • Adds an inventory event filter to this alias.
Clear()
  • Clears this alias from pointing at anything.
Bool ForceRefIfEmpty(ObjectReference akNewRef)
  • Tries to force a reference into the alias, but only if it's already empty.
ForceRefTo(ObjectReference akNewRef)
Actor GetActorRef()
  • Shorthand for GetActorReference().
Actor GetActorReference()
  • Shorthand for GetReference() as Actor.
ObjectReference GetRef()
  • Shorthand for GetReference().
ObjectReference GetReference()
RemoveAllInventoryEventFilters()
  • Remove all inventory event filters on this alias.
RemoveInventoryEventFilter(Form akFilter)
  • Remove a specific inventory event filter.
Bool TryToAddToFaction(Faction FactionToAddTo)
  • Attempts to add the reference this alias points to to a faction
Bool TryToClear()
  • Attempts to clear this alias
Bool TryToDisable()
  • Attempts to disable the reference this alias points at
Bool TryToDisableNoWait()
  • Attempts to disable the reference this alias points at (the no-wait version)
Bool TryToEnable()
  • Attempts to enable the reference this alias points at
Bool TryToEnableNoWait()
  • Attempts to enable the reference this alias points at (no-wait version)
Bool TryToEvaluatePackage()
  • Attempts to get the actor this alias points at to re-evaluate his package stack
Bool TryToKill()
  • Attempts to kill the actor this alias points at
Bool TryToMoveTo(ObjectReference RefToMoveTo)
  • Attempts to move the reference this alias points to to the target reference
Bool TryToRemoveFromFaction(Faction FactionToRemoveFrom)
  • Attempts to remove the reference this alias points to from a faction
Bool TryToReset()
  • Attempts to reset the reference this alias points at
Bool TryToStopCombat()
  • Attempts to remove the actor this alias points at from combat

Events[edit | edit source]

ReferenceAliases receive events from the ObjectReference they are pointing at.

ReferenceAliases may also receive additional events if they are pointing at an Actor.

Special Edition Exclusive Events[edit | edit source]

OnLycanthropyStateChanged(Bool abIsWerewolf)

  • Event received when the lycanthropy state of this actor changes

OnPlayerFastTravelEnd(Float afTravelGameTimeHours)

  • Event received when the player finishes fast travel.

OnVampirismStateChanged(bool abIsVampire)

  • Event received when the vampirism state of this actor changes

OnVampireFeed(Actor akTarget)

  • Event received when this actor feeds on another, as a vampire