Warhammer 40,000: Dawn of War - Soulstorm

Warhammer 40,000: Dawn of War - Soulstorm

92 ratings
How to have all-AI battles. Как запустить схватку только ИИ против ИИ.
By Ghost Rider
If you get tired of skirmishes or want to test your own AI mod, now you can just relax watching AI vs AI battles.
Если вы устали от схваток или хотите протестировать свой собственный ИИ мод, теперь вы можете просто расслабиться, наблюдая за битвами ИИ против ИИ.
   
Award
Favorite
Favorited
Unfavorite
autoexec.lua
First, create a text file in the root of your \Dawn of War - Soulstorm and call it:
Сначала создайте текстовый документ в корневой папке игры и назовите его:

autoexec.lua

In this autoexec.lua put this into it and save it:
В этом документе вставьте нижеследующий скрипт и сохраните документ:

run = Cpu_ControlLocalPlayer()
run = setsimrate(35)
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
Script explanation
run = Cpu_ControlLocalPlayer()
Sets Player0, usually reserved for the human, as the AI. This will allow Player0 which is normally reserved for only a human player to be fully controlled by the AI.
Команда переназначает слот Player0, зарезервированный обычно за игроком, на ИИ. Это позволяет ИИ играть вместо игрока.

run = setsimrate(35)
Automatically sets game speed in super-turbo mode (35). Set that number to anything higher or lower if you wish. You can set the number as high as you want but it depends on your CPU, Mobo, and Ram speed. Otherwise, it can crash the game.
Автоматически запускает схватку на указанной скорости (35). Вы можете установить любое другое число. Все зависит от конфигурации вашего компьютера. Игра может вылететь на рабочий стол при слишком большом числе.

run = FOW_RevealAll()
To disable Fog Of War 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()")

These commands assign F1-F4 for various game speeds as seen with "run = setsimrate(35)" from above.
Команды привязывают клавиши F1-F4 к разным скоростям игры.

F5 gives Player0 (now assigned for AI) 99999 req and 99999 power.
Позволяет дать Player0 (за которого играет ИИ) 99999 очков влияния и 99999 энергии.
F6 does the same for Player1 (AI too).
То же самое, но для Player1 (за которого тоже играет ИИ).

You can write the binds for other 6 Players using these examples.
Вы можете привязать другие клавиши для остальных 6 игроков по образцу.
-dev
Finally, edit your Soulstorm desktop shortcut or which ever one you plan to run the game with and add: -dev as part of 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.
Отредактируйте ярлык запуска игры, прописав в поле "Объект" команду -dev. Это запустит игру в режиме отладки. Это единственный способ запустить скрипт. В режиме мультиплеера скрипт не работает из-за рассинхронизации игры.

PLEASE NOTE: It's been determined that some game mods will not work properly for an AI-controlled Player0 but work for all other Player slots.
Обратите внимание, что некоторые моды могут работать неправильно для слота Player0, зарезервированного изначально за игроком, но будут работать для остальных Player слотов.
23 Comments
Alastor 26 Sep, 2024 @ 1:31pm 
if you guys dont get it, copy paste the autoexec.lua thingy into notepad and save it as "autoexec.lua" then paste it to dawn of war folder. when you set up a game press F5 before pressing start and the ai will take over and you can enjoy. btw shift+tab turns off/on HUD.
Artoria Pendragon 18 Jul, 2023 @ 6:18pm 
i dont understand shit
QWEEDDY2 27 May, 2023 @ 7:35pm 
О а был и русский гайд. Пропустил я его как-то. Спасибо.
Captn Kickass 5 Apr, 2023 @ 2:46pm 
Russian version:
В случае если кому-то хочется дать боту повоевать за вас, а потом вернуть контроль над вашими войсками и базой, вот как это можно решить:
1) Удалить строки run = Cpu_ControlLocalPlayer() и run = setsimrate(35);
2) Под строкой run = FOW_RevealAll() вставить следующее:
bind("F7","test2()")

function test2()
local player = World_GetPlayerAt(Tut_GetLocalPlayerIndex())
if Cpu_IsCpuPlayer(player) then
run = W40k_SwitchToPlayer( player, true )
else
run = Cpu_ControlLocalPlayer();
end
end

Таким образом можно давать боту управлять всеми юнитами и забирать контроль всего по нажатию F7.

Приятной игры/Have a good game
Captn Kickass 5 Apr, 2023 @ 2:45pm 
In case someone is wondering how to return controls back to player mid-game, here is a solution:
1) Delete run = Cpu_ControlLocalPlayer() and run = setsimrate(35) rows;
2) Below run = FOW_RevealAll() paste the following:
bind("F7","test2()")

function test2()
local player = World_GetPlayerAt(Tut_GetLocalPlayerIndex())
if Cpu_IsCpuPlayer(player) then
run = W40k_SwitchToPlayer( player, true )
else
run = Cpu_ControlLocalPlayer();
end
end

This code will allow you to give controls of your faction to an AI and take it back with a click of a button.
odin-is-mnogih 28 Dec, 2022 @ 1:43am 
Ну, от нечего делать хочется просто посмотреть за боями не напрягаясь. В онлайн-лобби когда я спрашиваю побыть спеком, меня кикают, или закрывают слоты, либо по 30 минут ждать приходится. Так-что можно и за ботами посмотреть.
А уничтожать свою базу не тот эффект дает. Не получится посмотреть за игрой на маленький картах(2). Не получится поставить 8 ботов, так как будет 7, и тот, к кому ближе игрок уничтожил свою базу получит преимущество(по той же причине бот получает преимущество на любой карте, где самоуничтожился игрок)
minolion0 7 May, 2022 @ 2:58pm 
тут серьезно есть люди которые не могут сыграть 1 на 1 с безумным компом? Это же легкотня.
Smd 6 May, 2022 @ 1:59pm 
Можно без всяких модов так сделать. Сразу после старта игры удаляешь свое главное здание и всё, игра дальше продолжится и можно наблюдать за сражением ботов.
Мартын 19 Jul, 2021 @ 4:07pm 
А зачем запускать только ботов?
Amber 24 Jun, 2020 @ 10:23am 
Стандартная скорость игры - 7 :lunar2020ratinablanket: