Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
If so, then yes, it can be done.
Not only with UA, but any other mod.
1] First run the game in -dev mode.
2] Then, press "CTRL"+"SHIFT"+"~" (all 3 button appear at the far left of your keyboard). This will bring up the console.
3] Then, type: Cpu_ControlLocalPlayer()
This can be put into an autoexec, and called with the stroke of a button, but this will require some more work...
THE LONG ANSWER (here it gets technical)
Here is my autoexec.lua, for example:
-------------------------------------------------------------------------
screenmode = 0
function SS_ToggleModifierEvents (state)
t_ModifierList = { "builder_idle_event", "negative_cover_event_modifier", "cover_event_modifier", "morale_break_event" }
local j = World_GetPlayerCount()
for i = 1, j do
local player = World_GetPlayerAt (i-1)
for x = 1, table.getn (t_ModifierList) do
Modifier_Player_FX_Enable (player, t_ModifierList[x], state)
end
end
end
function toggle_screenmode ()
if (screenmode == 0) then
screenmode = 1
taskbar_hide ()
message_hide ()
if (ingame_stats_toggle ~= nil) then
ingame_stats_mouseover_toggle (false)
ingame_stats_toggle (false)
ingame_select_ui_toggle (false)
SS_ToggleModifierEvents (false)
end
else
screenmode = 0
taskbar_show ()
message_show ()
if (ingame_stats_toggle ~= nil) then
ingame_stats_mouseover_toggle (true)
ingame_stats_toggle (true)
ingame_select_ui_toggle (true)
SS_ToggleModifierEvents (true)
end
end
end
bind("shift+tab", "toggle_screenmode()")
bind("shift+F1","setsimrate(4)")
bind("shift+F2","setsimrate(8)")
bind("shift+F3","setsimrate(30)")
bind("shift+F4","setsimrate(100)")
bind("F5","switch_player_control()")
bind("F7","disableai()")
bind("F8","enableai()")
bind("F9","toggle_FOW()")
fowmode = 0
function toggle_FOW()
if fowmode == 0 then
FOW_RevealAll()
fowmode = 1
else
FOW_Reset()
fowmode = 0
end
end
function switch_player_control()
local player = World_GetPlayerAt(Tut_GetLocalPlayerIndex())
if Cpu_IsCpuPlayer(player) then
run = W40k_SwitchToPlayer( player, true )
else
run = Cpu_ControlLocalPlayer();
end
end
function disableai()
run = Cpu_EnableAll(false);
end
function enableai()
run = Cpu_EnableAll(true);
end
----------------------------------------------------------------------
You may find it complex, as I have coded some more goodies for my testings.
But if you copy it to notepad and save it under the name autoexec.lua (AND NOT AS A .TXT FILE), and then put it in to your SS folder and run the game in -dev,...
Everything will be automated.
Just try in-game to press the key binds:
bind("shift+F1","setsimrate(4)")
bind("shift+F2","setsimrate(8)")
bind("shift+F3","setsimrate(30)")
bind("shift+F4","setsimrate(100)")
bind("F5","switch_player_control()")
bind("F7","disableai()")
bind("F8","enableai()")
bind("F9","toggle_FOW()")
... and see what happens. :)
P.S.: Confusing, I know. If discouraged, just use my first suggestion with Cpu_ControlLocalPlayer(), and you will be OK.
The above technique will work for EVERY mod, as well as the vanilla game - not only for UA :)
The reason for the AI of the 1st player performing badly, is that on game initialisation, the AI follows a SPECIFIC set of orders.
I can explain more if you want.
So when you use the above method ans have the AI play the local player, it does NOT happen on game initialisation so the AI does NOT follow that specific set of instructions.
There is no way to avoid this - I could code something in SCaR, so that to have the CPU get the AI control FROM SCRATCH, but I am not sure it will work.
Fast solution:
Before handling over the control to the CPU, start building a structure, have some more builders in cue, and definitely get some initial capturing squads. Will take just 2 minutes. Then, give the control to the CPU.
Last but not least, see here for an updated version of the code above:
https://forums.revora.net/topic/110329-playtesting-tips-and-tools/
Hi Gambit, I found exactly the same problem as fellow Cebi, AI on my player1 slot is always being crushed by the enemy and it plays way worse than actual other AI's and I ended up with this topic while searching all internet with this rare problem. A lot of time has passed, is there any update on this? It makes it difficult to test and find balance with mods and races when 1 AI is playing differently. Appreciate your efforts! Sorry for necro as I find this is only topic on across internet regarding this issue
Last... In higher difficulties... The AI gets INCREASED resource income rates.
This is not difficult to address, but it needs a bit more coding and at the moment my hands are full!
No Problem. Can you give me feedback about it? Because I have a majorly modded Version of the Tyranid Mod as a baseline that I created myself. Custom Maps, new AI, some new texture and effects, I made armies more versitile and bigger, added models from other mods. If it works for you I can tell its not because of my mods that this works.
Its not a public mod. I just use it for myself. I would also need permission from some folks to make it releasable. Its just larger battles on large only maps. If you get Unification Mod or Ultimate Apocalypse they are quite close. But I kept the T4 Tree Mechanic and remained closer to the original game and its tabletop baseline idea.
And then in game use function to switch to AI from Autoexec.lua file functions. This is the script I use (press F5 to activate):
run = Cpu_ControlLocalPlayer()
run = setsimrate(35)
bind("F1","setsimrate(2)")
bind("F2","setsimrate(20)")
bind("F3","setsimrate(35)")
bind("F4","setsimrate(300)")
bind("F6","setsimrate(900)")
-- debug key bindings for scar profiler and scar watcher --
-- bind scar watcher --
-- show/hide the watcher. automatically adds the showall filter for you.
toggle_scar_watcher = "LCWatcher_SelectState('SCAR'); LCWatcher_AddFilter('SCAR',''); LCWatcher_Activate(not LCWatcher_IsActive());";
-- use this to quickly add/remove the showall filter
toggle_all_vars = "if LCWatcher_FilterExists('SCAR', '') then LCWatcher_RemoveFilter('SCAR','') else LCWatcher_AddFilter('SCAR','') end";
bind("Shift+W", toggle_scar_watcher);
bind("Shift+A", toggle_all_vars);
-- bind scar profiler --
toggle_scar_profiler = "RulesProfiler_Activate(not RulesProfiler_IsActive())";
bind("Shift+P", toggle_scar_profiler);
-- nislet debug bindings --
bind("Shift+U", [[Scar_DoString("W40k_UnlockInputOnLetterBox()")]] );
bind("shift+F7", "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
bind("shift+F8","toggle_FOW()")
fowmode = 0
function toggle_FOW()
if fowmode == 0 then
FOW_RevealAll()
fowmode = 1
else
FOW_Reset()
fowmode = 0
end
end
bind("F5","switch_player_control()")
function switch_player_control()
local player = World_GetPlayerAt(Tut_GetLocalPlayerIndex())
if Cpu_IsCpuPlayer(player) then
run = W40k_SwitchToPlayer( player, true )
else
run = Cpu_ControlLocalPlayer();
run = Cpu_SetDifficultyForDummies(World_GetPlayerAt(Tut_GetLocalPlayerIndex()), 3);
end
end
I didnt know others were not using this. I found out that AI behaves weirdly, when you activate this after the battle has already started. I know this since like 2018, its such a shame I didnt answer earlier on this, because I always come back to this thread, whenever I get back into DoW Modding. I use this also to fix the broken tyranid AI from an earlier version of the mod.