Difference between revisions of "NVC Tutorial"
Jump to navigation
Jump to search
updated
imported>Speedo (Created) |
imported>Speedo (updated) |
||
|
*Save some basic info about each item: FormID and count of that item in the inventory
*Save some basic stats for the item in a child container "<name>\Stats": OBSE item type, gold value and weight
*Once all data has been assembled, output the container as both text and XML.
==The Script==
int con
string_var tempStr
int tempInt
if (IsContainer || IsActor)
set con to nvcNew
set
set index to 0
set tempRef to GetInventoryObject index
if (nvcChildExists con 0
set tempInt to GetItemCount tempRef
set tempInt to GetObjectType tempRef
set tempFloat to GetWeight tempRef
set tempInt to GetFullGoldValue tempRef
endif
set tempRef to GetSelf
nvcPrintToFile con 0 -1 tempStr
sv_Replace ".txt|.xml" tempStr
nvcSaveToXml con 0 tempStr
nvcDel con
set tempStr to sv_Destruct
else
==Sample Output==
Output from a
===Text File Output===
<pre>
Container
Owner
Protected
Item Count =
Base FormID =
FormID =
Iron Arrow\
Count =
FormID =
Stats\
Type =
Value = 1 <int>
Weight =
Iron Bow\
Count = 1 <int>
FormID =
Stats\
Type =
Value =
Weight =
Lockpick\
Count = 1 <int>
FormID =
Stats\
Type =
Value =
Weight =
Rusty Iron Mace\
Count = 1 <int>
FormID =
Stats\
Type = 33 <int>
Value =
Weight =
</pre>
===XML File Output===
<pre>
<?xml version="1.0" ?>
<container version="1" />
<int>
<value name="Item Count" data="4" />
</int>
<ref>
<value name="Base FormID" data="00084B29" esp="Oblivion.esm" />
<value name="FormID" data="00000000" esp="<none>" />
</ref>
<child name="Iron Arrow">
<int>
<value name="Count" data="5" />
</int>
<ref>
<value name="FormID" data="00017829" esp="Oblivion.esm" />
</ref>
<child name="Stats">
<int>
<value name="Type" data="34" />
<value name="Value" data="1" />
</int>
<float>
<value name="Weight" data="0.100000" />
</float>
</child>
</child>
<child name="Iron Bow">
<int>
<value name="Count" data="1" />
</int>
<ref>
<value name="FormID" data="00025231" esp="Oblivion.esm" />
</ref>
<child name="Stats">
<int>
<value name="Type" data="33" />
<value name="Value" data="11" />
</int>
<float>
<value name="Weight" data="8.000000" />
</float>
</child>
</child>
<child name="Lockpick">
<int>
<value name="Count" data="1" />
</int>
<ref>
<value name="FormID" data="0000000A" esp="Oblivion.esm" />
</ref>
<child name="Stats">
<int>
<value name="Type" data="27" />
<value name="Value" data="3" />
</int>
<float>
<value name="Weight" data="0.000000" />
</float>
</child>
</child>
<child name="Rusty Iron Mace">
<int>
<value name="Count" data="1" />
</int>
<ref>
<value name="FormID" data="00090614" esp="Oblivion.esm" />
</ref>
<child name="Stats">
<int>
<value name="Type" data="33" />
<value name="Value" data="6" />
</int>
<float>
<value name="Weight" data="15.000000" />
</float>
</child>
</child>
</pre>
| |||