Difference between revisions of "GetMiscComponents - MiscObject"
Jump to navigation
Jump to search
GetMiscComponents - MiscObject (edit)
Revision as of 13:00, 25 November 2018
, 13:00, 25 November 2018Extended the papyrus example. Thanks @JigsJosh for getting it started.
imported>Jimhsu m |
imported>Qazaaq (Extended the papyrus example. Thanks @JigsJosh for getting it started.) |
||
Line 3: | Line 3: | ||
{{Template:Papyrus:RequiredF4SE|version=0.4.2}} | {{Template:Papyrus:RequiredF4SE|version=0.4.2}} | ||
Gets an array of [[MiscComponent Struct - MiscObject|MiscComponent]] for this [[MiscItem]]. | |||
== Syntax == | == Syntax == | ||
Line 14: | Line 14: | ||
== Return Value == | == Return Value == | ||
An array of MiscComponent | An array of [[MiscComponent Struct - MiscObject|MiscComponent]] structures. | ||
== Examples == | == Examples == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
MiscObject:MiscComponent[] | ; Count miscellaneous components | ||
int count = Item.GetMiscComponents().Length | |||
Debug.Trace(Item + " has " + count + " components.") | |||
</source> | |||
<source lang="papyrus"> | |||
{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 | |||
</source> | </source> | ||
== See Also == | == See Also == | ||
*[[MiscObject | *[[MiscItem]] | ||
*[[Component]] | |||
*[[MiscComponent Struct - MiscObject]] | |||
[[Category: Scripting]] | [[Category:Scripting]] | ||
[[Category: Papyrus]] | [[Category:Papyrus]] | ||
[[Category: F4SE]] | [[Category:F4SE]] |