(info) Other great resources: Official JS API docs, Scripting Forum

propulsionCanReach is here!

NoQ created a patch to add a propulsionCanReach() function, and it's just been accepted!

This means we now have a complete new way to explore the map from within scripts:

  • We can work out what sort of propulsions we'll need at the start of the game – issues with hover-only and VTOL-only maps are now a thing of the past!
  • By scanning all map tiles, first to check for wheeled propulsion, then hover, we can work out where water tiles are, and also where cliffs are
  • This means that AIs can now decide what to focus on right from the start of the game

Note, however, that if you plan to scan all tiles for both land and hover access, that would be as much as 131,072 iterations on a 256x256 map! And each check is doing path finding to determine the route that propulsion would take from A to B. So be sure to do the work incrementally on a timed function call otherwise the game will lag badly. Also, remember that you could have 9 AIs doing this at the same time (or 10 if scavengers join the party), so you should ideally limit to just a few tiles at a time.