ww2commander
Emperor
How do you force lua to loop through a table in order of entries.
In the below example, the result is 1942, 1941, 1945, 1943, 1944 when I run the associate code snippet!
I want it to list items in the exact order they appear in the table...obvious reason is that they represent date order.
Any help appreciated
In the below example, the result is 1942, 1941, 1945, 1943, 1944 when I run the associate code snippet!
I want it to list items in the exact order they appear in the table...obvious reason is that they represent date order.
Code:
g_PointThresholds = {
["HANDICAP_SETTLER"] = {
["1941"] = {StartTurn = 0, EndTurn = 27, Points = 0,},
["1942"] = {StartTurn = 28, EndTurn = 79, Points = 0,},
["1943"] = {StartTurn = 80, EndTurn = 131, Points = 0,},
["1944"] = {StartTurn = 132, EndTurn = 0, Points = 0,},
["1945"] = {StartTurn = 185, EndTurn = 206, Points = 0,},
},
}
for year, thresholdData in pairs (g_PointThresholds[playerHandicapType]) do
--do process code here
end
Any help appreciated