Page 1 of 1

BuildStation station_id?

Posted: 09 Jul 2011 11:33
by Kev!
Howdy,

Another noobtion ?( ...I am trying to build my first bus station and the call needs a station id? How do I know the station id if it hasn't been built yet? If i just put in a number like 1 it does not error out, but that can't be right...right?

I tried to look at some of your code but am not seeing it...

Please advise,
Kev!

Re: BuildStation station_id?

Posted: 09 Jul 2011 11:39
by Zuu
Please tell us what code you tried to use. Then we can give you advice without having to write an essay.

Re: BuildStation station_id?

Posted: 09 Jul 2011 11:47
by frosch
The station ID is for distant-join, i.e. if you want to join the station with an existing one.
Use AIStation::STATION_NEW for a completely new station.
NoAI API docs wrote: station_id The station to join, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT.

Re: BuildStation station_id?

Posted: 09 Jul 2011 17:21
by Kev!
Frosch,

Thank you for a short to the point response that actually answers my question! :bow: You have my eternal gratitude...


I will now try using AIStation::STATION_NEW in my BuildStation call.

I have a feeling I may need to get a loan before I can build anything?

Kev!

Re: BuildStation station_id?

Posted: 09 Jul 2011 17:27
by Kev!
Howdy,

Uh...just for the record...where exactly in the API documentation would I have found that?

AIStation::STATION_NEW

Annoying noobs want to know,
Kev!

Re: BuildStation station_id?

Posted: 09 Jul 2011 18:45
by Brumi
You can find it here, it is what frosch has quoted.

You don't need to take a loan first if the bus station is the only thing you build so far, check the error with

Code: Select all

AILog.Info(AIError.GetLastErrorString());
Do not forget to set the current road type first:

Code: Select all

AIRoad.SetCurrentRoadType(AIRoad.ROADTYPE_ROAD);

Re: BuildStation station_id?

Posted: 09 Jul 2011 20:16
by Kev!
Ha Ha! I just needed to Scroll down in AIRoad? I was gonna brag about finding it in the AIBaseStation section...I feel like a noob!

It's working! Thanks...

You are ALL awesome,
Kev!