Difference between revisions of "MiscComponent Struct - MiscObject"

m
code example
imported>Qazaaq
m (minor see also link)
imported>Qazaaq
m (code example)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:Incomplete Article}}
'''F4SE Member of:''' [[MiscObject Script]]
'''F4SE Member of:''' [[MiscObject Script]]
{{Template:Papyrus:RequiredF4SE|version=0.4.2}}
{{Template:Papyrus:RequiredF4SE|version=0.4.2}}


Placeholder Description.
A structure that holds information about the ''[[Template:Editor:Property:Component Data|Component Data]]'' of a [[MiscItem]]. This includes a [[Component]] and a number designating the quantity.


== Syntax ==
== Syntax ==
Line 14: Line 13:


== Members ==
== Members ==
*Object: Placeholder Description.
*Object: The [[Component]] to use.
*Count: Placeholder Description.
*Count: The quantity of this component.


== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
; Placeholder Code.
; Trace miscellaneous 'c_Gold' component
Component c_Gold
 
MiscObject:MiscComponent gold = new MiscObject:MiscComponent
gold.Object = c_Gold
gold.Count = 100
Debug.Trace("There is "+gold.Count+" of the '"+gold.Object+"' component")
</source>
 
 
<source lang="papyrus">
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
</source>
</source>


== See Also ==
== See Also ==
*[[MiscItem]]
*[[MiscItem]]
*[[Component]]
*[[GetMiscComponents - MiscObject]]
*[[SetMiscComponents - MiscObject]]




Anonymous user