API for cargo the station accepts?

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
Xycor
Engineer
Engineer
Posts: 29
Joined: 17 Mar 2014 01:28

API for cargo the station accepts?

Post by Xycor »

How do I get a list of cargoes a station is willing to accept?

I'm trying to learn how to write an AI by starting with a helper AI that prints messages for stations which have a surplus of waiting goods and a deficit of deliveries. This is a first step towards an AI to help with routing in this thread:
http://www.tt-forums.net/viewtopic.php?f=32&t=70188

In the AI API docs for stations I don't see a way to get a list of what cargo the station is currently accepting:
http://noai.openttd.org/api/1.3.3/classAIStation.html

I'm digging through the AdmiralAI but it seems to establish the routes between industries and find/create stations as a secondary step. I'm still getting acquainted with it though.

Thanks
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: API for cargo the station accepts?

Post by Brumi »

Xycor
Engineer
Engineer
Posts: 29
Joined: 17 Mar 2014 01:28

Re: API for cargo the station accepts?

Post by Xycor »

Thanks! That should do the trick.

I was about to reply to my own post after finding the API request here:
http://wiki.openttd.org/AI:APISuggestions
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 11 guests