(svn r27985) -Codechange: Convert VA2 switches into ones with non-overlapping ranges...
[openttd.git] / src / script / api / ai_changelog.hpp
blob3a1765b132f2f081bb59bf27a197dd0c70b40db5
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /**
11 * @file ai_changelog.hpp Lists all changes / additions to the API.
13 * Only new / renamed / deleted api functions will be listed here. A list of
14 * bug fixes can be found in the normal changelog. Note that removed API
15 * functions may still be available if you return an older API version
16 * in GetAPIVersion() in info.nut.
18 * \b 1.8.0
20 * 1.8.0 is not yet released. The following changes are not set in stone yet.
22 * \b 1.7.0 - 1.7.2
24 * No changes
26 * \b 1.6.1 - 1.6.0
28 * No changes
30 * \b 1.5.3 - 1.5.1
32 * No changes
34 * \b 1.5.0
36 * API additions:
37 * \li AIList::SwapList
38 * \li AIStation::GetCargoPlanned
39 * \li AIStation::GetCargoPlannedFrom
40 * \li AIStation::GetCargoPlannedFromVia
41 * \li AIStation::GetCargoPlannedVia
42 * \li AIStation::GetCargoWaitingFromVia
43 * \li AIStationList_CargoPlannedByFrom
44 * \li AIStationList_CargoPlannedByVia
45 * \li AIStationList_CargoPlannedFromByVia
46 * \li AIStationList_CargoPlannedViaByFrom
47 * \li AIStationList_CargoWaitingByFrom
48 * \li AIStationList_CargoWaitingByVia
49 * \li AIStationList_CargoWaitingFromByVia
50 * \li AIStationList_CargoWaitingViaByFrom
52 * \b 1.4.4 - 1.4.1
53 * No changes
55 * \b 1.4.0
57 * API additions:
58 * \li AICargo::GetDistributionType
59 * \li AIDate::DATE_INVALID
60 * \li AIDate::IsValidDate
61 * \li AIStation::HasCargoRating
62 * \li AIStation::GetCargoWaitingFrom
63 * \li AIStation::GetCargoWaitingVia
64 * \li AITile::GetTerrainType
65 * \li AITown::FoundTown
66 * \li AITown::GetFundBuildingsDuration
67 * \li AITown::TOWN_GROWTH_NONE
69 * Other changes:
70 * \li AIStation::GetCargoRating does return -1 for cargo-station combinations that
71 * do not have a rating yet instead of returning 69.
73 * \b 1.3.3 - 1.3.2
75 * No changes
77 * \b 1.3.1
79 * API additions:
80 * \li AITile::GetTerrainType
82 * \b 1.3.0
84 * API additions:
85 * \li AIEventExclusiveTransportRights
86 * \li AIEventRoadReconstruction
87 * \li AIIndustryType::IsProcessingIndustry
88 * \li AIStation::IsAirportClosed
89 * \li AIStation::OpenCloseAirport
90 * \li AIController::Break
92 * \b 1.2.3 - 1.2.1
94 * No changes
96 * \b 1.2.0
98 * API additions:
100 * \li AIAirport::GetMaintenanceCostFactor
101 * \li AICargo::CT_AUTO_REFIT
102 * \li AICargo::CT_NO_REFIT
103 * \li AICargo::IsValidTownEffect
104 * \li AICargoList_StationAccepting
105 * \li AICompany::GetQuarterlyIncome
106 * \li AICompany::GetQuarterlyExpenses
107 * \li AICompany::GetQuarterlyCargoDelivered
108 * \li AICompany::GetQuarterlyPerformanceRating
109 * \li AICompany::GetQuarterlyCompanyValue
110 * \li AIController::GetOpsTillSuspend
111 * \li AIEngine::GetMaximumOrderDistance
112 * \li AIEventAircraftDestTooFar
113 * \li AIInfo::CONFIG_DEVELOPER
114 * \li AIInfrastructure
115 * \li AIOrder::ERR_ORDER_AIRCRAFT_NOT_ENOUGH_RANGE
116 * \li AIOrder::GetOrderDistance
117 * \li AIOrder::GetOrderRefit
118 * \li AIOrder::IsRefitOrder
119 * \li AIOrder::SetOrderRefit
120 * \li AIRail::GetMaintenanceCostFactor
121 * \li AIRoad::GetMaintenanceCostFactor
122 * \li AITile::GetTownAuthority
123 * \li AITown::GetCargoGoal
124 * \li AITown::GetGrowthRate
125 * \li AITown::GetLastMonthReceived
126 * \li AITownEffectList (to walk over all available town effects)
127 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached
128 * \li AIVehicle::GetMaximumOrderDistance
130 * API renames:
131 * \li AITown::GetLastMonthTransported to AITown::GetLastMonthSupplied to better
132 * reflect what it does.
133 * \li AIInfo has all its configure settings renamed from AICONFIG to just CONFIG
134 * like CONFIG_RANDOM.
135 * \li AIEvent has all its types renamed from AI_ET_ prefix to just ET_ prefix,
136 * like ET_SUBSIDY_OFFER.
137 * \li AIOrder has all its types renamed from AIOF_ prefix to just OF_ prefix.
139 * API removals:
140 * \li AICompany::GetCompanyValue, use AICompany::GetQuarterlyCompanyValue instead.
142 * Other changes:
143 * \li AITown::GetLastMonthProduction no longer has prerequisites based on town
144 * effects.
145 * \li AITown::GetLastMonthTransported resp. AITown::GetLastMonthSupplied no longer has prerequisites based on
146 * town effects.
147 * \li AITown::GetLastMonthTransportedPercentage no longer has prerequisites
148 * based on town effects.
150 * \b 1.1.5
152 * No changes
154 * \b 1.1.4
156 * API additions:
157 * \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached.
159 * \b 1.1.3 - 1.1.1
161 * No changes
163 * \b 1.1.0
165 * API additions:
166 * \li IsEnd for all lists.
167 * \li AIEventTownFounded
168 * \li AIIndustry::GetIndustryID
169 * \li AIIndustryType::INDUSTRYTYPE_TOWN
170 * \li AIIndustryType::INDUSTRYTYPE_UNKNOWN
171 * \li AIOrder::IsVoidOrder
172 * \li AIRail::GetName
173 * \li AITown::IsCity
175 * API removals:
176 * \li HasNext for all lists.
177 * \li AIAbstractList, use AIList instead.
178 * \li AIList::ChangeItem, use AIList::SetValue instead.
179 * \li AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, that error is never returned anymore.
181 * Other changes:
182 * \li AIEngine::GetMaxTractiveEffort can be used for road vehicles.
183 * \li AIEngine::GetPower can be used for road vehicles.
184 * \li AIEngine::GetWeight can be used for road vehicles.
185 * \li AIIndustry::IsCargoAccepted now returns CargoAcceptState instead of a boolean.
186 * \li AIOrder::GetOrderFlags returns AIOrder::AIOF_INVALID for void orders as well.
187 * \li AIRoad::BuildDriveThroughRoadStation now allows overbuilding.
188 * \li AIRoad::BuildRoadStation now allows overbuilding.
190 * \b 1.0.5 - 1.0.4
192 * No changes
194 * \b 1.0.3
196 * API additions:
197 * \li AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING
199 * \b 1.0.2
201 * Other changes:
202 * \li AIBridge::GetPrice now returns the price of the bridge without the cost for the rail or road.
204 * \b 1.0.1
206 * API additions:
207 * \li AIRail::GetMaxSpeed
209 * \b 1.0.0
211 * API additions:
212 * \li AIBaseStation
213 * \li AIEngine::IsBuildable
214 * \li AIEventCompanyAskMerger
215 * \li AIIndustry::GetLastMonthTransportedPercentage
216 * \li AIInfo::AICONFIG_INGAME
217 * \li AIMarine::GetBuildCost
218 * \li AIOrder::AIOF_GOTO_NEAREST_DEPOT
219 * \li AIOrder::GetStopLocation
220 * \li AIOrder::SetStopLocation
221 * \li AIRail::RemoveRailStationTileRectangle
222 * \li AIRail::RemoveRailWaypointTileRectangle
223 * \li AIRail::GetBuildCost
224 * \li AIRoad::GetBuildCost
225 * \li AISubsidy::SubsidyParticipantType
226 * \li AISubsidy::GetSourceType
227 * \li AISubsidy::GetSourceIndex
228 * \li AISubsidy::GetDestinationType
229 * \li AISubsidy::GetDestinationIndex
230 * \li AITile::GetBuildCost
231 * \li AITown::GetLastMonthTransportedPercentage
232 * \li AIVehicleList_Depot
233 * \li AIWaypoint::WaypointType
234 * \li AIWaypoint::HasWaypointType
235 * \li Some error messages to AIWaypoint
237 * API removals:
238 * \li AIOrder::ChangeOrder, use AIOrder::SetOrderFlags instead
239 * \li AIRail::RemoveRailStationTileRect, use AIRail::RemoveRailStationTileRectangle instead
240 * \li AIRail::RemoveRailWaypoint, use AIRail::RemoveRailWaypointTileRectangle instead
241 * \li AISign::GetMaxSignID, use AISignList instead
242 * \li AIStation::ERR_STATION_TOO_LARGE, use AIError::ERR_STATION_TOO_SPREAD_OUT instead
243 * \li AISubsidy::SourceIsTown, use AISubsidy::GetSourceType instead
244 * \li AISubsidy::GetSource, use AISubsidy::GetSourceIndex instead
245 * \li AISubsidy::DestinationIsTown, use AISubsidy::GetDestinationType instead
246 * \li AISubsidy::GetDestination, use AISubsidy::GetDestinationIndex instead
247 * \li AITile::GetHeight, use AITile::GetMinHeight/GetMaxHeight/GetCornerHeight instead
248 * \li AITown::GetMaxProduction, use AITown::GetLastMonthProduction instead
249 * \li AIVehicle::SkipToVehicleOrder, use AIOrder::SkipToOrder instead
250 * \li AIWaypoint::WAYPOINT_INVALID, use AIBaseStation::STATION_INVALID instead
252 * Other changes:
253 * \li The GetName / SetName / GetLocation functions were moved from AIStation
254 * and AIWaypoint to AIBaseStation, but you can still use AIStation.GetName
255 * as before
256 * \li The GetConstructionDate function was moved from AIStation to
257 * AIBaseStation, but can still be used as AIStation.GetConstructionDate
258 * \li WaypointID was replaced by StationID. All WaypointIDs from previous
259 * savegames are invalid. Use STATION_INVALID instead of WAYPOINT_INVALID
260 * \li AIWaypointList constructor now needs a WaypointType similar to AIStationList,
261 * it can also handle buoys.
262 * \li AIVehicleList_Station now also works for waypoints
263 * \li Stations can be build over rail without signals that is in the right
264 * direction for the to-be built station. It will also convert the rail if
265 * the station's rail type supports the old type.
266 * \li GetAPIVersion() was added as function to info.nut. If it does not exist
267 * API version 0.7 is assumed. This function should return the major and
268 * minor number of the stable version of the API the AI is written against.
269 * For 0.7.2 that would be 0.7, for 1.1.3 it would be 1.1, etc.
270 * \li The subsidy logic has changed. Subsidy is now awarded when cargo
271 * originating from subsidy source is delivered to station that has subsidy
272 * destination it its catchment area. One industry tile or one town house
273 * is enough as long as station accepts the cargo. Awarded subsidies are no
274 * longer bound to stations used for first delivery, any station can be
275 * used for loading and unloading as long as cargo is transfered from
276 * source to destination.
277 * \li Make AIEngine:CanRefitCargo() not report refittability to mail by
278 * default for aircraft. It is not necessarily true. This means that even
279 * if the aircraft can carry mail (as secondary cargo) it does not return
280 * true if the aircraft cannot carry it as its only cargo.
281 * \li Improve behaviour of AIEngine::GetCargoType(), AIEventEnginePreview::GetCargoType()
282 * and AIEngine::CanRefitCargo() for articulated vehicles. For
283 * CanRefitCargo true is returned if at least one part can be refitted.
284 * For GetCargoType the first most used cargo type is returned.
285 * \li AIIndustryType::GetConstructionCost() now returns -1 if the industry is
286 * neither buildable nor prospectable.
287 * \li AIEngine::IsValidEngine will now return true if you have at least one
288 * vehicle of that type in your company, regardless if it's still buildable
289 * or not. AIEngine::IsBuildable returns only true when you can actually
290 * build an engine.
291 * \li AITile::GetCargoProduction will now return the number of producers,
292 * including houses instead the number of producing tiles. This means that
293 * also industries that do not have a tile within the radius, but where
294 * the search bounding box and the industry's bounding box intersect, are
295 * counted. Previously these industries (and their cargoes), although they
296 * produced cargo for a station at the given location, were not returned.
297 * \li AIRail::BuildRail will now fail completely if there is an obstacle
298 * between the begin and end, instead of building up to the obstacle and
299 * returning that everything went okay.
300 * \li Orders for buoys are now waypoint orders, i.e. instead of using the
301 * station orders for buoys one has to use waypoint orders.
302 * \li Autoreplaces can now also be set for the default group via AIGroup.
304 * \b 0.7.5 - 0.7.4
306 * No changes
308 * \b 0.7.3
310 * API additions:
311 * \li AIAbstractList::SORT_ASCENDING
312 * \li AIAbstractList::SORT_DESCENDING
313 * \li AIAirport::IsAirportInformationAvailable
314 * \li AICompany::GetPresidentGender
315 * \li AICompany::SetPresidentGender
316 * \li AIEngine::GetDesignDate
317 * \li AIStation::GetConstructionDate
319 * Other changes:
320 * \li AIs are now killed when they execute a DoCommand or Sleep at a time
321 * they are not allowed to do so.
322 * \li When the API requests a string as parameter you can give every squirrel
323 * type and it will be converted to a string
324 * \li AIs can create subclasses of API classes and use API constants as part
325 * of their own constants
327 * \b 0.7.2
329 * API additions:
330 * \li AIVehicle::GetReliability
332 * Other changes:
333 * \li DoCommands and sleeps in call, acall, pcall and valuators are disallowed
335 * \b 0.7.1
337 * API additions:
338 * \li AIAirport::GetPrice
339 * \li AIController::GetVersion
340 * \li AIOrder::AIOF_DEPOT_FLAGS
341 * \li AIOrder::AIOF_STOP_IN_DEPOT
342 * \li AIOrder::IsCurrentOrderPartOfOrderList
343 * \li AIOrder::IsGotoDepotOrder
344 * \li AIOrder::IsGotoStationOrder
345 * \li AIOrder::IsGotoWaypointOrder
346 * \li AISignList
347 * \li AITile::CORNER_[WSEN]
348 * \li AITile::ERR_AREA_ALREADY_FLAT
349 * \li AITile::ERR_EXCAVATION_WOULD_DAMAGE
350 * \li AITile::GetCornerHeight
351 * \li AITile::GetMaxHeight
352 * \li AITile::GetMinHeight
353 * \li AIVehicle::SendVehicleToDepotForServicing
355 * Other changes:
356 * \li GetURL() was added as optional function to info.nut
357 * \li UseAsRandomAI() was added as optional function to info.nut
358 * \li A limit was introduced on the time the AI spends in the constructor and Load function
360 * \b 0.7.0
361 * \li First stable release with the NoAI framework.