If someone ever need to do it too, here is what I do to get the datas about the towns, thanks to the Console.
///
Update: combine steps 2, 3 and 4 into:
Code
local TownsId = (game.interface.getTowns ())
for j = 1, #TownsId do
local id = TownsId [j]
print (commonapi.dmp (game.interface.getEntity (id)), commonapi.dmp (game.interface. getTownCapacities (id)), commonapi.dmp (game.interface. getTownCargoSupplyAndLimit (id)))
end
and to get the industries:
Code
local CId = (game.interface.getEntities ({radius = 1e100}, {type = "CONSTRUCTION"}))
for j = 1, #CId do
local id = CId [j]
print (commonapi.dmp (game.interface.getEntity (id)))
end
///
1) select the script thread
2) input
3) open the stdout.text, copy the answer
4) input
Code
local a = {The IDs I got from # 2} for k, v in pairs (a) do
print (commonapi.dmp (game.interface.getEntity (v)), commonapi.dmp (game.interface. getTownCargoSupplyAndLimit (v)))
end
I then get, for example:
Code
{
counts = {},
id = 21065,
lu2cargoInfo = {},
name = "Edale",
position = {-1563.0946044922, -6945.6201171875, 109.25225830078},
townDestCounts = {},
type = "TOWN",
useLinesCounts = {},
useLinesPercentage = -1
}
{
FUEL = {0, 17},
TOOLS = {0, 17}
}
Alles anzeigen
I haven't been able to get the Towns' IDs in an array that can be used right away. Hopefully I'll learn how to code it properly.
Next I'm gonna try to have that in a mod and have it save the datas in a txt file.
Thanks a lot eis_os for that awesome tool!