Difference between revisions of "Form Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Cipscis
(Undo revision 27341 by Cipscis (talk) Re-added link to page that hasn't been created yet after Qazaaq gave me some nice wiki organisation advice)
imported>Jog
Line 17: Line 17:


== Member Functions ==
== Member Functions ==
*int Function [[GetFormID - Form|GetFormID]]()
'''int Function [[GetFormID - Form|GetFormID]]()'''
**Returns this form's form ID.
*Returns this form's form ID.
*int Function [[GetGoldValue - Form|GetGoldValue]]()
 
**Returns this form's value in gold.
'''int Function [[GetGoldValue - Form|GetGoldValue]]()'''
*bool Function [[HasKeyword - Form|HasKeyword]](Keyword akKeyword)
*Returns this form's value in gold.
**Returns if this form has the specified [[Keyword Script|Keyword]] attached.
 
*Function [[PlayerKnows - Form|PlayerKnows]]()
'''bool Function [[HasKeyword - Form|HasKeyword]](Keyword akKeyword)'''
**Is the "Known" flag set on the form?
*Returns if this form has the specified [[Keyword Script|Keyword]] attached.
*Function [[RegisterForAnimationEvent - Form|RegisterForAnimationEvent]](ObjectReference akSender, string asEventName)
 
**Registers this form to receive the specified animation event from the specified object.
'''Function [[PlayerKnows - Form|PlayerKnows]]()'''
*Function [[RegisterForLOS - Form|RegisterForLOS]](Actor akViewer, ObjectReference akTarget)
*Is the "Known" flag set on the form?
**Registers this form to receive gain and lost LOS events between the viewer and the target.
 
*Function [[RegisterForSingleLOSGain - Form|RegisterForSingleLOSGain]](Actor akViewer, ObjectReference akTarget)
'''Function [[RegisterForAnimationEvent - Form|RegisterForAnimationEvent]](ObjectReference akSender, string asEventName)'''
**Registers this form to receive a single LOS gain event when the viewer sees the target.
*Registers this form to receive the specified animation event from the specified object.
*Function [[RegisterForSingleLOSLost - Form|RegisterForSingleLOSLost]](Actor akViewer, ObjectReference akTarget)
 
**Registers this form to receive a single LOS lost event when the viewer loses sight of the target.
'''Function [[RegisterForLOS - Form|RegisterForLOS]](Actor akViewer, ObjectReference akTarget)'''
*Function [[RegisterForSingleUpdate - Form|RegisterForSingleUpdate]](float afInterval)
*Registers this form to receive gain and lost LOS events between the viewer and the target.
**Registers this form to receive a single update event in the specified time.
 
*Function [[RegisterForSingleUpdateGameTime - Form|RegisterForSingleUpdateGameTime]](float afInterval)
'''Function [[RegisterForSingleLOSGain - Form|RegisterForSingleLOSGain]](Actor akViewer, ObjectReference akTarget)'''
**Registers this form to receive a single update event in the specified number of game hours.
*Registers this form to receive a single LOS gain event when the viewer sees the target.
*Function [[RegisterForSleep - Form|RegisterForSleep]]()
 
**Registers this form to receive sleep events for when the player goes to sleep or wakes up.
'''Function [[RegisterForSingleLOSLost - Form|RegisterForSingleLOSLost]](Actor akViewer, ObjectReference akTarget)'''
*Function [[RegisterForTrackedStatsEvent - Form|RegisterForTrackedStatsEvent]]()
*Registers this form to receive a single LOS lost event when the viewer loses sight of the target.
**Registers this form to receive tracked stats events for when tracked stats are updated.
 
*Function [[RegisterForUpdate - Form|RegisterForUpdate]](float afInterval)
'''Function [[RegisterForSingleUpdate - Form|RegisterForSingleUpdate]](float afInterval)'''
**Registers this form to receive update events with the specified interval, or changes the update interval.
*Registers this form to receive a single update event in the specified time.
*Function [[RegisterForUpdateGameTime - Form|RegisterForUpdateGameTime]](float afInterval)
 
**Registers this form to receive update events with the specified interval in game time hours, or changes the update interval.
'''Function [[RegisterForSingleUpdateGameTime - Form|RegisterForSingleUpdateGameTime]](float afInterval)'''
*Function [[StartObjectProfiling - Form|StartObjectProfiling]]()
*Registers this form to receive a single update event in the specified number of game hours.
**Starts profiling all scripts attached to this form.
 
*Function [[StopObjectProfiling - Form|StopObjectProfiling]]()
'''Function [[RegisterForSleep - Form|RegisterForSleep]]()'''
**Stops profiling all scripts attached to this form.
*Registers this form to receive sleep events for when the player goes to sleep or wakes up.
*Function [[UnregisterForAnimationEvent - Form|UnregisterForAnimationEvent]](ObjectReference akSender, string asEventName)
 
**Unregisters this from from receiving the specified animation event from the specified object.
'''Function [[RegisterForTrackedStatsEvent - Form|RegisterForTrackedStatsEvent]]()'''
*Function [[UnregisterForLOS - Form|UnregisterForLOS]](Actor akViewer, ObjectReference akTarget)
*Registers this form to receive tracked stats events for when tracked stats are updated.
**Unregisters this form from any LOS events between the viewer and target.
 
*Function [[UnregisterForSleep - Form|UnregisterForSleep]]()
'''Function [[RegisterForUpdate - Form|RegisterForUpdate]](float afInterval)'''
**Unregisters this form from sleep events.
*Registers this form to receive update events with the specified interval, or changes the update interval.
*Function [[UnregisterForTrackedStatsEvent - Form|UnregisterForTrackedStatsEvent]]()
 
**Unregisters this form from tracked stats events.
'''Function [[RegisterForUpdateGameTime - Form|RegisterForUpdateGameTime]](float afInterval)'''
*Function [[UnregisterForUpdate - Form|UnregisterForUpdate]]()
*Registers this form to receive update events with the specified interval in game time hours, or changes the update interval.
**Unregisters this form from update events.
 
*Function [[UnregisterForUpdateGameTime - Form|UnregisterForUpdateGameTime]]()
'''Function [[StartObjectProfiling - Form|StartObjectProfiling]]()'''
**Unregisters this form from game time update events.
*Starts profiling all scripts attached to this form.
 
'''Function [[StopObjectProfiling - Form|StopObjectProfiling]]()'''
*Stops profiling all scripts attached to this form.
 
'''Function [[UnregisterForAnimationEvent - Form|UnregisterForAnimationEvent]](ObjectReference akSender, string asEventName)'''
*Unregisters this from from receiving the specified animation event from the specified object.
 
'''Function [[UnregisterForLOS - Form|UnregisterForLOS]](Actor akViewer, ObjectReference akTarget)'''
*Unregisters this form from any LOS events between the viewer and target.
 
'''Function [[UnregisterForSleep - Form|UnregisterForSleep]]()'''
*Unregisters this form from sleep events.
 
'''Function [[UnregisterForTrackedStatsEvent - Form|UnregisterForTrackedStatsEvent]]()'''
*Unregisters this form from tracked stats events.
 
'''Function [[UnregisterForUpdate - Form|UnregisterForUpdate]]()'''
*Unregisters this form from update events.
 
'''Function [[UnregisterForUpdateGameTime - Form|UnregisterForUpdateGameTime]]()'''
*Unregisters this form from game time update events.


== Events ==
== Events ==

Revision as of 12:45, 20 February 2012


Native base script for every form in the game.

Definition

ScriptName Form

Properties

None

Global Functions

None

Member Functions

int Function GetFormID()

  • Returns this form's form ID.

int Function GetGoldValue()

  • Returns this form's value in gold.

bool Function HasKeyword(Keyword akKeyword)

  • Returns if this form has the specified Keyword attached.

Function PlayerKnows()

  • Is the "Known" flag set on the form?

Function RegisterForAnimationEvent(ObjectReference akSender, string asEventName)

  • Registers this form to receive the specified animation event from the specified object.

Function RegisterForLOS(Actor akViewer, ObjectReference akTarget)

  • Registers this form to receive gain and lost LOS events between the viewer and the target.

Function RegisterForSingleLOSGain(Actor akViewer, ObjectReference akTarget)

  • Registers this form to receive a single LOS gain event when the viewer sees the target.

Function RegisterForSingleLOSLost(Actor akViewer, ObjectReference akTarget)

  • Registers this form to receive a single LOS lost event when the viewer loses sight of the target.

Function RegisterForSingleUpdate(float afInterval)

  • Registers this form to receive a single update event in the specified time.

Function RegisterForSingleUpdateGameTime(float afInterval)

  • Registers this form to receive a single update event in the specified number of game hours.

Function RegisterForSleep()

  • Registers this form to receive sleep events for when the player goes to sleep or wakes up.

Function RegisterForTrackedStatsEvent()

  • Registers this form to receive tracked stats events for when tracked stats are updated.

Function RegisterForUpdate(float afInterval)

  • Registers this form to receive update events with the specified interval, or changes the update interval.

Function RegisterForUpdateGameTime(float afInterval)

  • Registers this form to receive update events with the specified interval in game time hours, or changes the update interval.

Function StartObjectProfiling()

  • Starts profiling all scripts attached to this form.

Function StopObjectProfiling()

  • Stops profiling all scripts attached to this form.

Function UnregisterForAnimationEvent(ObjectReference akSender, string asEventName)

  • Unregisters this from from receiving the specified animation event from the specified object.

Function UnregisterForLOS(Actor akViewer, ObjectReference akTarget)

  • Unregisters this form from any LOS events between the viewer and target.

Function UnregisterForSleep()

  • Unregisters this form from sleep events.

Function UnregisterForTrackedStatsEvent()

  • Unregisters this form from tracked stats events.

Function UnregisterForUpdate()

  • Unregisters this form from update events.

Function UnregisterForUpdateGameTime()

  • Unregisters this form from game time update events.

Events

  • Event OnAnimationEvent(ObjectReference akSource, string asEventName)
    • Received when one of animation events we are listening for is recieved.
  • Event 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.
  • Event OnGainLOS(Actor akViewer, ObjectReference akTarget)
    • Received when the viewer goes from not seeing the target to seeing the target - if this form is registered.
  • Event OnLostLOS(Actor akViewer, ObjectReference akTarget)
    • Received when the viewer goes from seeing the target to not seeing the target - if this form is registered.
  • Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)
    • Received when the player goes to sleep.
  • Event OnSleepStop(bool abInterrupted)
    • Received when the player wakes up or is interrupted in sleep.
  • Event OnTrackedStatsEvent(string asStat, in aiStatValue)
    • Received when tracked stats are updated.
  • Event OnUpdate()
    • Received at periodic intervals, if the form is registered.
  • Event OnUpdateGameTime()
    • Received at periodic intervals of game time, if the form is registered.