Creating industries in AI?

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
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Creating industries in AI?

Post by Bilbo »

I looket throught API but I found no function to create/prospect industries (depending on game settings). AIIndustry class have only functions for querying industry, is it not possible for AI's to create industries, or I am looking at wrong place?

On the other side - AITown.GetExclusiveRightsDuration provides AI information otherwise unavailable to human player (players see only red dot next to company name) - though I guess in this case GUI needs to be fixed to show length of exclusive rights to human players :)

Also, for AITown.GetAllowedNoise - the API docs does not mention what is returned if the noise management is turned off.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Creating industries in AI?

Post by Zutty »

Bilbo wrote:I looket throught API but I found no function to create/prospect industries (depending on game settings). AIIndustry class have only functions for querying industry, is it not possible for AI's to create industries, or I am looking at wrong place?
You want AIIndustryType
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Creating industries in AI?

Post by Yexo »

Bilbo wrote:Also, for AITown.GetAllowedNoise - the API docs does not mention what is returned if the noise management is turned off.
It'll return 2, and AIAirport::GetNoiseLevelIncrease will always return 1 if noise management is off (two allowed airports, regardless of distance).
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 4 guests