GetMiscComponents - MiscObject

From the Fallout4 CreationKit Wiki
Revision as of 19:12, 2 December 2018 by imported>Qazaaq (added wiki link)
Jump to navigation Jump to search

F4SE Member of: MiscObject Script
Requires F4SE version 0.4.2 or higher.

Gets the Component Data for this MiscItem as an array of MiscComponent structures.

Syntax

MiscComponent[] Function GetMiscComponents() Native

Parameters

  • None

Return Value

An array of MiscComponent structures.

Examples

; Count miscellaneous components
int count = Item.GetMiscComponents().Length
Debug.Trace(Item + " has " + count + " components.")


{For each miscellaneous component}
MiscObject:MiscComponent[] components = Item.GetMiscComponents()
If (components)
    int index = 0
    While (index < components.Length)
        Debug.Trace(Item + " uses " + components[index].Count + " of the " + components[index].Object + " component.")
        index += 1
    EndWhile
Else
    Debug.Trace(Item + " has no components.")
EndIf

Notes

See Also