It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra

Actually, I think the only useful for you could be ET_AIRCRAFT_DEST_TOO_FAR, to check bad behaviour, the others are only for AI/GS that can manage interactive stuff...

BTW, your AI works pretty well when starting from early eras (tested so far from 1700), but when it gets enough money it starts buying every competitor thats goes bankrupcy, taking over more and more useless stations around the map, making the game very ugly. Also it builds a ship depot for every sea route, wich leads to blockades in small water areas, and then I am forced to restart the AI to clean the messing...

Actually, I think the only useful for you could be ET_AIRCRAFT_DEST_TOO_FAR, to check bad behaviour, the others are only for AI/GS that can manage interactive stuff...

Thanks, I'll look into "ET_AIRCRAFT_DEST_TOO_FAR" to see what can I do with that. The reason for deleting "dont call me" line was because I dont want to handle every AIEvent brodcasted.

HGus wrote:
BTW, your AI works pretty well when starting from early eras (tested so far from 1700), but when it gets enough money it starts buying every competitor thats goes bankrupcy, taking over more and more useless stations around the map, making the game very ugly. Also it builds a ship depot for every sea route, wich leads to blockades in small water areas, and then I am forced to restart the AI to clean the messing...

Thanks, noted for the later-than-sooner version

xarick wrote:Trans crashes with Modulo by Zero error when trying to place an HQ while being Company #1 (0 in code).

if (counter % My.ID != 0) continue;

Thanks, fixed.

xarick wrote:crashed: it took too long to save, while testing only ships for 100 years.

Bump.....
Version 180411 is available on BaBaNaNaS, as well as on first post.

* 180411
Fixes: Not connecting air route with infrastructure maintenance setting activated. Thanks Steffl
Fixes: crashes with Modulo by Zero error when trying to place an HQ while being Company #1 (0 in code). Thanks xarick
Fixes: Crashed due to return value of a function is neither bool nor integer, when being used as Valuator. Thanks xarick
Fixes: AI forced to be stopped due to it took too long to save. Thanks xarick

Bump for the new version. We are now at 180506. Trans is available on BaNaNaS, as well as on first post.
Now, the the ships has buoys in their route. And I re-introduce the rail service. But now only build one train, on one rail.
Let see the changelog.

* 180506
General: Moving repository to git and uses GitHub as issue tracker
Bundling: Now using PowerShell script to bundling package for Bananas
CodeChange: General Pathfinder Optimization
CodeChange: General code CleanUp
Codechange:[Load/Save]:Refactoring service route table
Codechange: Optimize water pathfinder for buoys
Feature: Trans.Rail is back online (alpha stage). Right now we only support for running one train
Feature: Trans.Water now can build buoys
Feature: Closing route if it was not producing/accepting anymore
Feature: If infrastructure maintenance activated in game, we would close the aircraft route
Feature: [Debug] Add option to "break" in game
Feature: [Debug] Make a distinct between build sign for path finding and other sign
Fixes:[Save] max. 25 levels deep
Fixes: Do not deleting station if being used by other route
Fixes:Find nearby depot should be reachable (now for Road & Water)
Fixes:Checking AITile.HasTransportType should be done on next iteration
Fixes: Build depot for water now inline
Fixes: Put a limit distance to find a depot

We are at 180622. Check it out at Bananas or first post
Introducing some features and fixes some bugs, here are the highlights:

Trans.Rail now could handle two train on single track
Trans.Rail will try to build the second track
Trans.Rail now could handle more train on double track
Trans.Rail Uses Dual line Terminus station
Continue building current train route if loaded from a save game

Fixes:[PF] Rail PT cannot detect existing bridge/tunnel
Fixes: GetReplacement() should build a replacement vehicle
Fixes: Save the route built state
Fixes: Don't build station entry if not built station
Fixes: Re-order priority for closing route and adding vehicle
Fixes: Don't crash if got an invalid industry ID
Fixes: Don't Crash if only have one depot
Fixes: Don't crash if Airport first tiles was hangar. (When uses heliport depot type airport)
Fixes: Don't go thru back of rail signal
Fixes: Crash due to no start/end point saved
Fixes: Build rail depot on the same level
Fixes: Rail not removed if depot is not built near station