Mod:Creation Kit/MiscComponent Struct - MiscObject

F4SE Member of: Mod:Creation Kit/MiscObject Script

A structure that holds information about the Component Data of a Mod:Creation Kit/MiscItem. This includes a Mod:Creation Kit/Component and a number designating the quantity.

Syntax
Struct MiscComponent Component Object int Count EndStruct

Members

 * Object: The Mod:Creation Kit/Component to use.
 * Count: The quantity of this component.

Examples
Component c_Gold
 * Trace miscellaneous 'c_Gold' component

MiscObject:MiscComponent gold = new MiscObject:MiscComponent gold.Object = c_Gold gold.Count = 100 Debug.Trace("There is "+gold.Count+" of the '"+gold.Object+"' component")

Scriptname Example extends ScriptObject import MiscObject

Group Components Component Property c_Leather Auto Const Mandatory Component Property c_Plastic Auto Const Mandatory Component Property c_Steel Auto Const Mandatory EndGroup

Event OnInit {An array of miscellaneous components} MiscComponent[] components = new MiscComponent[0]

MiscComponent leather = new MiscComponent leather.Object = c_Leather leather.Count = 1 components.Add(leather)

MiscComponent plastic = new MiscComponent plastic.Object = c_Plastic plastic.Count = 2 components.Add(plastic)

MiscComponent steel = new MiscComponent steel.Object = c_Steel steel.Count = 3 components.Add(steel)

int index = 0 While (index < components.Length) Debug.Trace("("+index+" of "+components.Length+") There is "+components[index].Count+" of the '"+components[index].Object+"' component") index += 1 EndWhile EndEvent