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
- Traffic Manager
- Posts: 160
- Joined: 14 Apr 2017 15:51
- Location: Czech Republic
Is there a command in "NoGo API" or "NoAI API" that detects the traffic lights status or the occupancy status of the track? Alternatively, if a signal can be switched.
I can not find anything
- Posts: 100
- Joined: 01 Nov 2017 21:19
I have no idea whether it is possible to provide such API, but even if it were, this would be against the intent of the game.
The signals exist so that the trains can drive without intervention from the player, be it human or AI. Allowing the AI to take action depending on signal status and track occupancy would allow it to steer every train manually instead of relying on the pathfinder.
- OpenTTD Developer
- Posts: 9394
- Joined: 07 Nov 2007 22:44
- Location: Sol d
There are no provisions to manually control signals and there is currently no intention to add such possibility (as far as I am aware).
Signal state is more a reflection of the path finder status than an input to them (even though they are also input to some degree).
- Posts: 96
- Joined: 12 May 2013 22:28
- Location: Argentina
You can use AITile::HasTransportType to check for crossings and AIVehicle::GetLocation to check for trains just by the road and make your RVs stop until the trains leave the inmediate area. But you cannot find out if the trains are entering or exiting the crossings and the info is only available for those owned by you. GSVehicle can work on any company.
Users browsing this forum: No registered users and 3 guests