StationList_AroundIndustry(IndustryID)
Moderator: OpenTTD Developers
StationList_AroundIndustry(IndustryID)
How difficult would this be to add to the API? It's great knowing there's 5 stations "around" an industry, but it'd be much more useful to have a StationList of them...
Re: StationList_AroundIndustry(IndustryID)
You can get it by yourself - iterate/valuate through list of your stations.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: StationList_AroundIndustry(IndustryID)
Would you mind explaining that one in (at least pseudo) code?Kogut wrote:You can get it by yourself - iterate/valuate through list of your stations.
Re: StationList_AroundIndustry(IndustryID)
I found in my AIAI a bit another way to do itXander wrote:Would you mind explaining that one in (at least pseudo) code?Kogut wrote:You can get it by yourself - iterate/valuate through list of your stations.
Code: Select all
local range = 3;
local tile_list=AITileList_IndustryProducing(i, range);
for (local q = tile_list.Begin(); tile_list.HasNext(); q = tile_list.Next()) //from Chopper
{
local station_id = AIStation.GetStationID(q);
if(AIStation.IsValidStation(station_id))
{
//Station found: you can print it, compare, add to list etc
}
}
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Who is online
Users browsing this forum: No registered users and 7 guests