Iterating through all rows in a table is easy, and used in many places in the game's Lua code:
But would it be possible to iterate through all columns in a table, and get the names of these columns as text strings? It would be very useful for my resource placement code...
Code:
for row in GameInfo.TableName () do
[some code here]
end
But would it be possible to iterate through all columns in a table, and get the names of these columns as text strings? It would be very useful for my resource placement code...
If anyone is interested what I need it for - I'm creating a system of resource placement (when a map is generated) and creation (some great people in my mod can create new resources on the map) that uses a system of 22 "plot categories", depending on the terrain, plot type (flat/hills), and features present on the plot. Every resource has a probability of appearing on plots belonging to every category. And instead of the standard Civ5 approach of creating "secondary tables", which would look like this: