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
Detecting traffic lights status.
Moderator: OpenTTD Developers
Detecting traffic lights status.
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
Re: Detecting traffic lights status.
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.
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.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Detecting traffic lights status.
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).
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).
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Detecting traffic lights status.
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.
Who is online
Users browsing this forum: No registered users and 20 guests