Background for Fallout 4
Member of the MiscObject script
intfunctionGetObjectComponentCount(ComponentakComponent)Native

Description

Wiki Description

Gets the quantity of the given Component from the MiscItem Component Data.

Documentation Comment

Returns the number of the given component this form has.


Caveats


Parameters

ComponentakComponent

CK Wiki Description

//falloutck.uesp.net/wiki/Component "Component") that should be counted.


Examples

; Count the miscellaneous components
MiscObject DeskFanOffice01
Component c_Screws

int count = DeskFanOffice01.GetObjectComponentCount(c_Screws)
Debug.Trace("The '"+DeskFanOffice01+"' item has "+count+" of the "+c_Screws+" component.")
Scriptname Example extends ScriptObject

MiscObject Property DeskFanOffice01 Auto Const Mandatory
Component Property c_Screws Auto Const Mandatory

Event OnInit()
    {Count the miscellaneous components}
    int count = DeskFanOffice01.GetObjectComponentCount(c_Screws)
    If (count > 0)
        Debug.Trace("The '"+DeskFanOffice01+"' item has "+count+" of the "+c_Screws+" component.")
    Else
        Debug.Trace("The '"+DeskFanOffice01+"' item does not use the "+c_Screws+" component.")
    EndIf
EndEvent

Auto-Generated Example

Component myComponent__akComponent

int returnedValue = myMiscObject__toCallFunctionOn.GetObjectComponentCount(myComponent__akComponent)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

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