Page 1 of 1

BuildNewGRFRailStation

Posted: 03 Dec 2010 23:48
by Hephi
Hi, I'm writing a new AI that uses train stations in towns to carry mail around.
I wanted to use some new grf stations to add some flavour to it all but I can't get
my head wrapped around how they work.

Currently I'm using Industrial Station Renewal GRF and I wanted to check what things it could do.
By trial and error I iterated a counter to check on what it would build but I'ld rather find another
way of going over the possible buildings. Also it doesn't show all the buildings, only the stations.
How do I get the non station buildings?

Currently I'm using

Code: Select all

			AIRail.BuildNewGRFRailStation(station.Begin(),stat_direction,MailAI.station_width,MailAI.station_length,AIStation.STATION_NEW, counter, 2, 9,50,false);
Where the counter and the boolean at the end seems to be the only one that matters to change what building it builds. The values 2,9,50 seem to be off no importance.

I've searched high and low on IndustryTypes, examples or more information but to no avail.
I could use any pointers you guys have. I can make my station a covered valuables station (use counter=11,22 or 23) but I'ld like to add fluff buildings next to it and have some variation in how they look.

Thanks!

On a side not: I haven't looked in to this but is there a good way of detecting which grf's are enabled in the game so I can check those inside my AI code?

Re: BuildNewGRFRailStation

Posted: 03 Dec 2010 23:59
by Yexo
Hephi wrote:Where the counter and the boolean at the end seems to be the only one that matters to change what building it builds. The values 2,9,50 seem to be off no importance.

I've searched high and low on IndustryTypes, examples or more information but to no avail.
I could use any pointers you guys have. I can make my station a covered valuables station (use counter=11,22 or 23) but I'ld like to add fluff buildings next to it and have some variation in how they look.
The only things OpenTTD does with all those values is pass them along to a newgrf callback. The NewGRF decides which station will be build. It's not possible to build non-rail tiles this way, being able to do that is an open feature request but the current newgrf specs offer no support for it.

For the exact details on which values will result in which station type you'll have to ask the newgrf author (ask about callback 18).
On a side not: I haven't looked in to this but is there a good way of detecting which grf's are enabled in the game so I can check those inside my AI code?
Not possible, and won't be implemented.