I am attempting to produce a surface geology map by reading the highest non-soil rock layers from df.global.world.world_data. Quietust has helpfully suggested getting the region index from region_map(x)(y), but I've hit a wall here. I cannot figure out how to use the coordinates here. Parentheses do not work, and every reference I can find to reading 2D data from Lua writes it as printall(data[x][y])
This doesn't work either.
I have had limited success using printall(region_map[x])
which has 129 valid values for x. From the temperature and elevation data I can read from it, these are the northernmost region tiles from west to east. That's great, but I'd really like to know how to adjust the y values. printall(region_map[x][y])
does not work, nor do any of the permutations I've tried, such as printall(region_map[x,y])
printall(region_map[x],[y])
printall(region_map[[x][y]])
and so on.
I'm fairly new to Lua, though I've had some experience in Python, and my attempts to find descriptions of the correct syntax all point to printall(region_map[x][y])
which doesn't work. Could anyone point me in the right direction please?