AITile.GetOwner and AIOwner.COMPANY_SELF [Resolved]

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

Post Reply
User avatar
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

AITile.GetOwner and AIOwner.COMPANY_SELF [Resolved]

Post by Xander »

Sorry I seem to keep finding problems/doing things wrong :|

Anyways, new one:

Trying to establish which station is mine in a given area. AITile.GetOwner is returning 1, AIOwner.COMPANY_SELF is returning 254. The station is mine and AITile is being fired at the correct tile.

Thoughts?
Last edited by Xander on 09 Aug 2009 19:28, edited 1 time in total.
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: AITile.GetOwner and AIOwner.COMPANY_SELF

Post by Rubidium »

Either use AICompany.IsMine or use AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) to resolve your own company ID
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: AITile.GetOwner and AIOwner.COMPANY_SELF

Post by fanioz »

Available on LibTile.IsMyTile(tile).
AICompany.IsMine(AITile.GetOwner(tile)) :-D
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 6 guests