Testing if Industry Types are on Water

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Testing if Industry Types are on Water

Post 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 :)
PathZilla - A networking AI - Now with tram support.
User avatar
Dimme
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 30 Jul 2008 12:42
Location: Trondheim, Norway

Re: Testing if Industry Types are on Water

Post 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
Try my modular airports minigame!

Image
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Testing if Industry Types are on Water

Post 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.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 990
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Testing if Industry Types are on Water

Post 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.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Testing if Industry Types are on Water

Post by Zutty »

Thats great, thanks frosch.
PathZilla - A networking AI - Now with tram support.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 4 guests