API additions 7/5/2009

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
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

API additions 7/5/2009

Post by Yexo »

AIAirport::GetPrice will now return the cost of building that airport
AIController::GetVersion will return the openttd version as specified in the newgrf specification. Use this to break it into smaller pieces:

Code: Select all

local v = AIController.GetVersion();
local major =   (v & 0xF0000000) >> 28;
local minor =   (v & 0x0F000000) >> 24;
local build =   (v & 0x00F00000) >> 20;
local release = (v & 0x00080000) != 0;
local revision = v & 0x0007FFFF;
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: API additions 7/5/2009

Post by Morloth »

Yexo wrote:AIAirport::GetPrice will now return the cost of building that airport
Sweet!!! This really makes things a lot easier :).
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 24 guests