record {
int amount;
string type;
} [item] inventoryFile;
foreach it,count in get_inventory() {
inventoryFile[it].amount = count;
inventoryFile[it].type = it.item_type();
}
map_to_file(inventoryFile, "ItemList.txt");
If you want it to have more variables, you'll need to define your map. something like:
Code:record { int amount; string type; } [item] inventoryFile; foreach it,count in get_inventory() { inventoryFile[it].amount = count; inventoryFile[it].type = it.item_type(); } map_to_file(inventoryFile, "ItemList.txt");
For curiosity's sake, what did I screw up, Bale? It validated the code fine, but since you edited my post, I'm assuming that I messed something up.![]()
Thanks for the clarification. Heh.
In this particular case I only changed whitespace and whitespace isn't displayed so you can puzzle at the fact that I appear to change nothing in the lines that it is telling you have been changed.