Difference between revisions of "Alias Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
m (Formatting Change)
imported>Bug64
m (Clarified getName() and added some more links)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
Native base script for every alias in the game. Don't confuse this for [[ReferenceAlias Script]] which you are more likely to use.
Native base script for every alias in the game. Don't confuse this for [[ReferenceAlias Script]] which you are more likely to use.


Line 17: Line 14:
== Member Functions ==
== Member Functions ==


{|class="wikitable" width =100%
:'''Quest [[GetOwningQuest - Alias|GetOwningQuest]]()'''
!style="text-align:left;" width=25%|Function
:*Returns the [[Quest Script|Quest]] that owns this alias.
!style="text-align:left;"|Description
|-
|[[GetOwningQuest - Alias|Quest '''GetOwningQuest'''()]]
|Returns the [[Quest Script|Quest]] that owns this alias.
|-


|[[RegisterForAnimationEvent - Form|'''RegisterForAnimationEvent'''(ObjectReference ''akSender'', String ''asEventName'')]]
:'''[[RegisterForAnimationEvent - Form|RegisterForAnimationEvent]](ObjectReference ''akSender'', String ''asEventName'')'''
|Registers this alias to receive the specified animation event from the specified object.
:*Registers this alias to receive the specified animation event from the specified object.
|-


|[[RegisterForLOS - Form|'''RegisterForLOS'''(Actor ''akViewer'', ObjectReference ''akTarget'')]]
:'''[[RegisterForLOS - Form|RegisterForLOS]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
|Registers this alias to receive gain and lost LOS events between the viewer and the target.
:*Registers this alias to receive gain and lost LOS events between the viewer and the target.
|-


|[[RegisterForSingleLOSGain - Form|'''RegisterForSingleLOSGain'''(Actor ''akViewer'', ObjectReference ''akTarget'')]]
:'''[[RegisterForSingleLOSGain - Form|RegisterForSingleLOSGain]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
|Registers this alias to receive a single LOS gain event when the viewer sees the target.
:*Registers this alias to receive a single LOS gain event when the viewer sees the target.
|-


|[[RegisterForSingleLOSLost - Form|'''RegisterForSingleLOSLost'''(Actor ''akViewer'', ObjectReference ''akTarget'')]]
:'''[[RegisterForSingleLOSLost - Form|RegisterForSingleLOSLost]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
|Registers this alias to receive a single LOS lost event when the viewer loses sight of the target.
:*Registers this alias to receive a single LOS lost event when the viewer loses sight of the target.
|-


|[[RegisterForSingleUpdate - Form|'''RegisterForSingleUpdate'''(Float ''afInterval'')]]
:'''[[RegisterForSingleUpdate - Form|RegisterForSingleUpdate]](Float ''afInterval'')'''
|Registers this alias to receive a single update event in the specified time.
:*Registers this alias to receive a single update event in the specified time.
|-


|[[RegisterForSingleUpdateGameTime - Form|'''RegisterForSingleUpdateGameTime'''(Float ''afInterval'')]]
:'''[[RegisterForSingleUpdateGameTime - Form|RegisterForSingleUpdateGameTime]](Float ''afInterval'')'''
|Registers this alias to receive a single update event in the specified number of game hours.
:*Registers this alias to receive a single update event in the specified number of game hours.
|-


|[[RegisterForSleep - Form|'''RegisterForSleep'''()]]
:'''[[RegisterForSleep - Form|RegisterForSleep]]()'''
|Registers this alias to receive sleep events for when the player goes to sleep or wakes up.
:*Registers this alias to receive sleep events for when the player goes to sleep or wakes up.
|-


|[[RegisterForTrackedStatsEvent - Form|'''RegisterForTrackedStatsEvent'''()]]
:'''[[RegisterForTrackedStatsEvent - Form|RegisterForTrackedStatsEvent]]()'''
|Registers this alias to receive tracked stats events for when tracked stats are updated.
:*Registers this alias to receive tracked stats events for when tracked stats are updated.
|-


|[[RegisterForUpdate - Form|'''RegisterForUpdate'''(Float ''afInterval'')]]
:'''[[RegisterForUpdate - Form|RegisterForUpdate]](Float ''afInterval'')'''
|Registers this alias to receive update events with the specified interval, or changes the update interval.
:*Registers this alias to receive update events with the specified interval, or changes the update interval.
|-


|[[RegisterForUpdateGameTime - Form|'''RegisterForUpdateGameTime'''(Float ''afInterval'')]]
:'''[[RegisterForUpdateGameTime - Form|RegisterForUpdateGameTime]](Float ''afInterval'')'''
|Registers this alias to receive update events with the specified interval in game time hours, or changes the update interval.
:*Registers this alias to receive update events with the specified interval in game time hours, or changes the update interval.
|-


|[[StartObjectProfiling - Form|'''StartObjectProfiling'''()]]
:'''[[StartObjectProfiling - Form|StartObjectProfiling]]()'''
|Starts profiling all scripts attached to this alias.
:*Starts profiling all scripts attached to this alias.
|-


|[[StopObjectProfiling - Form|'''StopObjectProfiling'''()]]
:'''[[StopObjectProfiling - Form|StopObjectProfiling]]()'''
|Stops profiling all scripts attached to this alias.
:*Stops profiling all scripts attached to this alias.
|-


|[[UnregisterForAnimationEvent - Form|'''UnregisterForAnimationEvent'''(ObjectReference ''akSender'', String ''asEventName'')]]
:'''[[UnregisterForAnimationEvent - Form|UnregisterForAnimationEvent]](ObjectReference ''akSender'', String ''asEventName'')'''
|Unregisters this alias from receiving the specified animation event from the specified object.
:*Unregisters this alias from receiving the specified animation event from the specified object.
|-


|[[UnregisterForLOS - Form|'''UnregisterForLOS'''(Actor ''akViewer'', ObjectReference ''akTarget'')]]
:'''[[UnregisterForLOS - Form|UnregisterForLOS]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
|Unregisters this alias from any LOS events between the viewer and target.
:*Unregisters this alias from any LOS events between the viewer and target.
|-


|[[UnregisterForSleep - Form|'''UnregisterForSleep'''()]]
:'''[[UnregisterForSleep - Form|UnregisterForSleep]]()'''
|Unregisters this alias from sleep events.
:*Unregisters this alias from sleep events.
|-


|[[UnregisterForTrackedStatsEvent - Form|'''UnregisterForTrackedStatsEvent'''()]]
:'''[[UnregisterForTrackedStatsEvent - Form|UnregisterForTrackedStatsEvent]]()'''
|Unregisters this alias from tracked stats events.
:*Unregisters this alias from tracked stats events.
|-


|[[UnregisterForUpdate - Form|'''UnregisterForUpdate'''()]]
:'''[[UnregisterForUpdate - Form|UnregisterForUpdate]]()'''
|Unregisters this alias from update events.
:*Unregisters this alias from update events.
|-


|[[UnregisterForUpdateGameTime - Form|'''UnregisterForUpdateGameTime'''()]]
:'''[[UnregisterForUpdateGameTime - Form|UnregisterForUpdateGameTime]]()'''
|Unregisters this alias from game time update events.
:*Unregisters this alias from game time update events.
|-


|}


== SKSE Member Functions ==
== SKSE Member Functions ==


{|class="wikitable" width =100%
:'''String [[GetName - Alias|GetName]]()'''
!style="text-align:left;" width=25%|Function
:* Returns the unique name of the alias (not its display name). Used by calls to [[GetAliasByName - Quest|GetAliasByName]].
!style="text-align:left;"|Description
|-
|[[GetName - Alias|String '''GetName'''()]]
| Returns the name of the alias.
|-


|[[GetID - Alias|Int '''GetID'''()]]
:'''Int [[GetID - Alias|GetID]]()'''
| Returns the ID of the alias.
:* Returns the ID of the alias. Used by calls to [[GetNthAlias - Quest|GetNthAlias]] and [[GetAlias - Quest|GetAlias]]
|-


|}
:'''[[RegisterForNiNodeUpdate]]()'''
:*Registers the script for when a QueueNiNodeUpdate is called
 
:'''[[UnregisterForNiNodeUpdate]]()'''
:*Unregisters the script for when a QueueNiNodeUpdate is called


== Events ==
== Events ==


{|class="wikitable" width =100%
:'''[[OnAnimationEvent - Form|OnAnimationEvent]](ObjectReference ''akSource'', String ''asEventName'')'''
!style="text-align:left;" width=25%|Function
:*Received when one of animation events we are listening for is received.
!style="text-align:left;"|Description
 
|-
:'''[[OnAnimationEventUnregistered - Form|OnAnimationEventUnregistered]](ObjectReference ''akSource'', String ''asEventName'')'''
|[[OnAnimationEvent - Form|'''OnAnimationEvent'''(ObjectReference ''akSource'', String ''asEventName'')]]
:*Received when one of the animation events we are listening for has been automatically unregistered by the game due to the target animation graph unloading.
|Received when one of animation events we are listening for is received.
 
|-
:'''[[OnGainLOS - Form|OnGainLOS]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
:*Received when the viewer goes from not seeing the target to seeing the target - if this alias is registered.


|[[OnAnimationEventUnregistered - Form|'''OnAnimationEventUnregistered'''(ObjectReference ''akSource'', String ''asEventName'')]]
:'''[[OnLostLOS - Form|OnLostLOS]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
|Received when one of the animation events we are listening for has been automatically unregistered by the game due to the target animation graph unloading.
:*Received when the viewer goes from seeing the target to not seeing the target - if this alias is registered.
|-


|[[OnGainLOS - Form|'''OnGainLOS'''(Actor ''akViewer'', ObjectReference ''akTarget'')]]
:'''[[OnReset - ObjectReference|OnReset]]()'''
|Received when the viewer goes from not seeing the target to seeing the target - if this alias is registered.
:*Event received when this object is reset ]](usually when the quest the alias is attached to starts up).
|-


|[[OnLostLOS - Form|'''OnLostLOS'''(Actor ''akViewer'', ObjectReference ''akTarget'')]]
:'''[[OnSleepStart - Form|OnSleepStart]](Float ''afSleepStartTime'', Float ''afDesiredSleepEndTime'')'''
|Received when the viewer goes from seeing the target to not seeing the target - if this alias is registered.
:*Received when the player goes to sleep.
|-


|[[OnReset - ObjectReference|'''OnReset'''()]]
:'''[[OnSleepStop - Form|OnSleepStop]](Bool ''abInterrupted'')'''
|Event received when this object is reset (usually when the quest the alias is attached to starts up).
:*Received when the player wakes up or is interrupted in sleep.
|-


|[[OnSleepStart - Form|'''OnSleepStart'''(Float ''afSleepStartTime'', Float ''afDesiredSleepEndTime'')]]
:'''[[OnTrackedStatsEvent - Form|OnTrackedStatsEvent]](String ''asStat'', Int ''aiStatValue'')'''
|Received when the player goes to sleep.
:*Received when tracked stats are updated.
|-


|[[OnSleepStop - Form|'''OnSleepStop'''(Bool ''abInterrupted'')]]
:'''[[OnUpdate - Form|OnUpdate]]()'''
|Received when the player wakes up or is interrupted in sleep.
:*Received at periodic intervals, if the alias is registered.
|-


|[[OnTrackedStatsEvent - Form|'''OnTrackedStatsEvent'''(String ''asStat'', Int ''aiStatValue'')]]
:'''[[OnUpdateGameTime - Form|OnUpdateGameTime]]()'''
|Received when tracked stats are updated.
:*Received at periodic intervals of game time, if the alias is registered.
|-


|[[OnUpdate - Form|'''OnUpdate'''()]]
== SKSE Events ==
|Received at periodic intervals, if the alias is registered.
|-


|[[OnUpdateGameTime - Form|'''OnUpdateGameTime'''()]]
'''[[OnNiNodeUpdate]](ObjectReference ''akActor'')'''
|Received at periodic intervals of game time, if the alias is registered.
|-


|}
==Notes==
==Notes==
*This object is often confused with [[ReferenceAlias Script]]. You probably mean to be using that.
:*This object is often confused with [[ReferenceAlias Script]]. You probably mean to be using that.
 
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]

Latest revision as of 09:41, 20 July 2015

Native base script for every alias in the game. Don't confuse this for ReferenceAlias Script which you are more likely to use.

Definition[edit | edit source]

ScriptName Alias

Properties[edit | edit source]

None

Global Functions[edit | edit source]

None

Member Functions[edit | edit source]

Quest GetOwningQuest()
  • Returns the Quest that owns this alias.
RegisterForAnimationEvent(ObjectReference akSender, String asEventName)
  • Registers this alias to receive the specified animation event from the specified object.
RegisterForLOS(Actor akViewer, ObjectReference akTarget)
  • Registers this alias to receive gain and lost LOS events between the viewer and the target.
RegisterForSingleLOSGain(Actor akViewer, ObjectReference akTarget)
  • Registers this alias to receive a single LOS gain event when the viewer sees the target.
RegisterForSingleLOSLost(Actor akViewer, ObjectReference akTarget)
  • Registers this alias to receive a single LOS lost event when the viewer loses sight of the target.
RegisterForSingleUpdate(Float afInterval)
  • Registers this alias to receive a single update event in the specified time.
RegisterForSingleUpdateGameTime(Float afInterval)
  • Registers this alias to receive a single update event in the specified number of game hours.
RegisterForSleep()
  • Registers this alias to receive sleep events for when the player goes to sleep or wakes up.
RegisterForTrackedStatsEvent()
  • Registers this alias to receive tracked stats events for when tracked stats are updated.
RegisterForUpdate(Float afInterval)
  • Registers this alias to receive update events with the specified interval, or changes the update interval.
RegisterForUpdateGameTime(Float afInterval)
  • Registers this alias to receive update events with the specified interval in game time hours, or changes the update interval.
StartObjectProfiling()
  • Starts profiling all scripts attached to this alias.
StopObjectProfiling()
  • Stops profiling all scripts attached to this alias.
UnregisterForAnimationEvent(ObjectReference akSender, String asEventName)
  • Unregisters this alias from receiving the specified animation event from the specified object.
UnregisterForLOS(Actor akViewer, ObjectReference akTarget)
  • Unregisters this alias from any LOS events between the viewer and target.
UnregisterForSleep()
  • Unregisters this alias from sleep events.
UnregisterForTrackedStatsEvent()
  • Unregisters this alias from tracked stats events.
UnregisterForUpdate()
  • Unregisters this alias from update events.
UnregisterForUpdateGameTime()
  • Unregisters this alias from game time update events.


SKSE Member Functions[edit | edit source]

String GetName()
  • Returns the unique name of the alias (not its display name). Used by calls to GetAliasByName.
Int GetID()
RegisterForNiNodeUpdate()
  • Registers the script for when a QueueNiNodeUpdate is called
UnregisterForNiNodeUpdate()
  • Unregisters the script for when a QueueNiNodeUpdate is called

Events[edit | edit source]

OnAnimationEvent(ObjectReference akSource, String asEventName)
  • Received when one of animation events we are listening for is received.
OnAnimationEventUnregistered(ObjectReference akSource, String asEventName)
  • Received when one of the animation events we are listening for has been automatically unregistered by the game due to the target animation graph unloading.
OnGainLOS(Actor akViewer, ObjectReference akTarget)
  • Received when the viewer goes from not seeing the target to seeing the target - if this alias is registered.
OnLostLOS(Actor akViewer, ObjectReference akTarget)
  • Received when the viewer goes from seeing the target to not seeing the target - if this alias is registered.
OnReset()
  • Event received when this object is reset ]](usually when the quest the alias is attached to starts up).
OnSleepStart(Float afSleepStartTime, Float afDesiredSleepEndTime)
  • Received when the player goes to sleep.
OnSleepStop(Bool abInterrupted)
  • Received when the player wakes up or is interrupted in sleep.
OnTrackedStatsEvent(String asStat, Int aiStatValue)
  • Received when tracked stats are updated.
OnUpdate()
  • Received at periodic intervals, if the alias is registered.
OnUpdateGameTime()
  • Received at periodic intervals of game time, if the alias is registered.

SKSE Events[edit | edit source]

OnNiNodeUpdate(ObjectReference akActor)

Notes[edit | edit source]