What do ya have to do to get the AI working?

I must have spent the last few hours trying to get this Keeper AI working and all I keep getting is this
stack traceback:
1: function ShipDemandGet' [C] 2: functionDetermineSpecialDemand’ at line 225 [string “”]
3: function CpuBuild_DefaultShipDemandRules' at line 371 [string ""] 4: functionCpuBuild_Process’ at line 384 [string “”]
5: function SpendMoney' at line 105 [string ""] 6: functiondoai’ at line 133 [string “”]
parameter:
stack traceback:
1: function ShipDemandGet' [C] 2: functionDetermineSpecialDemand’ at line 225 [string “”]
3: function CpuBuild_DefaultShipDemandRules' at line 371 [string ""] 4: functionCpuBuild_Process’ at line 384 [string “”]
5: function SpendMoney' at line 105 [string ""] 6: functiondoai’ at line 133 [string “”]
parameter:
stack traceback:
1: function ShipDemandGet' [C] 2: functionDetermineSpecialDemand’ at line 225 [string “”]
3: function CpuBuild_DefaultShipDemandRules' at line 371 [string ""] 4: functionCpuBuild_Process’ at line 384 [string “”]
5: function SpendMoney' at line 105 [string ""] 6: functiondoai’ at line 133 [string “”]
Now obviously its trying to get a demand for ships but the AI classdef is set up correctly, thou a few were misspelled which I later fixed and still nothing came of it. Could it be because I copied the AI Upgrades, Tech and upgrade demands directly from HWU by copy and paste?

If you look in *\ai\default\cpubuild.lua and follow the trace you’ll be able to see what the ship demand is for on that line. It’s probably scouts… are all the kScouts defined?

Line 225 for that is interceptors

Now its scout, I copied and pasted my class_def from the AI folder into the default one and it started harvesting unlike before. Now it wants scouts.

It might be looking for default research options in cpubuild.lua that are not available.

krnt had some things – out in the race/default file which I didn’t notice I enabled that and now am getting this.
stack traceback:
1: function Proc_DetermineSpecialDemand' at line 103 [string ""] 2: functionDetermineSpecialDemand’ at line 218 [string “”]
3: function CpuBuild_DefaultShipDemandRules' at line 371 [string ""] 4: functionCpuBuild_Process’ at line 384 [string “”]
5: function `SpendMoney’ at line 105 [string “”]

Good! Progress :smiley:

Just keep following the stack traces, that should be in cpubuild.lua too. I had about 10 things to tweak or fix before the ai stopped complaining and started working :wink:

1 Like

AI is now looking for platform modules but it doesn’t have them so how do you stop that check process

does anyone know what you have to do to get the AI to research with the new race scripts? I got it to build up to cap fac but its not researching or teching. And its not building modules beyond cap fac, no hyp module, no gw etc.

Subsystems now go in */scripts/races/{race}/scripts/ai_subsystems.lua

It’s essentially just copying the DoSubSystemDemand_XXXXXXXX() function and the CpuBuildSS_XXXXXXXXSubSystemDemand() function across from the old ai file

okay i got the somtaaw to build modules that they normally wouldnt like armor and weapon modules, and now im stuck because the somtaaw team wont be using production modules but need to build modules in order to research. Doesnt build anything past recons, managed to get it to build the clee-san as a research ship. And there are no traces to follow.

Make sure you’ve turned on Aitrace functionality per this thread: Help Finding/Using AI Logs

doing that causes the AI to crash when being used.

That’s odd.

That thread was created before the aug update which moved everything into the default folder

I still have it enabled on my files and it works. The file itself moved, you’re right, but the lines should still work the same.

can you post a screenshot of how urs looks? Heres mine.
image

AITRACE

Thank you for posting that seems the End was in the wrong spot X_X

http://pastebin.com/vvRFBdFQ

got this from the AI trace Dmd:Asking for AntiFrigates
**DoMilitaryBuild
Dmd:Asking for AntiFrigates
**DoMilitaryBuild
Dmd:Asking for AntiFrigates
**DoMilitaryBuild
Dmd:Asking for AntiFrigates
Somtaaw team im working on does NOT have production modules but they do have 4 types of research modules and 1 GW generator. So maybe this style is backfiring>?