Firstly, create a text file in the root of your \<Dark Crusade folder> or \<Soul Storm folder> and call it:
autoexec.lua
In this autoexec.lua put this into it and save it:
run = Cpu_ControlLocalPlayer()
run = setsimrate(35)
run = fog_toggle()
run = FOW_RevealAll()
bind("F1","setsimrate(5)")
bind("F2","setsimrate(12)")
bind("F3","setsimrate(20)")
bind("F4","setsimrate(30)")
bind("F5","test()")
bind("F6","test1()")
function test()
local count=World_GetPlayerCount()
g_Player1=World_GetPlayerAt(0);
if count>1 then
g_Player2=World_GetPlayerAt(1);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player2,0);
end
if count>2 then
g_Player3=World_GetPlayerAt(2);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player3,0);
end
if count>3 then
g_Player4=World_GetPlayerAt(3);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player4,0);
end
if count>4 then
g_Player5=World_GetPlayerAt(4);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player5,0);
end
if count>5 then
g_Player6=World_GetPlayerAt(5);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player6,0);
end
if count>6 then
g_Player7=World_GetPlayerAt(6);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player7,0);
end
if count>7 then
g_Player8=World_GetPlayerAt(7);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player8,0);
end
Player_SetResource(g_Player1,RT_Requisition,9999);
Player_SetResource(g_Player1,RT_Power,9999);
end
function test1()
local count=World_GetPlayerCount()
g_Player1=World_GetPlayerAt(0);
if count>1 then
g_Player2=World_GetPlayerAt(1);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player2,0);
end
if count>2 then
g_Player3=World_GetPlayerAt(2);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player3,0);
end
if count>3 then
g_Player4=World_GetPlayerAt(3);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player4,0);
end
if count>4 then
g_Player5=World_GetPlayerAt(4);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player5,0);
end
if count>5 then
g_Player6=World_GetPlayerAt(5);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player6,0);
end
if count>6 then
g_Player7=World_GetPlayerAt(6);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player7,0);
end
if count>7 then
g_Player8=World_GetPlayerAt(7);
World_EnablePlayerToPlayerFOW(g_Player1,g_Player8,0);
end
Player_SetResource(g_Player2,RT_Requisition,9999);
Player_SetResource(g_Player2,RT_Power,9999);
Player_SetResource(g_Player3,RT_Requisition,9999);
Player_SetResource(g_Player3,RT_Power,9999);
Player_SetResource(g_Player4,RT_Requisition,9999);
Player_SetResource(g_Player4,RT_Power,9999);
end
bind("shift+tab", "toggle_screenmode()")
screenmode = 0
function toggle_screenmode()
if screenmode == 0 then
taskbar_hide()
message_hide()
ingame_select_ui_toggle()
ingame_stats_toggle()
screenmode = 1
else
taskbar_show()
message_show()
ingame_select_ui_toggle()
ingame_stats_toggle()
screenmode = 0
end
end
So now an explaination of the above:
run = Cpu_ControlLocalPlayer()
Sets Player0, usually reserved for the human, as the AI
run = setsimrate(35)
Automatically sets game speed in super-turbo mode.. set that # to anything higher if you wish. You can set the # as high as you want but it depends on your CPU, Mobo, and Ram speed. Otherwise, it could crash the game.
run = FOW_RevealAll()
Disabled FogOfWar immediately so the entire map is revealed!
bind("F1","setsimrate(5)")
bind("F2","setsimrate(12)")
bind("F3","setsimrate(20)")
bind("F4","setsimrate(30)")
bind("F5","test()")
bind("F6","test1()")
For above.. assigns F1-F4 for various game speeds as seen with "run = setsimrate(35)" from above.
F5 gives Player0 (now assigned for AI) 99999 req and 99999 power.
F6 does the same as F5 but for Player1.
Shift+Tab keys are now assigned so you can easily take good screenshots without the UI or other annoying on-screen annoyances. Its a toggle so use Shift+Tab to switch between and back modes.
Now, Secondly..
Edit your DarkCrusade or Soulstorm desktop shortcut or which ever one you plan to do AI testing for (you can also do this for the Dawn of Skirmish AI one as well) and change the TARGET LOCATION of where it launches from and add: -dev as part of the target in the shortcut. This will set the game into "developer mode". This is the ONLY way for the autoexec.lua to become active as it cannot be active during a normal game as it would de-synch online play.
BONUS - Excellent customized DoW Camera settings (which allow for some better zoom in and outs)
Make a text file in \<Dark Crusade folder>\Engine\Data folder or or \<Soul Storm folder>\Engine\Data folder and call it: camera_high.lua
Now copy the following text into it and, once done, run the game to enjoy better camera functionality:
-- General camera parameters
FieldOfView = 60.000000
ClipNear = 0.1
ClipFar = 9600
TerrainClip = 1.0
-- Interpolation in camera motion and camera snapping
--
-- Rate = rate to interpolate
-- Base = base to perform interpolation in (2.71828 for linear, must be >1)
-- Threshold = threshold to start performing interpolation
--
-- Controls pan speed
SlideTargetRate = 4
SlideTargetBase = 2
--SlideTargetThreshold = 1
-- Controls zoom speed
SlideDistRate = 2
SlideDistBase = 5
--SlideDistThreshold = 1
-- Controls orbit speed
SlideOrbitRate = 10
SlideOrbitBase = 1.01
--SlideOrbitThreshold = 1
-- Controls declination speed
SlideDeclRate = 4
SlideDeclBase = 1.01
--SlideDeclThreshold = 1
-- Controls the speed of the zoom with the double button press
DistRateMouse = 0.50
-- Controls the speed of the zoom on the wheel
DistRateWheelZoomIn = 0.7
DistRateWheelZoomOut = 1.45
-- Distance range in metres
DistMin = 1.0
DistMax = 78.0
-- Declination speed
DeclRateMouse = -5
-- Declination range : angle range you can look at a target
DeclMin = 0.0
DeclMax = 80.0
-- Mouse orbit speed
OrbitRateMouse = -4
-- Default camera parameters
DefaultDistance = 58
DefaultDeclination = 45
DefaultOrbit = 55
-- Minimum eye height
DistGroundHeight = 2.0
-- Pan velocity scaling
-- Panning speed at the default/min height
PanScaleMouseDefZ = 500
PanScaleKeyboardDefZ = 175
PanScaleKeyboardMinZ = 35
PanScaleScreenDefZ = 150
PanScaleScreenMinZ = 30
-- Panning acceleration
-- To turn acceleration off, use the following values:
-- PanAccelerate = 0.0
-- PanStartSpeedScalar = 1.0
PanAccelerate = 0.0
PanStartSpeedScalar = 0.5
PanMaxSpeedScalar = 1.0
-- Enable/disable declination
DeclinationEnabled = 1.0
-- Enable/disable rotation
OrbitEnabled = 1.0