Posted 01 August 2005 - 02:09 PM
There is a post about this but I cannot remember where it is.
"Enabling AI logging"
1. You have to edit the AI files in dowai/DATA/AI. You will need Notepad to do this.
2. Open up cpu_manager.ai.
3. Find "self.debug = false" and change it to "self.debug = true"
4. Save and close.
5. Open up utility.ai.
4. Find "table.insert(tracing, msg)". Add the following on the NEXT line:-
"local txt = cpu_manager.cpu_player:GetGameTime().." "..msg
ailog("c:\\"..tostring( player_id).."aitrace.txt", txt)"
5. Find "function vec2str( vec )
return ("<"..vec.x..","..vec.y..","..vec.z..">" )
end". Add the following on the NEXT line:-
"--AI log dump to text file (activate in cpu_manager.ai when self.debug = true)
function ailog( logfile, msg )
local log log = io.open( logfile , "a+" )
if player_id == nil then
log:write("AI"," ", tostring(msg) , "\n")
else
log:write("AI"..player_id," ", tostring(msg) , "\n")
end
log:close()
end"
6. Save and close.
NOTE: in step 4, if your root drive is not c:\\, change "ailog("c:\\" to whatever your root is.
The AI logs for each AI will be written to your root drive as you play.
If you want to play without your screen being full of the AI output however, skip steps 2, 3 and 4 above. I suggest you try it at least once just to see how the AI 'thinks' - as you have done some AI scripting before you might find it interesting.
Flenser