Difference between revisions of "Form Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Bot Owned
imported>Arocide
(→‎SKSE Member Functions: Should now contain all SKSE functions upto 1.7.2 (Also fixed some syntax errors))
 
(12 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]
Native base script for every [[Glossary#Form|form]] in the game.
Native base script for every [[Glossary#Form|form]] in the game.


Line 19: Line 13:


== Member Functions ==
== Member Functions ==
'''int Function [[GetFormID - Form|GetFormID]]()'''
*Returns this form's form ID.


'''int Function [[GetGoldValue - Form|GetGoldValue]]()'''
:'''Int [[GetFormID - Form|GetFormID]]()'''
*Returns this form's value in gold.
:*Returns this form's form ID.
 
:'''Int [[GetGoldValue - Form|GetGoldValue]]()'''
:*Returns this form's value in gold.
 
:'''Bool [[HasKeyword - Form|HasKeyword]](Keyword ''akKeyword'')'''
:*Returns if this form has the specified [[Keyword Script|Keyword]] attached.


'''bool Function [[HasKeyword - Form|HasKeyword]](Keyword akKeyword)'''
:'''Bool [[PlayerKnows - Form|PlayerKnows]]()'''
*Returns if this form has the specified [[Keyword Script|Keyword]] attached.
:*Is the "Known" flag set on the form?


'''Function [[PlayerKnows - Form|PlayerKnows]]()'''
:'''[[RegisterForAnimationEvent - Form|RegisterForAnimationEvent]](ObjectReference ''akSender'', String ''asEventName'')'''
*Is the "Known" flag set on the form?
:*Registers this form to receive the specified animation event from the specified object.


'''Function [[RegisterForAnimationEvent - Form|RegisterForAnimationEvent]](ObjectReference akSender, string asEventName)'''
:'''[[RegisterForLOS - Form|RegisterForLOS]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
*Registers this form to receive the specified animation event from the specified object.
:*Registers this form to receive gain and lost LOS events between the viewer and the target.


'''Function [[RegisterForLOS - Form|RegisterForLOS]](Actor akViewer, ObjectReference akTarget)'''
:'''[[RegisterForSingleLOSGain - Form|RegisterForSingleLOSGain]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
*Registers this form to receive gain and lost LOS events between the viewer and the target.
:*Registers this form to receive a single LOS gain event when the viewer sees the target.


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


'''Function [[RegisterForSingleLOSLost - Form|RegisterForSingleLOSLost]](Actor akViewer, ObjectReference akTarget)'''
:'''[[RegisterForSingleUpdate - Form|RegisterForSingleUpdate]](Float ''afInterval'')'''
*Registers this form to receive a single LOS lost event when the viewer loses sight of the target.
:*Registers this form to receive a single update event in the specified time.


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


'''Function [[RegisterForSingleUpdateGameTime - Form|RegisterForSingleUpdateGameTime]](float afInterval)'''
:'''[[RegisterForSleep - Form|RegisterForSleep]]()'''
*Registers this form to receive a single update event in the specified number of game hours.
:*Registers this form to receive sleep events for when the player goes to sleep or wakes up.


'''Function [[RegisterForSleep - Form|RegisterForSleep]]()'''
:'''[[RegisterForTrackedStatsEvent - Form|RegisterForTrackedStatsEvent]]()'''
*Registers this form to receive sleep events for when the player goes to sleep or wakes up.
:*Registers this form to receive tracked stats events for when tracked stats are updated.


'''Function [[RegisterForTrackedStatsEvent - Form|RegisterForTrackedStatsEvent]]()'''
:'''[[RegisterForUpdate - Form|RegisterForUpdate]](Float ''afInterval'')'''
*Registers this form to receive tracked stats events for when tracked stats are updated.
:*Registers this form to receive update events with the specified interval, or changes the update interval.


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


'''Function [[RegisterForUpdateGameTime - Form|RegisterForUpdateGameTime]](float afInterval)'''
:'''[[StartObjectProfiling - Form|StartObjectProfiling]]()'''
*Registers this form to receive update events with the specified interval in game time hours, or changes the update interval.
:*Starts profiling all scripts attached to this form.


'''Function [[StartObjectProfiling - Form|StartObjectProfiling]]()'''
:'''[[StopObjectProfiling - Form|StopObjectProfiling]]()'''
*Starts profiling all scripts attached to this form.
:*Stops profiling all scripts attached to this form.


'''Function [[StopObjectProfiling - Form|StopObjectProfiling]]()'''
:'''[[UnregisterForAnimationEvent - Form|UnregisterForAnimationEvent]](ObjectReference ''akSender'', String ''asEventName'')'''
*Stops profiling all scripts attached to this form.
:*Unregisters this from from receiving the specified animation event from the specified object.


'''Function [[UnregisterForAnimationEvent - Form|UnregisterForAnimationEvent]](ObjectReference akSender, string asEventName)'''
:'''[[UnregisterForLOS - Form|UnregisterForLOS]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
*Unregisters this from from receiving the specified animation event from the specified object.
:*Unregisters this form from any LOS events between the viewer and target.


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


'''Function [[UnregisterForSleep - Form|UnregisterForSleep]]()'''
:'''[[UnregisterForTrackedStatsEvent - Form|UnregisterForTrackedStatsEvent]]()'''
*Unregisters this form from sleep events.
:*Unregisters this form from tracked stats events.


'''Function [[UnregisterForTrackedStatsEvent - Form|UnregisterForTrackedStatsEvent]]()'''
:'''[[UnregisterForUpdate - Form|UnregisterForUpdate]]()'''
*Unregisters this form from tracked stats events.
:*Unregisters this form from update events.


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


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


== SKSE Member Functions ==
== SKSE Member Functions ==
'''int Function [[GetType - Form|GetType]]()'''
*Returns this form's form typecode.


'''string Function [[GetName - Form|GetName]]()'''
:'''Int [[GetType - Form|GetType]]()'''
*Returns this form's full name.
:*Returns this form's form typecode.
 
:'''String [[GetName - Form|GetName]]()'''
:*Returns this form's full name.
 
:'''[[SetName - Form|SetName]](String ''name'')'''
:*Sets this form's full name.
 
:'''Float [[GetWeight - Form|GetWeight]]()'''
:*Returns this form's weight.
 
:'''[[SetWeight - Form|SetWeight]](Float ''weight'')'''
:*Sets this form's weight.
 
:'''[[SetGoldValue - Form|SetGoldValue]](Int ''value'')'''
:*Sets this form's base gold value.
 
:'''Int [[GetNumKeywords - Form|GetNumKeywords]]()'''
:*Returns the number of keywords on this form.
 
:'''Keyword [[GetNthKeyword - Form|GetNthKeyword]](Int ''index'')'''
:*Returns the keyword specified by index on this form.
 
:'''Bool [[HasKeywordString - Form|HasKeywordString]](String ''s'')'''
:*Returns whether this form has a keyword with the specified string.
 
:'''[[SetPlayerKnows - Form|SetPlayerKnows]](Bool ''knows'')'''
:*Sets whether the player know this form. Should only be used For Magic Effects, Words of Power and  Enchantments.


'''Function [[SetName - Form|SetName]](string name)'''
:'''Bool [[IsPlayable - Form|IsPlayable]]()'''
*Sets this form's full name.
:*Returns if the form is marked playable or not. Only works on forms that have that flag, such as Armors.


'''float Function [[GetWeight - Form|GetWeight]]()'''
:'''Bool [[HasWorldModel - Form|HasWorldModel]]()'''
*Returns this form's weight.
:*Returns whether this form has a world model or not.


'''Function [[SetWeight - Form|SetWeight]](float weight)'''
:'''String [[GetWorldModelPath - Form|GetWorldModelPath]]()'''
*Sets this form's weight.
:*Gets this form's world model.


'''Function [[SetGoldValue - Form|SetGoldValue]](int value)'''
:'''[[SetWorldModelPath - Form|SetWorldModelPath]](String ''path'')'''
*Sets this form's base gold value.
:*Sets this form's world model.


'''int Function [[GetNumKeywords - Form|GetNumKeywords]]()'''
:'''Int [[GetWorldModelNumTextureSets - Form|GetWorldModelNumTextureSets]]()'''
*Returns the number of keywords on this form.
:*Returns the number of texture sets the world model has.


'''Keyword Function [[GetNthKeyword - Form|GetNthKeyword]](int index)'''
:'''TextureSet [[GetWorldModelNthTextureSet - Form|GetWorldModelNthTextureSet]](Int ''n'')'''
*Returns the keyword specified by index on this form.
:*Returns the Nth texture set of the forms world model.


'''bool Function [[HasKeywordString - Form|HasKeywordString]](string s)'''
:'''[[SetWorldModelNthTextureSet - Form|SetWorldModelNthTextureSet]](TextureSet ''nSet'', Int ''n'')'''
*Returns whether this form has a keyword with the specified string.
:*Sets the Nth texture set of the forms world model to the specified TextureSet.


'''Function [[RegisterForKey - Form|RegisterForKey]](int keyCode)'''
:'''[[RegisterForKey - Form|RegisterForKey]](Int ''keyCode'')'''
*Registers the given [[Input_Script#DXScanCodes|DXScanCode]] for OnKeyDown and OnKeyUp events.
:*Registers the given [[Input_Script#DXScanCodes|DXScanCode]] for OnKeyDown and OnKeyUp events.


'''Function [[UnregisterForKey - Form|UnregisterForKey]](int keyCode)'''
:'''[[UnregisterForKey - Form|UnregisterForKey]](Int ''keyCode'')'''
*Unregisters the given [[Input_Script#DXScanCodes|DXScanCode]] for OnKeyDown and OnKeyUp events.
:*Unregisters the given [[Input_Script#DXScanCodes|DXScanCode]] for OnKeyDown and OnKeyUp events.


'''Function [[UnregisterForAllKeys - Form|UnregisterForAllKeys]]()'''
:'''[[UnregisterForAllKeys - Form|UnregisterForAllKeys]]()'''
*Unregisters all registered [[Input_Script#DXScanCodes|DXScanCodes]].
:*Unregisters all registered [[Input_Script#DXScanCodes|DXScanCodes]].


'''Function [[RegisterForControl - Form|RegisterForControl]](string control)'''
:'''[[RegisterForControl - Form|RegisterForControl]](String ''control'')'''
*Registers the given control for OnControlDown and OnControlUp events.
:*Registers the given control for OnControlDown and OnControlUp events.


'''Function [[UnregisterForControl - Form|UnregisterForControl]](string control)'''
:'''[[UnregisterForControl - Form|UnregisterForControl]](String ''control'')'''
*Unregisters the given control for OnControlDown and OnControlUp events.
:*Unregisters the given control for OnControlDown and OnControlUp events.


'''Function [[UnregisterForAllControls - Form|UnregisterForAllControls]]()'''
:'''[[UnregisterForAllControls - Form|UnregisterForAllControls]]()'''
*Unregisters all registered controls.
:*Unregisters all registered controls.


'''Function [[RegisterForMenu - Form|RegisterForMenu]](string menuName)'''
:'''[[RegisterForMenu - Form|RegisterForMenu]](String ''menuName'')'''
*Registers for OnMenuOpen and OnMenuClose events for the given menu.
:*Registers for OnMenuOpen and OnMenuClose events for the given menu.


'''Function [[UnregisterForMenu - Form|UnregisterForMenu]](string menuName)'''
:'''[[UnregisterForMenu - Form|UnregisterForMenu]](String ''menuName'')'''
*Unregisters for OnMenuOpen and OnMenuClose events for the given menu.
:*Unregisters for OnMenuOpen and OnMenuClose events for the given menu.


'''Function [[UnregisterForAllMenus - Form|UnregisterForAllMenus]]()'''
:'''[[UnregisterForAllMenus - Form|UnregisterForAllMenus]]()'''
*Unregisters all registered menus.
:*Unregisters all registered menus.


'''Function [[RegisterForModEvent - Form|RegisterForModEvent]](string eventName, string callbackName)'''
:'''[[RegisterForModEvent - Form|RegisterForModEvent]](String ''eventName'', String ''callbackName'')'''
*Registers a custom event callback for given event name.
:*Registers a custom event callback for given event name.


'''Function [[SendModEvent - Form|SendModEvent]](string eventName, string strArg = "", float numArg = 0.0)'''
:'''[[SendModEvent|SendModEvent]](String ''eventName'', String ''strArg'', Float ''numArg'')'''
*Sends a custom event with given generic parameters.
:*Sends a custom event with given generic parameters.


'''Function [[UnregisterForModEvent - Form|UnregisterForModEvent]](string eventName)'''
:'''[[UnregisterForModEvent - Form|UnregisterForModEvent]](String ''eventName'')'''
*Unregisters a custom event callback for given event name.
:*Unregisters a custom event callback for given event name.


'''Function [[UnregisterForAllModEvents - Form|UnregisterForAllModEvents]]()'''
:'''[[UnregisterForAllModEvents|UnregisterForAllModEvents]]()'''
*Unregisters all registered custom events.
:*Unregisters all registered custom events.


'''Form Function [[TempClone - Form|TempClone]]()'''
:'''Form [[TempClone - Form|TempClone]]()'''
*Returns a temporary clone of this form
:*Returns a temporary clone of this form


'''Function [[RegisterForCameraState - Form|RegisterForCameraState]]()'''
:'''[[RegisterForCameraState - Form|RegisterForCameraState]]()'''
*Registers for OnPlayerCameraState events.
:*Registers for OnPlayerCameraState events.


'''Function [[UnregisterForCameraState - Form|UnregisterForCameraState]]()'''
:'''[[UnregisterForCameraState - Form|UnregisterForCameraState]]()'''
*Unregisters for OnPlayerCameraState events.
:*Unregisters for OnPlayerCameraState events.


'''Function [[RegisterForCrosshairRef - Form|RegisterForCrosshairRef]]()'''
:'''[[RegisterForCrosshairRef - Form|RegisterForCrosshairRef]]()'''
*Registers for OnCrosshairRefChange events.
:*Registers for OnCrosshairRefChange events.


'''Function [[UnregisterForCrosshairRef - Form|UnregisterForCrosshairRef]]()'''
:'''[[UnregisterForCrosshairRef - Form|UnregisterForCrosshairRef]]()'''
*Unregisters for OnCrosshairRefChange events.
:*Unregisters for OnCrosshairRefChange events.


'''Function [[RegisterForActorAction - Form|RegisterForActorAction]](int actionType)'''
:'''[[RegisterForActorAction - Form|RegisterForActorAction]](Int ''actionType'')'''
*Registers for OnActorAction events.
:*Registers for OnActorAction events.


'''Function [[UnregisterForActorAction - Form|UnregisterForActorAction]](int actionType)'''
:'''[[UnregisterForActorAction - Form|UnregisterForActorAction]](Int ''actionType'')'''
*Unregisters for OnActorAction events.
:*Unregisters for OnActorAction events.
 
:'''[[RegisterForNiNodeUpdate]]()'''
:*Registers the script for when a QueueNiNodeUpdate is called
 
:'''[[UnregisterForNiNodeUpdate]]()'''
:*Unregisters the script for when a QueueNiNodeUpdate is called


== Events ==
== Events ==
'''Event [[OnAnimationEvent - Form|OnAnimationEvent]](ObjectReference akSource, string asEventName)'''
*Received when one of animation events we are listening for is recieved.


'''Event [[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 recieved.
 
:'''[[OnAnimationEventUnregistered - Form|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 - Form|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 [[OnGainLOS - Form|OnGainLOS]](Actor akViewer, ObjectReference akTarget)'''
:'''[[OnLostLOS - Form|OnLostLOS]](Actor ''akViewer'', ObjectReference ''akTarget'')'''
*Received when the viewer goes from not seeing the target to seeing the target - if this form is registered.
:*Received when the viewer goes from seeing the target to not seeing the target - if this form is registered.


'''Event [[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 form is registered.
:*Received when the player goes to sleep.


'''Event [[OnSleepStart - Form|OnSleepStart]](float afSleepStartTime, float afDesiredSleepEndTime)'''
:'''[[OnSleepStop - Form|OnSleepStop]](Bool ''abInterrupted'')'''
*Received when the player goes to sleep.
:*Received when the player wakes up or is interrupted in sleep.


'''Event [[OnSleepStop - Form|OnSleepStop]](bool abInterrupted)'''
:'''[[OnTrackedStatsEvent - Form|OnTrackedStatsEvent]](String ''asStat'', Int ''aiStatValue'')'''
*Received when the player wakes up or is interrupted in sleep.
:*Received when tracked stats are updated.


'''Event [[OnTrackedStatsEvent - Form|OnTrackedStatsEvent]](string asStat, int aiStatValue)'''
:'''[[OnUpdate - Form|OnUpdate]]()'''
*Received when tracked stats are updated.
:*Received at periodic intervals, if the form is registered.


'''Event [[OnUpdate - Form|OnUpdate]]()'''
:'''[[OnUpdateGameTime - Form|OnUpdateGameTime]]()'''
*Received at periodic intervals, if the form is registered.
:*Received at periodic intervals of game time, if the form is registered.


'''Event [[OnUpdateGameTime - Form|OnUpdateGameTime]]()'''
*Received at periodic intervals of game time, if the form is registered.


== SKSE Events ==
== SKSE Events ==


'''Event [[OnKeyDown - Form|OnKeyDown]](int keyCode)'''
:'''[[OnKeyDown - Form|OnKeyDown]](Int ''keyCode'')'''
*Received when key(s) registered via [[RegisterForKey - Form|RegisterForKey]] are pressed.
:*Received when key(s) registered via [[RegisterForKey - Form|RegisterForKey]] are pressed.
 
:'''[[OnKeyUp - Form|OnKeyUp]](Int ''keyCode'', Float ''holdTime'')'''
:*Received when key(s) registered via [[RegisterForKey - Form|RegisterForKey]] are released.
 
:'''[[OnControlDown - Form|OnControlDown]](String ''control'')'''
:*Received when control(s) registered via [[RegisterForControl - Form|RegisterForControl]] are pressed.


'''Event [[OnKeyUp - Form|OnKeyUp]](int keyCode, float holdTime)'''
:'''[[OnControlUp - Form|OnControlUp]](String ''control'', Float ''holdTime'')'''
*Received when key(s) registered via [[RegisterForKey - Form|RegisterForKey]] are released.
:*Received when control(s) registered via [[RegisterForControl - Form|RegisterForControl]] are released.


'''Event [[OnControlDown - Form|OnControlDown]](string control)'''
:'''[[OnMenuOpen - Form|OnMenuOpen]](String ''menuName'')'''
*Received when control(s) registered via [[RegisterForControl - Form|RegisterForControl]] are pressed.
:*Received when menu(s) registered via [[RegisterForMenu - Form|RegisterForMenu]] are opened.


'''Event [[OnControlUp - Form|OnControlUp]](string control, float holdTime)'''
:'''[[OnMenuClose - Form|OnMenuClose]](String ''menuName'')'''
*Received when control(s) registered via [[RegisterForControl - Form|RegisterForControl]] are released.
:*Received when menu(s) registered via [[RegisterForMenu - Form|RegisterForMenu]] are closed.


'''Event [[OnMenuOpen - Form|OnMenuOpen]](string menuName)'''
:'''[[OnPlayerCameraState - Form|OnPlayerCameraState]](Int ''oldState'', Int ''newState'')'''
*Received when menu(s) registered via [[RegisterForMenu - Form|RegisterForMenu]] are opened.
:*Received when (player camera state changes?) when registered via [[RegisterForCameraState - Form|RegisterForCameraState]]


'''Event [[OnMenuClose - Form|OnMenuClose]](string menuName)'''
:'''[[OnCrosshairRefChange - Form|OnCrosshairRefChange]](ObjectReference ''ref'')'''
*Received when menu(s) registered via [[RegisterForMenu - Form|RegisterForMenu]] are closed.
:*Received when player crosshair changes when registered via [[RegisterForCrosshairRef - Form|RegisterForCrosshairRef]] (Note: ref is none for no target)(Note:Crosshair uses activate pick)


'''Event [[OnPlayerCameraState - Form|OnPlayerCameraState]](int oldState, int newState)'''
:'''[[OnActorAction - Form|OnActorAction]](Int ''actionType'', Actor ''akActor'', Form ''source'', Int ''slot'')'''
*Received when (player camera state changes?) when registered via [[RegisterForCameraState - Form|RegisterForCameraState]]
:*Received when the Actor performs an action that is registered via [[RegisterForActorAction - Form|RegisterForActorAction]]


'''Event [[OnCrosshairRefChange - Form|OnCrosshairRefChange]](ObjectReference ref)'''
:'''[[OnNiNodeUpdate]](ObjectReference ''akActor'')'''
*Received when player crosshair changes when registered via [[RegisterForCrosshairRef - Form|RegisterForCrosshairRef]] (Note: ref is none for no target)(Note:Crosshair uses activate pick)
:*Received when a NINodeUpdate is performed. To recieve this the form must have been registered via [[RegisterForNiNodeUpdate - Form|RegisterForNiNodeUpdate]]


'''Event [[OnActorAction - Form|OnActorAction]](int actionType, Actor akActor, Form source, int slot)'''
[[Category:Scripting]]
*Received when the Actor performs an action that is registered via [[RegisterForActorAction - Form|RegisterForActorAction]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]

Latest revision as of 01:47, 30 April 2015

Native base script for every form in the game.

Definition[edit | edit source]

ScriptName Form

Properties[edit | edit source]

None

Global Functions[edit | edit source]

None

Member Functions[edit | edit source]

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


SKSE Member Functions[edit | edit source]

Int GetType()
  • Returns this form's form typecode.
String GetName()
  • Returns this form's full name.
SetName(String name)
  • Sets this form's full name.
Float GetWeight()
  • Returns this form's weight.
SetWeight(Float weight)
  • Sets this form's weight.
SetGoldValue(Int value)
  • Sets this form's base gold value.
Int GetNumKeywords()
  • Returns the number of keywords on this form.
Keyword GetNthKeyword(Int index)
  • Returns the keyword specified by index on this form.
Bool HasKeywordString(String s)
  • Returns whether this form has a keyword with the specified string.
SetPlayerKnows(Bool knows)
  • Sets whether the player know this form. Should only be used For Magic Effects, Words of Power and Enchantments.
Bool IsPlayable()
  • Returns if the form is marked playable or not. Only works on forms that have that flag, such as Armors.
Bool HasWorldModel()
  • Returns whether this form has a world model or not.
String GetWorldModelPath()
  • Gets this form's world model.
SetWorldModelPath(String path)
  • Sets this form's world model.
Int GetWorldModelNumTextureSets()
  • Returns the number of texture sets the world model has.
TextureSet GetWorldModelNthTextureSet(Int n)
  • Returns the Nth texture set of the forms world model.
SetWorldModelNthTextureSet(TextureSet nSet, Int n)
  • Sets the Nth texture set of the forms world model to the specified TextureSet.
RegisterForKey(Int keyCode)
  • Registers the given DXScanCode for OnKeyDown and OnKeyUp events.
UnregisterForKey(Int keyCode)
  • Unregisters the given DXScanCode for OnKeyDown and OnKeyUp events.
UnregisterForAllKeys()
RegisterForControl(String control)
  • Registers the given control for OnControlDown and OnControlUp events.
UnregisterForControl(String control)
  • Unregisters the given control for OnControlDown and OnControlUp events.
UnregisterForAllControls()
  • Unregisters all registered controls.
RegisterForMenu(String menuName)
  • Registers for OnMenuOpen and OnMenuClose events for the given menu.
UnregisterForMenu(String menuName)
  • Unregisters for OnMenuOpen and OnMenuClose events for the given menu.
UnregisterForAllMenus()
  • Unregisters all registered menus.
RegisterForModEvent(String eventName, String callbackName)
  • Registers a custom event callback for given event name.
SendModEvent(String eventName, String strArg, Float numArg)
  • Sends a custom event with given generic parameters.
UnregisterForModEvent(String eventName)
  • Unregisters a custom event callback for given event name.
UnregisterForAllModEvents()
  • Unregisters all registered custom events.
Form TempClone()
  • Returns a temporary clone of this form
RegisterForCameraState()
  • Registers for OnPlayerCameraState events.
UnregisterForCameraState()
  • Unregisters for OnPlayerCameraState events.
RegisterForCrosshairRef()
  • Registers for OnCrosshairRefChange events.
UnregisterForCrosshairRef()
  • Unregisters for OnCrosshairRefChange events.
RegisterForActorAction(Int actionType)
  • Registers for OnActorAction events.
UnregisterForActorAction(Int actionType)
  • Unregisters for OnActorAction events.
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 recieved.
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 form is registered.
OnLostLOS(Actor akViewer, ObjectReference akTarget)
  • Received when the viewer goes from seeing the target to not seeing the target - if this form is registered.
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 form is registered.
OnUpdateGameTime()
  • Received at periodic intervals of game time, if the form is registered.


SKSE Events[edit | edit source]

OnKeyDown(Int keyCode)
OnKeyUp(Int keyCode, Float holdTime)
OnControlDown(String control)
OnControlUp(String control, Float holdTime)
OnMenuOpen(String menuName)
OnMenuClose(String menuName)
OnPlayerCameraState(Int oldState, Int newState)
OnCrosshairRefChange(ObjectReference ref)
  • Received when player crosshair changes when registered via RegisterForCrosshairRef (Note: ref is none for no target)(Note:Crosshair uses activate pick)
OnActorAction(Int actionType, Actor akActor, Form source, Int slot)
OnNiNodeUpdate(ObjectReference akActor)
  • Received when a NINodeUpdate is performed. To recieve this the form must have been registered via RegisterForNiNodeUpdate