AIStationList stations seems to fail
Posted: 07 Sep 2011 08:32
Toying around with NoAI - but got some issues retrieving the list of stations.
I fire up the AI, and then team up with it. Then I proceed to build a couple of railroad stations in several towns.
Start function:
For each station, a line is printed, but only the first town name is used. For instance: If I build a station in Kiel, Hamburg and Berlin, the output is then:
Same happens if I use GetLocation on the Station - only the location of the first station is printed.
Is it even possible to do what I attempt to do? Or does the stationList only return stations built by the AI?
edit:
Minor mistake in that one: Either, game is paused until the stations have been built, or a while(true) loop is around the content of the entire Start() function
I fire up the AI, and then team up with it. Then I proceed to build a couple of railroad stations in several towns.
Start function:
Code: Select all
function Start()
{
local sl = AIStationList(AIStation.STATION_TRAIN);
foreach (station in sl) {
AILog.Info("Station near " + AITown.GetName(AIStation.GetNearestTown(station)));
}
}
Code: Select all
Station near Kiel
Station near Kiel
Station near Kiel
Is it even possible to do what I attempt to do? Or does the stationList only return stations built by the AI?
edit:
Minor mistake in that one: Either, game is paused until the stations have been built, or a while(true) loop is around the content of the entire Start() function
