Help with Complex Array.
Localization/HarvestMapData-en.lua
Localization/HarvestMapData-de.lua
Localization/HarvestMapData-fr.lua
I have three files in my manifest file listed like this. I have them that way to I can use a diff program like BeyoneCompare to line up the names so they are always in the exact sequence.
Lua Code:
Harvest.langs = { "en", "de", "fr", }
Harvest.DataStore = {
["alikr"] = {}, --Alik'r Desert
["auridon"] = {}, --Auridon, Khenarthi's Roost
["bangkorai"] = {}, --Bangkorai
["coldharbor"] = {}, --Coldharbour
["cyrodiil"] = {}, --Cyrodiil
["deshaan"] = {}, --"Deshaan"
["eastmarch"] = {}, --Eastmarch
["glenumbra"] = {}, --Glenumbra, Betnikh, Stros M'Kai
["grahtwood"] = {}, --Grahtwood
["greenshade"] = {}, --Greenshade
["malabaltor"] = {}, --Malabal Tor
["reapersmarch"] = {}, --Reaper's March
["rivenspire"] = {}, --Rivenspire
["shadowfen"] = {}, --Shadowfen
["stonefalls"] = {}, --Stonefalls, Bal Foyen, Bleakrock Isle
["stormhaven"] = {}, --Stormhaven
["therift"] = {}, --The Rift
["craglorn"] = {}, --Craglorn
}
This is the beginning of my complex array. I am using code with permission from Undiscovered but I want to change it.
Lua Code:
Harvest.DataStore["en"]["alikr"] = {
--Alik'r Desert (Daggerfall, lvl 31-37)
["alikr_base"] = { --Alik'r Desert
--en
{ "Aldunz", 3 },
}
Then for the next part I want to define it that way. So that I can change the first part in the array to this.
Lua Code:
Harvest.DataStore = {
["alikr"] = Harvest.DataStore[Harvest.langs]["alikr"],
........
}
How can I structure it better? I want it to be something I could do a For loop on like this
Lua Code:
for zone, zones in pairs(Harvest.DataStore) do
for lang, langs in pairs(zones) do
for subzone, subzones in pairs(langs) do
for map, maps in pairs(subzones) do
d("Zone : " .. zone .. " : lang : " .. lang .. " : subzone : " .. subzone .. " : map : " .. map)
would return this
Zone : alikr :
lang : en :
subzone : alikr_base :
map : Aldunz
Lua Code:
Harvest.DataStore["alikr"]["en"]["alikr_base"] = { --Alik'r Desert
--en
{ "Aldunz", 3 },
}
How can I accomplish that result, I fear I am doing something terribly wrong.
Lua Code:
Harvest.DataStore["en"]["alikr_base"] = {
--Alik'r Desert (Daggerfall, lvl 31-37)
--Alik'r Desert
--en
{ "Aldunz", 3 },
}
Harvest.DataStore = {
["alikr"] = {Harvest.DataStore["en"]["alikr_base"],
Harvest.DataStore["de"]["alikr_base"],
Harvest.DataStore["fr"]["alikr_base"]} --Alik'r Desert
Something like that maybe?
EDIT: Nope none of my variations are working.