Difference between revisions of "MiscComponent Struct - MiscObject"
MiscComponent Struct - MiscObject (edit)
Revision as of 20:10, 2 December 2018
, 20:10, 2 December 2018code example
imported>Qazaaq (Added details and code examples.) |
imported>Qazaaq m (code example) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
{{Template:Papyrus:RequiredF4SE|version=0.4.2}} | {{Template:Papyrus:RequiredF4SE|version=0.4.2}} | ||
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 19: | Line 19: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
; Trace miscellaneous 'c_Gold' component | ; Trace miscellaneous 'c_Gold' component | ||
Component c_Gold | |||
MiscObject:MiscComponent gold = new MiscObject:MiscComponent | MiscObject:MiscComponent gold = new MiscObject:MiscComponent | ||
gold.Object = c_Gold | gold.Object = c_Gold | ||
Line 29: | Line 31: | ||
Scriptname Example extends ScriptObject | Scriptname Example extends ScriptObject | ||
import MiscObject | import MiscObject | ||
Group Components | Group Components | ||
Line 40: | Line 40: | ||
Event OnInit() | Event OnInit() | ||
{An array of miscellaneous components} | {An array of miscellaneous components} | ||
MiscComponent[] components = new MiscComponent[0] | |||
MiscComponent leather = new MiscComponent | MiscComponent leather = new MiscComponent | ||
leather.Object = c_Leather | leather.Object = c_Leather | ||
leather.Count = 1 | leather.Count = 1 | ||
components.Add(leather) | |||
MiscComponent plastic = new MiscComponent | MiscComponent plastic = new MiscComponent | ||
plastic.Object = c_Plastic | plastic.Object = c_Plastic | ||
plastic.Count = | plastic.Count = 2 | ||
components.Add(plastic) | |||
MiscComponent steel = new MiscComponent | MiscComponent steel = new MiscComponent | ||
steel.Object = c_Steel | steel.Object = c_Steel | ||
steel.Count = | steel.Count = 3 | ||
components.Add(steel) | |||
int index = 0 | int index = 0 | ||
While (index < | While (index < components.Length) | ||
Debug.Trace("("+index+" of "+ | Debug.Trace("("+index+" of "+components.Length+") There is "+components[index].Count+" of the '"+components[index].Object+"' component") | ||
index += 1 | index += 1 | ||
EndWhile | EndWhile | ||
Line 68: | Line 68: | ||
*[[MiscItem]] | *[[MiscItem]] | ||
*[[Component]] | *[[Component]] | ||
*[[GetMiscComponents - MiscObject]] | |||
*[[SetMiscComponents - MiscObject]] | |||