This is going to be the main thread for all AI script bugs and issues
Current issues
V 100.12.4087.0
Ai is unable to build trading post on railroad sites(native sites are working)
In TAD the ai was unable to upgrade to ironHorse for trading post (stageCoach worked) so this could still be an issue for DE.
If kbSetPlayerHandicap(cMyID, value) is updated it can cause an OOS. If the client changes the aiMain file and adds a function that updates the kbSetPlayerHandicap that will also cause an OOS. This has the potential to allow players to cause OOS when losing a game.
New AI functions needed
kbUnitGetWorkersCountIfSeeable(int resourceID)
Returns the count of settlers currently working on a mine, a tree or whatever, but ONLY if those settlers are seen by the current player context. (I did not want the AI to cheat and know if there were settlers on something while the AI isn’t supposed to see them.
kbUnitGetInventoryCapacity(int unitID, int resourceID)
Returns the max resource capacity of a unit.
kbUnitGetCurrentInventory(int unitID, int resourceID)
Returns the current resource capacity of a unit.
int kbUnitGetNumberTargeters(int unitID)
Returns the number of units that is tasked to a resource
kbUnitGetNumberWorkersIfSeeable(int resourceID)
Returns the number of units the AI sees on a resource
aiTaskUnitRepair(int unitID)
Repairs a unit if repairable
aiTaskUnitRepairAvailability(int unitID)
Is the repair option available
aiTaskUnitEject(int unitID)
Ejects all units from a unit
kbIsNomad()
Is the game a nomad game
kbIsFFA()
Is the game a FFA
kbIsKOTH( void )
Is the game King of the hill
kbVPSiteGetRouteID(int socketID)
Returns the ID of the trade route (when there is more than 1).
kbUnitGetNumberContained( int unitID )
Returns the number of units inside a unit
unitMaxGatherers(int unitID)
Returns the max amount of gatherers from a unit (e.g livestock pen)
unitCurrentGatherers(int unitID)
Returns the current amount of gatherers from a unit
unitSpecialAttack(int unitID ,int unitID, int specialType)
Units that have a special attack (like ships) allow them to use them.