Background for Fallout 4

ScriptObject


Inheritance Tree
ScriptExtended By
ScriptExtended By
75 scripts
ScriptExtended By
ScriptExtended By
ScriptExtended By
ScriptExtended By
ScriptExtended By
ScriptExtended By
ScriptExtended By
Structs
Properties
Events
Functions
voidfunctionAddInventoryEventFilter(FormakFilter)Native

[DEV SERVER] Loading description...

varfunctionCallFunction(stringasFuncName, var[]aParams)Native

Calls a function on this script synchronously and returns whatever that function does.

voidfunctionCallFunctionNoWait(stringasFuncName, var[]aParams)Native

Calls a function on this script asynchronously. Script execution continues immediately without waiting for the function you called to finish (or even start).

voidfunctionCancelTimer(intaiTimerID=0)Native

Cancels the specified real-time timer on this script. Does nothing if that timer has already expired or doesn't exist.

voidfunctionCancelTimerGameTime(intaiTimerID=0)Native

Cancels the specified game-time timer on this script. Does nothing if that timer has already expired or doesn't exist.

varfunctionGetPropertyValue(stringasPropertyName)Native

Gets the current value of a property on this script by name.

stringfunctionGetState()

Obtains the current state of the script, as a string.

voidfunctionGotoState(stringasNewState)

Sets this object's current state, issuing OnBeginState - ScriptObject and OnEndState - ScriptObject events as necessary.

ScriptObjectfunctionCastAs(stringasScriptName)Native

Attempts to cast this script as a different script, but without adding a dependency on the calling script.

boolfunctionIsBoundGameObjectAvailable()Native

Returns whether this script is attached to a valid and available in-game object. If it returns false, then calling native functions from one of the ScriptObject-extended scripts (like Form, or Alias, or ActiveMagicEffect) will immediately fail because it has no in-game object to operate on. The most common cases of this happening would be a magic effect that has expired, or a reference that is stored in a container.

boolfunctionRegisterForAnimationEvent(ObjectReferenceakSender, stringasEventName)Native

Registers this active magic effect/alias/form for the specified animation event on the specified reference.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForCustomEvent(ScriptObjectakSender, stringasEventName)Native

Registers this script to receive the specified custom event from the source object whenever that source object sends the event. The event will be relayed only to this script and will not be sent to other scripts attached to the same object, or to any aliases or magic effects attached to the object.

voidfunctionRegisterForDetectionLOSGain(ActorakViewer, ObjectReferenceakTarget)Native

Registers this script to receive a single OnGainLOS based on actor detection or current player camera view. If the viewer is currently looking at the target, the event will be sent immediately.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForDetectionLOSLost(ActorakViewer, ObjectReferenceakTarget)Native

[DEV SERVER] Loading description...

voidfunctionRegisterForDirectLOSGain(ObjectReferenceakViewer, ObjectReferenceakTarget, stringasViewerNode="", stringasTargetNode="")Native

Registers this script to receive a single OnGainLOS based on a direct LOS pick. If the viewer can currently see the target, the event will be sent immediately.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForDirectLOSLost(ObjectReferenceakViewer, ObjectReferenceakTarget, stringasViewerNode="", stringasTargetNode="")Native

Registers this script to receive a single OnLostLOS based on a direct LOS pick. If the viewer can not currently see the target, the event will be sent immediately.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForDistanceLessThanEvent(ScriptObjectakObj1, ScriptObjectakObj2, floatafDistance)Native

[DEV SERVER] Loading description...

voidfunctionRegisterForDistanceGreaterThanEvent(ScriptObjectakObj1, ScriptObjectakObj2, floatafDistance)Native

[DEV SERVER] Loading description...

voidfunctionRegisterForHitEvent(ScriptObjectakTarget, ScriptObjectakAggressorFilter=NONE, FormakSourceFilter=NONE, FormakProjectileFilter=NONE, intaiPowerFilter=-1, intaiSneakFilter=-1, intaiBashFilter=-1, intaiBlockFilter=-1, boolabMatch=true)Native

Registers this script to receive a single OnHit event matching the filters given to this function.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForMagicEffectApplyEvent(ScriptObjectakTarget, ScriptObjectakCasterFilter=NONE, FormakEffectFilter=NONE, boolabMatch=true)Native

Registers this script to receive a single OnMagicEffectApply event matching the filters given to this function.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForMenuOpenCloseEvent(stringasMenuName)Native

Registers this active magic effect/alias/form to receive menu open/close events.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForPlayerSleep()Native

Registers this active magic effect/alias/form to receive events when the player goes to sleep and when he wakes up.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForPlayerTeleport()Native

Registers this active magic effect/alias/form to receive events when the player goes teleports via fast travel, load doors, or MoveTo.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

voidfunctionRegisterForPlayerWait()Native

Registers this active magic effect/alias/form to receive events when the player starts and stops waiting.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

Registers this script to receive a single OnRadiationDamage event from the target.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

boolfunctionRegisterForRemoteEvent(ScriptObjectakEventSource, stringasEventName)Native

Registers this script to receive the specified event from the source object whenever that source object receives the event. Calling the event directly on the source object will not relay the event to this script. The event will be relayed only to this script and will not be sent to other scripts attached to the same object, or to any aliases or magic effects attached to the object.

voidfunctionRegisterForTrackedStatsEvent(stringasStat, intaiThreshold)Native

[DEV SERVER] Loading description...

voidfunctionRegisterForLooksMenuEvent()Native

Registers this script to receive OnLooksMenuEvent.

Only the script that registers for an event will receive it. Other scripts will not receive the event unless they also register for it.

voidfunctionRegisterForTutorialEvent(stringasEventName)Native

Registers this script to receive OnTutorialEvent.

Only the script that registers for an event will receive it. Other scripts will not receive the event unless they also register for it. Once the event is received, you will be unregistered automatically.

voidfunctionRemoveAllInventoryEventFilters()Native

Removes all "filters" applied to inventory events on this object. The object will no longer receive any inventory events. The filters are removed separately from each script on an object, so each script on an object needs to separately manage its own filters and will not interfere with any filters on any other scripts attached to the same object.

voidfunctionRemoveInventoryEventFilter(FormakFilter)Native

[DEV SERVER] Loading description...

voidfunctionSendCustomEvent(stringasEvent, var[]akArgs=NONE)Native

Sends the specified custom event to any scripts that have registered for it. The event must be defined in our script or in one of our parent scripts. This function returns immediately, not waiting for any of the receivers.

voidfunctionSetPropertyValue(stringasPropertyName, varaValue)Native

Sets the value of a property on this script by name, synchronously.

voidfunctionSetPropertyValueNoWait(stringasPropertyName, varaValue)Native

Sets a the value of a property on this script by name, asynchronously.

voidfunctionStartTimer(floatafInterval, intaiTimerID=0)Native

Starts a real-time timer on this script with the specified ID. Will cause an OnTimer event to occur once the timer expires that will not repeat. Time will only count when not in menu-mode.

voidfunctionStartTimerGameTime(floatafInterval, intaiTimerID=0)Native

Starts a game-time timer on this script with the specified ID. Will cause an OnTimerGameTime event to occur once the timer expires that will not repeat. Time will only count when not in menu-mode.

voidfunctionUnregisterForAllEvents()Native

Unregisters this script from all events that it has registered for.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive their events.

voidfunctionUnregisterForAllCustomEvents()Native

Unregisters this script from all custom events that it has registered for.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive their events.

voidfunctionUnregisterForAllHitEvents(ScriptObjectakTarget=NONE)Native

Unregisters this script from all OnHit events from the specified target - or from all targets if given a None target.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

Unregisters this script from all OnMagicEffectApply events from the specified target - or from all targets if given a None target.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

Unregisters this script from all OnMenuOpenCloseEvent events.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

Unregisters this script from all OnRadiationDamage events.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

voidfunctionUnregisterForAllRemoteEvents()Native

Unregisters this script from all remote events that it has registered for.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive their events.

Unregisters this active magic effect/alias/form from receiving any tracked stats events.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it seperately.

voidfunctionUnregisterForAnimationEvent(ObjectReferenceakSender, stringasEventName)Native

Unregisters this active magic effect/alias/form from the specified animation event on the specified reference.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it seperately.

voidfunctionUnregisterForCustomEvent(ScriptObjectakSender, stringasEventName)Native

Unregisters this script from receive the specified custom event from the source object whenever that source object sends the event. This will only unregister this script and not any other script attached to the same form, or alias or magic effect.

voidfunctionUnregisterForDistanceEvents(ScriptObjectakObj1, ScriptObjectakObj2)Native

[DEV SERVER] Loading description...

voidfunctionUnregisterForHitEvent(ScriptObjectakTarget, ScriptObjectakAggressorFilter=NONE, FormakSourceFilter=NONE, FormakProjectileFilter=NONE, intaiPowerFilter=-1, intaiSneakFilter=-1, intaiBashFilter=-1, intaiBlockFilter=-1, boolabMatch=true)Native

[DEV SERVER] Loading description...

voidfunctionUnregisterForLOS(ObjectReferenceakViewer, ObjectReferenceakTarget)Native

Unregisters this script to stop receiving LOS events from between the viewer and the target.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it seperately.

voidfunctionUnregisterForMagicEffectApplyEvent(ScriptObjectakTarget, ScriptObjectakCasterFilter=NONE, FormakEffectFilter=NONE, boolabMatch=true)Native

[DEV SERVER] Loading description...

voidfunctionUnregisterForMenuOpenCloseEvent(stringasMenuName)Native

Unregisters this active magic effect/alias/form from receiving menu open/close events.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it seperately.

voidfunctionUnregisterForPlayerSleep()Native

Unregisters this active magic effect/alias/form from receiving sleep-related events.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it seperately.

voidfunctionUnregisterForPlayerTeleport()Native

Unregisters this active magic effect/alias/form from receiving teleport events.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

voidfunctionUnregisterForPlayerWait()Native

Unregisters this active magic effect/alias/form from receiving wait-related events.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it seperately.

Unregisters this script from a OnRadiationDamage event from the target.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

voidfunctionUnregisterForRemoteEvent(ScriptObjectakEventSource, stringasEventName)Native

Unregisters this script from receive the specified event from the source object whenever that source object receives the event. This will only unregister this script and not any other script attached to the same form, or alias or magic effect.

voidfunctionUnregisterForTrackedStatsEvent(stringasStat)Native

Unregisters this active magic effect/alias/form from receiving a tracked stats event for the specified stat.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it seperately.

voidfunctionUnregisterForLooksMenuEvent()Native

Unregisters this script from receiving OnLooksMenuEvent.

Only the script that unregisters for an event will stop receiving it. Other scripts will still receive the event if they registered for it seperately.

voidfunctionUnregisterForTutorialEvent(stringasEventName)Native

Unregisters this script from receiving OnTutorialEvent.

Only the script that unregisters for an event will stop receiving it. Other scripts will still receive the event if they registered for it separately.

voidfunctionRegisterForKey(intkey)Native

Registers the given Scan Code for OnKeyDown and OnKeyUp events.

voidfunctionUnregisterForKey(intkey)Native

Unregisters the given Scan Code for OnKeyDown and OnKeyUp events after prior registration via RegisterForKey.

voidfunctionRegisterForControl(stringcontrol)Native

Registers the given Control for OnControlDown and OnControlUp events.

voidfunctionUnregisterForControl(stringcontrol)Native

Unregisters the given control for OnControlDown and OnControlUp events after prior registration via RegisterForControl.

voidfunctionRegisterForExternalEvent(stringeventName, stringcallback)Native

Callback is the function name that is called when the event is triggered.

voidfunctionUnregisterForExternalEvent(stringeventName)Native
voidfunctionRegisterForCameraState()Native

Registers this script to receive the OnPlayerCameraState event. This event occurs whenever there is a change to the players camera state.

voidfunctionUnregisterForCameraState()Native
voidfunctionRegisterForFurnitureEvent(varfilter=NONE)Native

Filter can be one or none of the following:
ObjectReference
Var[] (containing ObjectReferece Vars)
FormList (containing ObjectReference)
Filtering by Furniture object will receive events from any Actor who sits in it
Filtering by Actor will receive events from whenever the specified Actor sits on any furniture
Registering again with a different filter will result in merging of the filters

voidfunctionUnregisterForFurnitureEvent(varfilter=NONE)Native

Filter works similarly to Register
None filter will remove all active filters and unregister the event

voidfunctionRegisterForGamepadButton(intkey)Native

gamepad buttons using xinput button codes

voidfunctionUnregisterForGamepadButton(intkey)Native
Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.