2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
9 * @page ai_changelog Lists all changes / additions to the API.
11 * Only new / renamed / deleted api functions will be listed here. A list of
12 * bug fixes can be found in the normal changelog. Note that removed API
13 * functions may still be available if you return an older API version
14 * in GetAPIVersion() in info.nut.
18 * This version is not yet released. The following changes are not set in stone yet.
21 * \li AIEventVehicleCrashed::GetVictims
26 * \li AITown::ROAD_LAYOUT_RANDOM
27 * \li AIVehicle::IsPrimaryVehicle
28 * \li AITileList_StationCoverage
29 * \li AIAirport::GetAirportNumHelipads
32 * \li AIError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.
33 * \li AIInfo::CONFIG_RANDOM, no longer used.
34 * \li AIInfo::AddSettings random_deviation is no longer used.
37 * \li AIGroupList accepts an optional filter function
38 * \li AIIndustryList accepts an optional filter function
39 * \li AISignList accepts an optional filter function
40 * \li AISubsidyList accepts an optional filter function
41 * \li AITownList accepts an optional filter function
42 * \li AIVehicleList accepts an optional filter function
43 * \li AIInfo::AddSettings easy_value / medium_value / hard_value are replaced with default_value
48 * \li AICargo::GetWeight
49 * \li AIIndustryType::ResolveNewGRFID
50 * \li AIObjectType::ResolveNewGRFID
53 * \li AIRoad::HasRoadType now correctly checks RoadType against RoadType
60 * \li AIGroup::GetNumVehicles
61 * \li AIMarine::BT_LOCK
62 * \li AIMarine::BT_CANAL
63 * \li AITile::IsSeaTile
64 * \li AITile::IsRiverTile
65 * \li AITile::BT_CLEAR_WATER
66 * \li AIObjectTypeList
72 * \li AICargo::GetName
76 * \li AIVehicle::CloneVehicle now correctly returns estimate when short on cash
81 * \li AIGroup::SetPrimaryColour
82 * \li AIGroup::SetSecondaryColour
83 * \li AIGroup::GetPrimaryColour
84 * \li AIGroup::GetSecondaryColour
85 * \li AIVehicle::BuildVehicleWithRefit
86 * \li AIVehicle::GetBuildWithRefitCapacity
88 * \li AIRoad::RoadVehCanRunOnRoad
89 * \li AIRoad::RoadVehHasPowerOnRoad
90 * \li AIRoad::ConvertRoadType
91 * \li AIRoad::GetMaxSpeed
92 * \li AIEngine::CanRunOnRoad
93 * \li AIEngine::HasPowerOnRoad
94 * \li AIRoadTypeList::RoadTypeList
95 * \li AIEventVehicleAutoReplaced
98 * \li AITile::DemolishTile works without a selected company
103 * \li AIAirport::GetMonthlyMaintenanceCost
104 * \li AIGroup::SetParent
105 * \li AIGroup::GetParent
106 * \li AICompany::SetPrimaryLiveryColour
107 * \li AICompany::SetSecondaryLiveryColour
108 * \li AICompany::GetPrimaryLiveryColour
109 * \li AICompany::GetSecondaryLiveryColour
112 * \li AIBridge::GetName takes one extra parameter to refer the vehicle type
113 * \li AIGroup::CreateGroup gains parent_group_id parameter
120 * \li AIRoad::ERR_ROADTYPE_DISALLOWS_CROSSING
137 * \li AIList::SwapList
138 * \li AIStation::GetCargoPlanned
139 * \li AIStation::GetCargoPlannedFrom
140 * \li AIStation::GetCargoPlannedFromVia
141 * \li AIStation::GetCargoPlannedVia
142 * \li AIStation::GetCargoWaitingFromVia
143 * \li AIStationList_CargoPlannedByFrom
144 * \li AIStationList_CargoPlannedByVia
145 * \li AIStationList_CargoPlannedFromByVia
146 * \li AIStationList_CargoPlannedViaByFrom
147 * \li AIStationList_CargoWaitingByFrom
148 * \li AIStationList_CargoWaitingByVia
149 * \li AIStationList_CargoWaitingFromByVia
150 * \li AIStationList_CargoWaitingViaByFrom
158 * \li AICargo::GetDistributionType
159 * \li AIDate::DATE_INVALID
160 * \li AIDate::IsValidDate
161 * \li AIStation::HasCargoRating
162 * \li AIStation::GetCargoWaitingFrom
163 * \li AIStation::GetCargoWaitingVia
164 * \li AITile::GetTerrainType
165 * \li AITown::FoundTown
166 * \li AITown::GetFundBuildingsDuration
167 * \li AITown::TOWN_GROWTH_NONE
170 * \li AIStation::GetCargoRating does return -1 for cargo-station combinations that
171 * do not have a rating yet instead of returning 69.
180 * \li AITile::GetTerrainType
185 * \li AIEventExclusiveTransportRights
186 * \li AIEventRoadReconstruction
187 * \li AIIndustryType::IsProcessingIndustry
188 * \li AIStation::IsAirportClosed
189 * \li AIStation::OpenCloseAirport
190 * \li AIController::Break
200 * \li AIAirport::GetMaintenanceCostFactor
201 * \li AICargo::CT_AUTO_REFIT
202 * \li AICargo::CT_NO_REFIT
203 * \li AICargo::IsValidTownEffect
204 * \li AICargoList_StationAccepting
205 * \li AICompany::GetQuarterlyIncome
206 * \li AICompany::GetQuarterlyExpenses
207 * \li AICompany::GetQuarterlyCargoDelivered
208 * \li AICompany::GetQuarterlyPerformanceRating
209 * \li AICompany::GetQuarterlyCompanyValue
210 * \li AIController::GetOpsTillSuspend
211 * \li AIEngine::GetMaximumOrderDistance
212 * \li AIEventAircraftDestTooFar
213 * \li AIInfo::CONFIG_DEVELOPER
214 * \li AIInfrastructure
215 * \li AIOrder::ERR_ORDER_AIRCRAFT_NOT_ENOUGH_RANGE
216 * \li AIOrder::GetOrderDistance
217 * \li AIOrder::GetOrderRefit
218 * \li AIOrder::IsRefitOrder
219 * \li AIOrder::SetOrderRefit
220 * \li AIRail::GetMaintenanceCostFactor
221 * \li AIRoad::GetMaintenanceCostFactor
222 * \li AITile::GetTownAuthority
223 * \li AITown::GetCargoGoal
224 * \li AITown::GetGrowthRate
225 * \li AITown::GetLastMonthReceived
226 * \li AITownEffectList (to walk over all available town effects)
227 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached
228 * \li AIVehicle::GetMaximumOrderDistance
231 * \li AITown::GetLastMonthTransported to AITown::GetLastMonthSupplied to better
232 * reflect what it does.
233 * \li AIInfo has all its configure settings renamed from AICONFIG to just CONFIG
234 * like CONFIG_RANDOM.
235 * \li AIEvent has all its types renamed from AI_ET_ prefix to just ET_ prefix,
236 * like ET_SUBSIDY_OFFER.
237 * \li AIOrder has all its types renamed from AIOF_ prefix to just OF_ prefix.
240 * \li AICompany::GetCompanyValue, use AICompany::GetQuarterlyCompanyValue instead.
243 * \li AITown::GetLastMonthProduction no longer has prerequisites based on town
245 * \li AITown::GetLastMonthTransported resp. AITown::GetLastMonthSupplied no longer has prerequisites based on
247 * \li AITown::GetLastMonthTransportedPercentage no longer has prerequisites
248 * based on town effects.
257 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached.
266 * \li IsEnd for all lists.
267 * \li AIEventTownFounded
268 * \li AIIndustry::GetIndustryID
269 * \li AIIndustryType::INDUSTRYTYPE_TOWN
270 * \li AIIndustryType::INDUSTRYTYPE_UNKNOWN
271 * \li AIOrder::IsVoidOrder
272 * \li AIRail::GetName
276 * \li HasNext for all lists.
277 * \li AIAbstractList, use AIList instead.
278 * \li AIList::ChangeItem, use AIList::SetValue instead.
279 * \li AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, that error is never returned anymore.
282 * \li AIEngine::GetMaxTractiveEffort can be used for road vehicles.
283 * \li AIEngine::GetPower can be used for road vehicles.
284 * \li AIEngine::GetWeight can be used for road vehicles.
285 * \li AIIndustry::IsCargoAccepted now returns CargoAcceptState instead of a boolean.
286 * \li AIOrder::GetOrderFlags returns AIOrder::AIOF_INVALID for void orders as well.
287 * \li AIRoad::BuildDriveThroughRoadStation now allows overbuilding.
288 * \li AIRoad::BuildRoadStation now allows overbuilding.
297 * \li AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING
302 * \li AIBridge::GetPrice now returns the price of the bridge without the cost for the rail or road.
307 * \li AIRail::GetMaxSpeed
313 * \li AIEngine::IsBuildable
314 * \li AIEventCompanyAskMerger
315 * \li AIIndustry::GetLastMonthTransportedPercentage
316 * \li AIInfo::AICONFIG_INGAME
317 * \li AIMarine::GetBuildCost
318 * \li AIOrder::AIOF_GOTO_NEAREST_DEPOT
319 * \li AIOrder::GetStopLocation
320 * \li AIOrder::SetStopLocation
321 * \li AIRail::RemoveRailStationTileRectangle
322 * \li AIRail::RemoveRailWaypointTileRectangle
323 * \li AIRail::GetBuildCost
324 * \li AIRoad::GetBuildCost
325 * \li AISubsidy::SubsidyParticipantType
326 * \li AISubsidy::GetSourceType
327 * \li AISubsidy::GetSourceIndex
328 * \li AISubsidy::GetDestinationType
329 * \li AISubsidy::GetDestinationIndex
330 * \li AITile::GetBuildCost
331 * \li AITown::GetLastMonthTransportedPercentage
332 * \li AIVehicleList_Depot
333 * \li AIWaypoint::WaypointType
334 * \li AIWaypoint::HasWaypointType
335 * \li Some error messages to AIWaypoint
338 * \li AIOrder::ChangeOrder, use AIOrder::SetOrderFlags instead
339 * \li AIRail::RemoveRailStationTileRect, use AIRail::RemoveRailStationTileRectangle instead
340 * \li AIRail::RemoveRailWaypoint, use AIRail::RemoveRailWaypointTileRectangle instead
341 * \li AISign::GetMaxSignID, use AISignList instead
342 * \li AIStation::ERR_STATION_TOO_LARGE, use AIError::ERR_STATION_TOO_SPREAD_OUT instead
343 * \li AISubsidy::SourceIsTown, use AISubsidy::GetSourceType instead
344 * \li AISubsidy::GetSource, use AISubsidy::GetSourceIndex instead
345 * \li AISubsidy::DestinationIsTown, use AISubsidy::GetDestinationType instead
346 * \li AISubsidy::GetDestination, use AISubsidy::GetDestinationIndex instead
347 * \li AITile::GetHeight, use AITile::GetMinHeight/GetMaxHeight/GetCornerHeight instead
348 * \li AITown::GetMaxProduction, use AITown::GetLastMonthProduction instead
349 * \li AIVehicle::SkipToVehicleOrder, use AIOrder::SkipToOrder instead
350 * \li AIWaypoint::WAYPOINT_INVALID, use AIBaseStation::STATION_INVALID instead
353 * \li The GetName / SetName / GetLocation functions were moved from AIStation
354 * and AIWaypoint to AIBaseStation, but you can still use AIStation.GetName
356 * \li The GetConstructionDate function was moved from AIStation to
357 * AIBaseStation, but can still be used as AIStation.GetConstructionDate
358 * \li WaypointID was replaced by StationID. All WaypointIDs from previous
359 * savegames are invalid. Use STATION_INVALID instead of WAYPOINT_INVALID
360 * \li AIWaypointList constructor now needs a WaypointType similar to AIStationList,
361 * it can also handle buoys.
362 * \li AIVehicleList_Station now also works for waypoints
363 * \li Stations can be build over rail without signals that is in the right
364 * direction for the to-be built station. It will also convert the rail if
365 * the station's rail type supports the old type.
366 * \li GetAPIVersion() was added as function to info.nut. If it does not exist
367 * API version 0.7 is assumed. This function should return the major and
368 * minor number of the stable version of the API the AI is written against.
369 * For 0.7.2 that would be 0.7, for 1.1.3 it would be 1.1, etc.
370 * \li The subsidy logic has changed. Subsidy is now awarded when cargo
371 * originating from subsidy source is delivered to station that has subsidy
372 * destination it its catchment area. One industry tile or one town house
373 * is enough as long as station accepts the cargo. Awarded subsidies are no
374 * longer bound to stations used for first delivery, any station can be
375 * used for loading and unloading as long as cargo is transferred from
376 * source to destination.
377 * \li Make AIEngine:CanRefitCargo() not report refittability to mail by
378 * default for aircraft. It is not necessarily true. This means that even
379 * if the aircraft can carry mail (as secondary cargo) it does not return
380 * true if the aircraft cannot carry it as its only cargo.
381 * \li Improve behaviour of AIEngine::GetCargoType(), AIEventEnginePreview::GetCargoType()
382 * and AIEngine::CanRefitCargo() for articulated vehicles. For
383 * CanRefitCargo true is returned if at least one part can be refitted.
384 * For GetCargoType the first most used cargo type is returned.
385 * \li AIIndustryType::GetConstructionCost() now returns -1 if the industry is
386 * neither buildable nor prospectable.
387 * \li AIEngine::IsValidEngine will now return true if you have at least one
388 * vehicle of that type in your company, regardless if it's still buildable
389 * or not. AIEngine::IsBuildable returns only true when you can actually
391 * \li AITile::GetCargoProduction will now return the number of producers,
392 * including houses instead the number of producing tiles. This means that
393 * also industries that do not have a tile within the radius, but where
394 * the search bounding box and the industry's bounding box intersect, are
395 * counted. Previously these industries (and their cargoes), although they
396 * produced cargo for a station at the given location, were not returned.
397 * \li AIRail::BuildRail will now fail completely if there is an obstacle
398 * between the begin and end, instead of building up to the obstacle and
399 * returning that everything went okay.
400 * \li Orders for buoys are now waypoint orders, i.e. instead of using the
401 * station orders for buoys one has to use waypoint orders.
402 * \li Autoreplaces can now also be set for the default group via AIGroup.
411 * \li AIAbstractList::SORT_ASCENDING
412 * \li AIAbstractList::SORT_DESCENDING
413 * \li AIAirport::IsAirportInformationAvailable
414 * \li AICompany::GetPresidentGender
415 * \li AICompany::SetPresidentGender
416 * \li AIEngine::GetDesignDate
417 * \li AIStation::GetConstructionDate
420 * \li AIs are now killed when they execute a DoCommand or Sleep at a time
421 * they are not allowed to do so.
422 * \li When the API requests a string as parameter you can give every squirrel
423 * type and it will be converted to a string
424 * \li AIs can create subclasses of API classes and use API constants as part
425 * of their own constants
430 * \li AIVehicle::GetReliability
433 * \li DoCommands and sleeps in call, acall, pcall and valuators are disallowed
438 * \li AIAirport::GetPrice
439 * \li AIController::GetVersion
440 * \li AIOrder::AIOF_DEPOT_FLAGS
441 * \li AIOrder::AIOF_STOP_IN_DEPOT
442 * \li AIOrder::IsCurrentOrderPartOfOrderList
443 * \li AIOrder::IsGotoDepotOrder
444 * \li AIOrder::IsGotoStationOrder
445 * \li AIOrder::IsGotoWaypointOrder
447 * \li AITile::CORNER_[WSEN]
448 * \li AITile::ERR_AREA_ALREADY_FLAT
449 * \li AITile::ERR_EXCAVATION_WOULD_DAMAGE
450 * \li AITile::GetCornerHeight
451 * \li AITile::GetMaxHeight
452 * \li AITile::GetMinHeight
453 * \li AIVehicle::SendVehicleToDepotForServicing
456 * \li GetURL() was added as optional function to info.nut
457 * \li UseAsRandomAI() was added as optional function to info.nut
458 * \li A limit was introduced on the time the AI spends in the constructor and Load function
461 * \li First stable release with the NoAI framework.
468 * \li \ref ai_changelog
472 * \li \ref AIController
475 * \li \ref script_ids