Page 1 of 1
Testing if Industry Types are on Water
Posted: 30 Mar 2009 02:10
by Zutty
Hi all,
I note that you can only tell if a
specific industry is built on water (using AIIndustry.IsBuiltOnWater()), rather than an
industry type. Surely there aren't any cases where individual water industries might be built on land. I've not seen any NewGRFs that allow the same industry type on either land or sea.
Is it possible to have this information reflected in AIIndustryType? I know its late in the day given that two release candidates have been put out, but I've seen additions to the API in the last few days so I thought I'd at least mention it.
Thanks

Re: Testing if Industry Types are on Water
Posted: 30 Mar 2009 09:48
by Dimme
If I understood andy correctly, they are planning fisheries on land and in sea for the FIRS industry set.
http://www.tt-forums.net/viewtopic.php? ... &start=200
regards
Dimme
Re: Testing if Industry Types are on Water
Posted: 30 Mar 2009 09:50
by Yexo
Zutty wrote:Hi all,
I note that you can only tell if a
specific industry is built on water (using AIIndustry.IsBuiltOnWater()), rather than an
industry type. Surely there aren't any cases where individual water industries might be built on land. I've not seen any NewGRFs that allow the same industry type on either land or sea.
Is it possible to have this information reflected in AIIndustryType? I know its late in the day given that two release candidates have been put out, but I've seen additions to the API in the last few days so I thought I'd at least mention it.
Thanks

The questions is not whether any current newgrfs do it, but whether or not newgrf could do that. I actually have no idea, so you'll have to wait for someone with more knowledge about newgrfs.
Re: Testing if Industry Types are on Water
Posted: 30 Mar 2009 20:53
by frosch
I duplicated some functions from AIIndustry to AIIndustryType.
Note that industries can also be constructed on both water tiles and land tiles at the same time, i.e. on shore. In that case I would expect the newgrf to defnie the industry as land, though technically it does not matter.
Anyway, newgrfs can generally return lots of wrong information to AIs, which would not harm any player. So I guess at some point we would need to extend the newgrf documentation wrt. what is needed for AIs to work properly.
Re: Testing if Industry Types are on Water
Posted: 30 Mar 2009 21:23
by Zutty
Thats great, thanks frosch.