Hi
I have downloaded the demo clock script from the Wiki, and from this working example I add my own code to see what can be done. But the first few lines I add create a headache for me.
Code
-- search for new industries
local allConstructions = api.res.constructionRep.getAll()
print ("allConstructions =",#allConstructions ," /UG_melectro_demo_clock")
for i = 0, #allConstructions-1 do
if allConstructions[i] == "industry/tools_factory.con" then
print ("Construction name =",allConstructions[i] ," /UG_melectro_demo_clock")
end
end
The code works so far that it can find one Tool factory and it is printed in the console.
I was happy to see that in my new free game i got 538 constructions, but while adding more industries or f.eg. railway stations, it will not increase the number of "allConstructions".
What is wrong?
is this the result as the function is only run one time ?