Commit Graph

470 Commits (a6cbf0d419569989d54f6df37232e9e771acafa8)

Author SHA1 Message Date
frosch bdf0b9491d (svn r16267) -Documentation: [NoAI] Explain how to deal with IDs of various objects. 16 years ago
frosch c6f08e1247 (svn r16266) -Documentation: [NoAI] Add details to AITile::(Raise|Lower)Tile wrt. modifiing multiple corners at once. 16 years ago
frosch 96dace426b (svn r16264) -Change/Fix (r16262): [NoAI] Change SLOPE_INVALID to 0xFFFF so that SLOPE_INVALID != (SLOPE_ELEVATED | SLOPE_STEEP | SLOPE_HALFTILE_MASK). 16 years ago
yexo 8d22e4bec3 (svn r16262) -Fix [NoAI]: Check slopes passed to the API better for validity 16 years ago
yexo a00b22b1cd (svn r16253) -Add [NoAI]: AIController::GetVersion, this returns the newgrf-version of OpenTTD 16 years ago
yexo 9b4a32deb4 (svn r16252) -Add [NoAI]: AIAirport::GetPrice, returning the building cost of an airport 16 years ago
yexo 73e1d18871 (svn r16249) -Fix [NoAI]: Enable parameter checking for AIController::* functions again 16 years ago
yexo afc5c66386 (svn r16244) -Fix [NoAI]: Make sure AITunnel::BuildTunnel returns what the documentation says it does 16 years ago
yexo ca435fcece (svn r16243) -Fix [FS#2875]: CmdBuildTunnel could be called with invalid parameters from the api code, causing crashes later 16 years ago
yexo fe5defbacc (svn r16239) -Fix (r16199): Use the stop/non-stop intermediate orderflags AIs can give for goto-depot orders 16 years ago
frosch d518b3d0ac (svn r16199) -Codechange: Pass OrderNonStopFlags also to MakeGoToDepotOrder().
-Fix: 'Go non-stop to nearest depot'-orders did not work wrt. the 'non-stop' part.
-Fix: Adding 'Go to nearest depot'-orders did not respect the default setting for 'non-stop'.
16 years ago
yexo bc8f31da4e (svn r16174) -Fix (r16093) [FS#2863]: crash when starting a game/loading a game with no AIs available. 16 years ago
yexo d63f01d78b (svn r16172) -Fix (r16171): typo (thanks SmatZ) 16 years ago
yexo 3578f4408c (svn r16171) -Add [NoAI]: two new error codes to AITile: ERR_AREA_ALREADY_FLAT and ERR_ESCAVATION_WOULD_DAMAGE. 16 years ago
frosch e04ddbe0ac (svn r16166) -Add [NoAI]: AITile::Get(Min|Max|Corner)Height 16 years ago
yexo 9101de49d8 (svn r16165) -Add [FS#2801] [NoAI]: several functions to AIOrder to check the what kind of order an order is.
-Fix: AIOrder::GetOrderDestination and AIOrder::GetOrderFlags didn't work on ORDER_CURRENT when the vehicle was loading/leaving in a station.
16 years ago
rubidium 7dd677ced2 (svn r16162) -Codechange: remove needless TC_ colours from DrawString when they are part of strings and add some colours to a few strings. 16 years ago
rubidium 53887e07bb (svn r16160) -Codechange: remove the need for explicit TC_FROMSTRING for DrawString. 16 years ago
yexo f0bc464b18 (svn r16158) -Codechange: fix the string alignment in all .hpp.sq files 16 years ago
yexo 660f90d37b (svn r16151) -Codechange: move some includes around to prevent including half the AI api in non-noai related code. 16 years ago
yexo 486e5b4bfe (svn r16150) -Fix [NoAI]: Change WAYPOINT_INVALID to 0xFFFF from -1 as that's the value the AIs got (due to casting).
Clarify some api documentation.
16 years ago
rubidium d8bc98d5de (svn r16149) -Fix [FS#2860]: when there's no AI and an AI is started... *boom* 16 years ago
rubidium 59d45a04d6 (svn r16118) -Change/cleanup: remove the hexadecimal 'in TTD the string had this ID' from 'some' strings and replace the string name with something more sensible. 16 years ago
rubidium 2ec09d95a1 (svn r16114) -Cleanup: unify some more strings and remove some more unused strings 16 years ago
yexo 3949050714 (svn r16113) -Feature [NoAI]: Add UseAsRandomAI as function in info.nut. When an AI returns false, it'll never be chosen as random AI. 16 years ago
yexo 10c98f7e0e (svn r16109) -Fix [NoAI]: Make sure AIOrder::GetDestination always returns a tile belonging to the station 16 years ago
yexo 63db874050 (svn r16108) -Fix [NoAI]: When giving an aircraft a goto-hangar order don't let it be a normal goto-station order.
Note to AI writers: AIOrder.AppendOrder(vehicle_id, AIStation.GetLocation(station_id)) will give a goto-hangar order for helistations (assuming the station sign is at it's default location).
16 years ago
yexo 61d883e7e5 (svn r16107) -Add [NoAI]: AIOF_STOP_IN_DEPOT to the orderflags in AIOrder to allow stop-in-depot orders 16 years ago
yexo a664a2668c (svn r16106) -Fix [NoAI]: AIOrder::SetOrderFlags always removed "Service if needed" from goto-depot orders. 16 years ago
frosch 90ebf211dc (svn r16094) -Fix: AIDebug window profiled the blitters by invalidating itself unconditionally on repaint. OTOH it was not invalidated in other cases when needed. 16 years ago
yexo a91ff2d5e8 (svn r16093) -Feature [FS#2808]: Add GetURL() as possible function to info.nut. If AIs implement it, that url is shown when the AI crashes and also in the AI selection window. 16 years ago
yexo 3e2e5b097c (svn r16091) -Change [FS#2778]: Reverse the order of the lines in the AI debug window 16 years ago
frosch eb7414ea9e (svn r16062) -Fix (r16037): AIOrder::InsertOrder was broken. Default all AI orders to 'stop at far end'. 16 years ago
rubidium bee930f9b3 (svn r16024) -Codechange: harden string copying on places where it's possible 16 years ago
yexo 57dab45e75 (svn r15910) -Fix [FS#2777]: Clarify that TILE_INVALID is part of AIMap make doxygen output some documentation for it. 16 years ago
frosch f55be81e3c (svn r15901) -Add: AIIndustryType::IsBuiltOnWater(), HasHeliport() and HasDock(). Just like AIIndustry. 16 years ago
alberth 9d2738b9c4 (svn r15885) -Codechange: Removed new_size parameter of Window::OnResize() callback 16 years ago
yexo 50a6e589ed (svn r15881) -Fix (r15875): add an explicit cast so some compilers stop complaining. 16 years ago
yexo 400208ee0a (svn r15875) -Add: AIBridge::GetBridgeID() so AIs can get the type of bridge that are already build. 16 years ago
frosch 44351cdc57 (svn r15860) -Add: AIRoad::GetRoadVehicleTypeForCargo() to tell whether a certain cargo needs a bus- or a truckstop. 16 years ago
frosch 19b47c1e89 (svn r15859) -Documentation: Meaning of AICargo::CC_PASSENGERS wrt. bus- and truckstops, and meaning of AICargo::IsFreight() wrt. freight train weight multiplier. 16 years ago
yexo 809e4f398c (svn r15852) -Codechange: New widgets for the AI windows. 16 years ago
rubidium 3e93f8adda (svn r15844) -Codechange: allow text alignment to be forced so the console and ai debug output don't get swapped (those are untranslateable anyways) 16 years ago
yexo 84fb615344 (svn r15835) -Codechange: Prevent using the return value of DrawString as much as possible. 16 years ago
rubidium 22d4270ea8 (svn r15811) -Fix: left != right and as a result of that the ai debug window was kinda empty. 16 years ago
rubidium ead0a6a6e5 (svn r15806) -Codechange: pass both left and right to the vehicle details drawing functions instead of only the left. 16 years ago
rubidium d837fc4d03 (svn r15797) -Codechange: make users of the old DrawStringMultiLine use the new one. 16 years ago
frosch d452a0a0ec (svn r15789) -Codechange: Add DiagdirBetweenTiles() and use it. 16 years ago
rubidium 45f189fdca (svn r15785) -Codechange: remove the *Truncated part of the old text drawing API. 16 years ago
yexo 971ed8d2a3 (svn r15781) -Fix [NoAI]: Missing "AIs" in the information the debug AI prints. 16 years ago
yexo d2dae07595 (svn r15774) -Fix (r15708): Don't show the message about reporting an AI crash for the dummy AI. 16 years ago
frosch 6dd04a9a78 (svn r15763) -Codechange/Fix: Add Engine::GetDisplayDefaultCapacity() and use it everywhere, so CB 36 is also used everywhere. 16 years ago
yexo 384599ef2c (svn r15743) -Codechange: move the definitions of some fake squirrel types to their own file. 16 years ago
yexo b078f8095a (svn r15742) -Fix (r15736): AIs with an invalid info.nut weren't ignored anymore. 16 years ago
yexo ce4744e1d6 (svn r15736) -Codechange: Split AIScanner/AIFileInfo to the more generic classes ScriptScanner/ScriptFileInfo. 16 years ago
rubidium f9def73be6 (svn r15723) -Codechange: use a constructor for WindowDescs as that makes expanding them much easier (Alberth) 16 years ago
rubidium 8761a5a4c4 (svn r15721) -Change: give a more useful (for 'normal' users) error message when there's no AI and they want to play with an AI 16 years ago
rubidium b25a4f8231 (svn r15718) -Cleanup: apply some comment coding style on the rest of the sources too 16 years ago
yexo 86a9df82b7 (svn r15716) -Change [NoAI]: AI libraries should now be stored in ai/library/<library_name>/ instead of ai/library/<category_name>/<library_name>/. Libraries inside tar files are not affected. 16 years ago
rubidium 9d018723b7 (svn r15711) -Codechange: lots of whitespace cleanup/fixes 16 years ago
yexo 2e6e2457f1 (svn r15708) -Feature [FS#2728]: Pop up the AI Debug Window if one of the AIs crashed and show a message that the user should report the crash. 16 years ago
frosch fa35dc10e5 (svn r15705) -Fix: Do not show passenger-/mail-capacity if the aircraft carries only cargo. 16 years ago
yexo cef662825b (svn r15684) -Add [NoAI]: AIOrder::SkipToOrder(). 16 years ago
yexo 13fb01d07d (svn r15668) -Fix: a few typos. 16 years ago
yexo 1ff06b3f9c (svn r15658) -Fix [NoAI]: Rewrite AIAbstractList::Valuate to make it more readable and fix a crash if no parameters are given to that function. 16 years ago
truebrain 3ca01c64f7 (svn r15638) -Fix: there is a time in your life you should stop coding for a project. You know that time is there when you make two huge mistakes in just 10 lines of code. I wish you all the best of luck :) (ps: HUGE mistakes!) 16 years ago
yexo 3633fd9a06 (svn r15630) -Fix (r15027): Make sure OpenTTD loads the dummy AI script when no other AI is available instead of a non-existing file. 16 years ago
yexo 890c5e3ae4 (svn r15616) -Change [API CHANGE]: Rename AIOrder::ChangeOrder() to AIOrder::SetOrderFlags(). 16 years ago
yexo ffe2caf20f (svn r15614) -Add [NoAI]: AIVehicleList_Group(group_id) and AIVehicleList_DefaultGroup(vehicle_type). 16 years ago
yexo a41b143e58 (svn r15587) -Fix (r15345): I should really test even those simple api functions better. 16 years ago
yexo 932b1c24b2 (svn r15563) -Change [API CHANGE]: Remove AIIndustry::GetMaxIndustryID(). 16 years ago
yexo 1884ba20bc (svn r15562) -Change: Use GetName() to determine the unique AI name instead of GetInstanceName() to make branching of AIs easier. 16 years ago
yexo cabfe35e54 (svn r15558) -Cleanup: Remove some unnecessary friend declarations. 16 years ago
frosch d3850e101c (svn r15541) -Revert (r15399): 'v->cargo_type' is also used in other places, which cannot accept CT_INVALID.
-Codechange: Add Engine::GetDefaultCargoType() and Engine::CanCarryCargo() and use them.
-Fix [FS#2617]: When articulated parts have no available default cargo, use the cargo type of the first part for livery selection.
-Change: To decide whether a vehicle is refittable do not test its current capacity for being zero, but always use the 'capacity property'.
  Note: The property is used unmodifed without calling CB 15/36. By setting it to a non-zero value and returning zero in the callback vehicles can be refitted to/from zero capacity for e.g. livery effects.
  Note: It is intentional that you cannot control refittability by CB 36.
16 years ago
yexo c3c549f731 (svn r15538) -Fix (r15334): The difficulty level wasn't set to custom when changing the amount of towns/industries from the newgame gui. 16 years ago
glx ab3fc1d437 (svn r15535) -Fix (r15460, pre noai merge): use '.' as 'any' for squirrel calls typechecking as stated in squirrel docs 16 years ago
yexo 07a37af14c (svn r15530) -Fix (r15519): The AIWaypoint classes were not exported to squirrel. 16 years ago
yexo a54061f840 (svn r15527) -Fix (r15526): A ')' too much. 16 years ago
yexo b3fe664d90 (svn r15526) -Add [NoAI]: Support for conditional orders. 16 years ago
yexo 3491b0fab9 (svn r15524) -Add [NoAI]: AIEngine::GetPower, AIEngine::GetWeight and AIEngine::GetMaxTractiveEffort. 16 years ago
yexo 459a855e60 (svn r15520) -Cleanup [NoAI]: Fix some typos, unify the comment style and update some documentation since a few enums have been renamed. 16 years ago
yexo c0e7ddeb9e (svn r15519) -Add [NoAI]: support for waypoints by adding AIRail::Build/Remove RailWaypoint, AIWaypoint and AIWaypointList. 16 years ago
yexo a0b57c849e (svn r15494) -Change [API CHANGE]: Split AIRoad::BuildRoadStation in BuildRoadStation and BuildDriveThroughRoadStation. 16 years ago
yexo 2b221f5afc (svn r15492) -Change [API CHANGE]: Split AIVehicle::MoveWagon in MoveWagon and MoveWagonChain (frosch). 16 years ago
yexo 336abd66a2 (svn r15491) -Change [API CHANGE]: AIMarine::BuildWaterDepot now accepts a front tile instead of a bool is_vertical (frosch). 16 years ago
yexo 7d88077add (svn r15490) -Change [API CHANGE]: Remove AIBridge::GetYearAvailable. AIBridge::IsValidBridge now only returns true for available bridges. 16 years ago
yexo 16954ba378 (svn r15489) -Change [API CHANGE]: Remove AIAirport::AirportAvailable. AIAirport::IsValidAirportType now only returns true for available AirportTypes. 16 years ago
yexo bce1bcb0f2 (svn r15488) -Change [API CHANGE]: Add support for distant-join stations. 16 years ago
yexo 5a5bc8ab52 (svn r15487) -Change [API CHANGE]: Remove the never implemented function AIEventVehicleCrashed::CloneCrashedVehicle. 16 years ago
yexo 8ceb92e699 (svn r15486) -Change [API CHANGE]: Remove AITown::GetMaxTownID. 16 years ago
yexo cea470e687 (svn r15485) -Change [API CHANGE]: Split AIIndustry::HasHeliportAndDock and GetHeliportAndDockLocation in HasHeliport/HasDock and GetHeliportLocation/GetDockLocation. 16 years ago
yexo 58359b8d6e (svn r15484) -Change [API CHANGE]: Remove AICompany::GetCompanyName and SetCompanyName. They've been replaced with GetName and SetName. 16 years ago
yexo 7fdde2fec0 (svn r15483) -Change [API CHANGE]: Remove AIIndustry::GetProduction, use AIIndustry::GetLastMonthProduction instead. 16 years ago
yexo 92fc2e692c (svn r15482) -Fix [NoAI]: Typos in api docs. 16 years ago
yexo 37819fc8c5 (svn r15481) -Fix [NoAI]: Make sure AIs can't call functions they shouldn't call. 16 years ago
frosch b123756c9f (svn r15479) -Fix: Documentation of AIIndustryType::CanBuildIndustry(). 16 years ago
yexo e84f25a2bd (svn r15470) -Fix [NoAI]: Check the types of the parameters passed to AddSetting, AddLabels and RegisterAI. 16 years ago
yexo 8e14d77d05 (svn r15467) -Fix [NoAI]: AIs with an error in their info.nut are no longer available in-game. 16 years ago
yexo 15b9366f06 (svn r15466) -Fix (r15330): The squirrel instance object was freed twice if an info.nut failed to compile. 16 years ago
smatz d3f018a7e3 (svn r15465) -Codechange: constify most of AIInfo/AIFileInfo methods, move definition of very simple getters to header file 16 years ago
yexo 9292c90360 (svn r15464) -Codechange [NoAI]: Call all info.nut functions exactly once and only during initialization. 16 years ago
yexo b9c66aa750 (svn r15463) -Change [API CHANGE]: Replace AIInfo::CanLoadFromVersion(version) with AIInfo::MinVersionToLoad() which should return a single integer, the minimum version the AI is able to load data from. 16 years ago
yexo 4c7106dad7 (svn r15462) -Change [NoAI]: Make AIController::GetTick() and AIController::GetSetting() static functions.
-Fix (r15460): ai_controller.hpp.sq was forgotten.
16 years ago
rubidium dea3490b2f (svn r15460) -Fix [NoAI]: don't require an instance to exist in the scope for static functions and limit exposure of the internal function GetClassName. 16 years ago
yexo 8d25202067 (svn r15441) -Cleanup: Use a return value instead of passing a pointer to where the result should be stored. 16 years ago
yexo 1eeb0f6748 (svn r15440) -Fix: Backup AIObject::GetAllowDoCommand and restore the old value so AIs can't work around it. 16 years ago
peter1138 ad30a3c4ca (svn r15436) -Codechange: Return index of station spec within station class as a return parameter of GetCustomStationSpecByGrf(), as the index is already known. Saves on an extra loop and an extern... 16 years ago
rubidium c0a8d09ca7 (svn r15428) -Codechange: consistently use colour instead of having both color and colour. 16 years ago
rubidium 8dae160d0f (svn r15425) -Codechange: some color->colour changes and type safety. 16 years ago
rubidium 377ce6c5bf (svn r15410) -Cleanup: get rid of most of the references to the 'patches' except where it's used for backward compatability. 16 years ago
Yexo 5bcdcdd1d1 (svn r15408) -Fix (r15027): AIs could call AIController::Sleep() at times they're not allowed to sleep. 16 years ago
rubidium e1b1fd18b5 (svn r15406) -Fix: make Valuate actually cost a few opcodes to not make it a single opcode method of doing lots of the same thing. This should resolve most of the hiccups caused by AIs. 16 years ago
smatz 9c59b711b7 (svn r15401) -Fix [FS#2619](r15027): AI::Stop changed _current_company, but didn't restore its original value 16 years ago
frosch 4e8707b93f (svn r15400) -Fix: Typos in comments. 16 years ago
rubidium 6252c74584 (svn r15368) -Fix: some typos in comments 16 years ago
Yexo cb3784d8b1 (svn r15366) -Add [NoAI]: Add AddLabels() where you can define labels for the values of the settings in info.nut 16 years ago
frosch 324e92f879 (svn r15360) -Fix: Flooding vehicles did not trigger an AI event. 16 years ago
frosch cb049e4e58 (svn r15359) -Add [NoAI]: AIEventVehicleCrashed::CRASH_RV_UFO, AIEventDisasterZeppelinerCrashed and AIEventDisasterZeppelinerCleared as aliens accepted NoAIs as competing life-form. 16 years ago
frosch 7f198507f7 (svn r15358) -Add [NoAI]: AIEventVehicleCrashed::GetCrashReason() 16 years ago
rubidium 8fb4962407 (svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again. 16 years ago
Yexo f2907d816f (svn r15346) -Add [NoAI]: Add AIAirport::GetNearestTown() so AIs can known in which town the noise level will increase. 16 years ago
Yexo 62a11eb5a9 (svn r15345) -Add [NoAI]: Add AIVehicle::HasSharedOrders() and AIVehicleList_SharedOrders. 16 years ago
Yexo b321130d9a (svn r15343) -Add [NoAI]: Add AITown::GetRoadLayout so AIs can get the road layout per town. 16 years ago
rubidium 1c30c8c801 (svn r15330) -Fix [FS#2597]: leaking of Squirrel when using circular references (by enabling the GC). 16 years ago
Yexo 101f55e65c (svn r15328) -Fix (r15327): Load(data, version) was called instead of Load(version, data). 16 years ago
Yexo 1892c34ac6 (svn r15327) -Fix (r15027): AIs could access the map and other data in their constructor and Load() function while the savegame was not completely loaded. 16 years ago
smatz 5ad1cd32b2 (svn r15324) -Codechange: unify the class used for comparing of strings for std::map 16 years ago
Yexo a5807f4a77 (svn r15322) -Fix (r15175): The AI list window didn't display information about the selected AI if it wasn't visible. 16 years ago
frosch de9a6fc90b (svn r15308) -Codechange: Deduplicate km-ish/h -> mph conversions. 16 years ago
frosch 317220c2e4 (svn r15307) -Fix: AIVehicle::GetCurrentSpeed() should also use km-ish/h instead of mph. (Documentation by Rubidium) 16 years ago
frosch c28c4c1986 (svn r15306) -Codechange: Deduplicate code by adding Engine::GetDisplayMaxSpeed(), GetPower() and GetDisplayWeight(). (and using them) 16 years ago
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 16 years ago
Yexo ea01534e6d (svn r15284) -Fix [FS#2582] (r15045): Parameters were popped from the squirrel stack twice. 16 years ago
smatz 659989af45 (svn r15278) -Fix [FS#2332]: test noise limit of nearest town instead of st->town 16 years ago
Yexo 7f9c91901e (svn r15277) -Fix (r15027): Building bridges in AITestMode always returned false. 16 years ago
glx 062f32a186 (svn r15270) -Change [API CHANGE]: remove AIEventTest 16 years ago
glx c1cf3934fa (svn r15263) -Codechange: added Engine::GetCost() to remove some code duplication. 16 years ago
frosch 80ee3d3440 (svn r15262) -Fix: AIEvents were not freed, when they were not queued for any AI. 16 years ago
glx e8b5f49861 (svn r15261) -Add: added Engine::GetRunningCost() to remove some code duplication. Also stops AIs decrementing vehicle counter of first company 16 years ago
frosch 47cdbe4a20 (svn r15255) -Fix (r15027): AIVehicle::GetLength() returned only the length of the first part of articulated road vehicles. 16 years ago
frosch 7e6049ba02 (svn r15252) -Fix (r15027): AIMarine::AreWaterTilesConnected() reported aqueducts being connected with all surrounding tiles. Also add some type safety. 16 years ago
frosch d05ab5a531 (svn r15244) -Fix (r15027): The station tile of an oilrig-like industry is not neccessarily the first industry tile. 16 years ago
frosch a1d4b792e8 (svn r15241) -Fix (r15027): NoAI API was not aware of certain newindustries 'features'. 16 years ago
glx 4fe58bc303 (svn r15228) -Fix [FS#2571]: possible crash when an AI/Library doesn't have a required function 16 years ago
glx ceb60b426e (svn r15226) -Fix (r15214): broken AI content download 16 years ago
rubidium 83e1288c6a (svn r15215) -Fix: various MSVC x64 compiler warnings 16 years ago
glx 92f5c6b1da (svn r15214) -Fix [NoAI]: ignore case for ai/library main script path on windows 16 years ago
glx b44390bf39 (svn r15191) -Fix (r15188): -1 is not a bool (MSVC warning) 16 years ago
Yexo db3ee34b44 (svn r15190) -Feature: Allow terraforming of the tiles at the edges of the map. 16 years ago
Yexo ddcaf2f4cc (svn r15188) -Feature: You can now change the number of AIs from the AI config window. 16 years ago