Better NOGO NOAI api

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
kraken
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2016 14:11

Better NOGO NOAI api

Post by kraken »

Is possible to add some functions to the api?

1. In GSRoad is missing function IsOneway(), so I cannot check if the road on tile is one way or not.

2. How to get list of all companies, there is not GSCompayList()

3. Missing sign events, GSEventSignCreated and GSEventSignRenamed or GSEventSignChanged
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Better NOGO NOAI api

Post by Zuu »

#1 It looks like GSRoad.AreRoadTilesConnected() take into account one-way roads.

#2 can be solved by looping over all possible company numbers and checking if they are valid/existing. Loop from GSCompany.COMPANY_FIRST to GSCompany.COMPANY_LAST, and then you can use GSCompany.ResolveCompanyID and check the result for GSCompany.COMPANY_INVALID.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 28 guests