Warhammer 40,000: Dawn of War - Dark Crusade

Warhammer 40,000: Dawn of War - Dark Crusade

Not enough ratings
(EN-RU) How to add Timer into Dark Crusade Campaign
By MikeGcom
In this guide I will show how you can put in game timer into Dark Crusade Campaign (like Soulstorm).
В этом гайде я покажу вам, как добавить игровой таймер в кампанию Dark Crusade (как в Soulstorm).
WARNING! Timer in some places may be inaccurate due to order in code. If you have some talent in it, you can fix it and give it under this guide. Thank you for patience.
Внимание! Таймер может быть неточным в связи с порядком в коде. Если у вас есть в этом талант, можете починить это и отправить в комментариях. Спасибо за терпение.
   
Award
Favorite
Favorited
Unfavorite
(EN) Auto Installation
Step 1:
Download archive file from Google Drive: link[drive.google.com]

Step 2:
Extract Data folder into "...\Dawn of War Dark Crusade\DXP2" folder with replace

Step 3:
Enjoy your Timer in game!



This files will add:
  1. Timer in every normal map
  2. Timer in every ivent map (like Pavonis, exc. Aceria Forest and Ariel Highlands, which counts as normal maps) (timer will add even if map has an alternate timer (because of this, there may be inaccuracies))
  3. Timer in every stronghold map
(EN) Manual Installation
Before we start, I should warn you, what ignorance of the basics of programming may break your game to reinstallate state. Be careful.

Step 1:
Every files we need archived in SGA files, which can't open without special Explorer, which we can download from this site: link[skins.hiveworldterra.co.uk]


Step 2:
Extract SGA Explorer into some folder, open it and in it open DXP2Data.sga file from "...\Dawn of War Dark Crusade\DXP2" folder.


Step 3:
When you done previous step, you will see data folder in explorer, we need to open it from "+" sign, then open scenarios and click to sp folder, what takes for us some files right of explorer.


Step 4:
In this list we need to extract:
  • kronus.map
  • every "cl_mapname.scar" (It will be 4, because Ariel Highlands and Aceria Forest doesn't count as Ivent map)
  • every "stronghold_racename.scar" (it will be 7 as races)

You can use "Extract to default", which extract to your DXP2 folder in Dark Crusade folder.


Step 5:
First, we open kronus.map file, which operate with normal maps with honour squads (and Ariel Highlands with Aceria Forest).
Highly recommend using code-editing programs (like Notepad++) to open this files.
When you open it, scroll down to 142 line, where we see code "DefaultSkirmishWinConditions" and one Condition under it - "DestroyHQ".
Place comma after this if it doesn't, take next line and write "GameTimer", what gives us timer in normal missions. After this don't forget to save (discet icon above or "Shift+S" keyboard shortcut)



Note: here you can change conditions of normal maps, so if you want annihilate everything before leaving map, you need to change "DestroyHQ" to "Annihilate". Every conditions you can see above this lines (description of every condition you can notice when editing skirmish single or multiplayer game)

Step 6:
Next step - editing "cl_mapname.scar" files. It's more complicated that before, so we need to prepare some code to paste into.

-- Create and Initially Show the Game Timer function Rule_UI_Game_Timer() g_UI_gameTimer = 0 WinWarning_Add( "ui_gameTime", World_GetPlayerAt(0), "", "", "" ) Rule_AddInterval(Rule_UI_Game_Timer_Tick, 1) end -- Updates and shows the Game Timer every second function Rule_UI_Game_Timer_Tick() g_UI_gameTimer = g_UI_gameTimer+1 WinWarning_SetText( "ui_gameTime", Loc_FormatText1( 60445, Loc_FormatTime( 60409, g_UI_gameTimer ) ) ) end

This code we need to paste into every .scar file. Initially this code was in Soulstorm stronghold file, so we take it and use to call Timer in Ivent and Strongholds missions.

First we open "eres_badlands" and "vandea_coast" files, because they has "normal" Relic code style.

Eres Badlands:
  1. Go to 510 line and take new empty line before "Difficulty" line and after last "end" line
  2. Paste our code
  3. Go up to 476 line and write after line Rule_AddOneShot(Rule_Countdown_Timer_Activation, 1) another line with Rule_AddOneShot(Rule_UI_Game_Timer, 1)
  4. Save it


Vandea Coast:
  1. Go to 530 line and take new empty line before "Difficulty" line and after last "end" line
  2. Paste our code
  3. Go up to 515 line and write after line --Rule_AddOneShot(Rule_Countdown_Timer_Activation, 5) another line with Rule_AddOneShot(Rule_UI_Game_Timer, 5)
  4. Save it



Note: I don't know why, but Vandea is unstable and sometimes may call our timer right after countdown, and sometimes call timer after 2-3 sec of countdown. If you know how fix it - write in commentaries

We complete editing this 2 Ivent maps and they ready to give you in game timer.

Next 2 is "hyperion_peaks" and "pavonis" which has a "darvin" code style and have another places to paste code.

Hyperion Peaks:
  1. Go to 407 line and take new empty line before "Rule_Add_Objective" function and after last "end" line
  2. Paste our code
  3. Go up to 400 line and write after line Rule_AddIntervalDelay(Rule_EndGame_Lose,5,10) another line with Rule_AddOneShot(Rule_UI_Game_Timer, 0)
  4. Save it


Pavonis:
  1. Go to 327 line and take new empty line before "Rule_Add_Objective" function and after last "end" line
  2. Paste our code
  3. Go up to 319 line and write after line Rule_AddIntervalDelay(Rule_EndGame_Lose,5,10) another line with Rule_AddOneShot(Rule_UI_Game_Timer, 0)
  4. Save it


After this we complete all Ivent maps. You can check difference in game!

(EN) Manual Installation Part 2
Step 7:
"You're the last one, complete the mission"
Jokes aside, we are already pass half of path, strongholds files remaining. Every Stronghold file has a "normal" code style (like in Eres Badlands), so our objective is simple:
  1. Find "Difficulty" module
  2. Paste our code above it
  3. Find above it line, which activates AI
  4. Write after it our calling function

But if you unsure about your possibilities, right under it I wrote every step of every stronghold file for your sake ;)

Chaos Space Marines (Deimos Peninsula):
  1. Go to 417 line and take new empty line before "Difficulty" line and after last "end" line
  2. Paste our code
  3. Go up to 336 line and write above line Rule_StartAI() another line with Rule_UI_Game_Timer()
  4. Save it



Eldar (Tyrea):
  1. Go to 501 line and take new empty line before "Rule_LoadShockTroops" line and after last "end" line
  2. Paste our code
  3. Go up to 269 line and write above line Rule_StartAI() another line with Rule_UI_Game_Timer()
  4. Save it



Imperial Guard (Victory Bay):
  1. Go to 571 line and take new empty line before "Difficulty" line and after last "end" line
  2. Paste our code
  3. Go up to 479 line and write above line Rule_StartAI() another line with Rule_UI_Game_Timer()
  4. Save it




Necron (Thur'abis Plateau):
  1. Go to 371 line and take new empty line before "Rule_MidNIS" line and after last "end" line
  2. Paste our code
  3. Go up to 295 line and write above line Rule_StartAI() another line with Rule_UI_Game_Timer()
  4. Save it



Ork (Green Coast):
  1. Go to 650 line and take new empty line before "Difficulty" line and after last "end" line
  2. Paste our code
  3. Go up to 557 line and write above line Rule_StartAI() another line with Rule_UI_Game_Timer()
  4. Save it



Space Marine (North Vandea):
  1. Go to 406 line and take new empty line before "Difficulty" line and after last "end" line
  2. Paste our code
  3. Go up to 370 line and write above line Rule_StartAI() another line with Rule_UI_Game_Timer()
  4. Save it



Tau (Or'es Tash'n):
  1. Go to 608 line and take new empty line before "Difficulty" line and after last "end" line
  2. Paste our code
  3. Go up to 507 line and write above line Rule_StartAI() another line with Rule_UI_Game_Timer()
  4. Save it



... And we are done! Make sure you save all of this files, and now you can test it in every stronghold base!

(RU) Авто Установка
Шаг 1:
Скачать архив из Google Drive: ссылка[drive.google.com]

Шаг 2:
Разархивировать папку Data в "...\Dawn of War Dark Crusade\DXP2" папку с заменой

Шаг 3:
Наслаждайся таймером в игре!



Эти файлы добавляют:
  1. Таймер в каждую обычную карту
  2. Каждую ивент-карту (как например Pavonis, исключая Aceria Forest и Ariel Highlands, они считаются обычными картами) (таймер будет работать даже с другим таймером (из-за этого могут быть неточности))
  3. Таймер в каждой карте-базе
(RU) Ручная Установка
Прежде чем мы начнём, хочу предупредить, что незнание базового программирования может сломать игру вплоть до переустановки. Будьте аккуратны

Шаг 1:
Каждый файл что нам нужен находятся в SGA архиве, который нельзя открыть без специального Explorer-а, который мы можем скачать с этого сайта: ссылка[skins.hiveworldterra.co.uk]


Шаг 2:
Распакуй SGA Explorer в какую-нибудь папку, открой его и в нём открой DXP2Data.sga файл из "...\Dawn of War Dark Crusade\DXP2" папки.


Шаг 3:
Когда закончишь с предыдущим шагом, ты увидишь data папку в проводнике слева, нам нужно открыть его через "+" значок, потом открыть scenarios и кликнуть по sp папке, что даст нам несколько файлов в проводнике справа.


Шаг 4:
Среди этих файлов нам надо распаковать:
  • kronus.map
  • каждый "cl_mapname.scar" (их будет 4, потому что Ariel Highlands и Aceria Forest не считаются как ивент-карты)
  • каждый "stronghold_racename.scar" (их будет 7, как и рас)

Можешь спокойно использовать "Extract to default", что распакует в DXP2 папку, которая в папке Dark Crusade.


Шаг 5:
Сначала откроем kronus.map файл, который отвечает за стандартные миссии (и за Ariel Highlands с Aceria Forest).
Крайне рекомендую использовать редакторы кодов (например Notepad++).
Когда откроешь файл, листай вниз до 142 строки, где увидишь код "DefaultSkirmishWinConditions" и одно Условие под ним - "DestroyHQ".
Поставь запятую после него, если там её нет, перейди на следующую строку и напиши "GameTimer", что даст нам таймер в нормальных миссиях. После этого не забудь сохранить (иконка дискеты сверху или "Shift+S" сочетание клавиш)



Заметка: здесь ты можешь менять условия победы, так что если ты хочешь РЕЗНЮ, тебе надо поменять "DestroyHQ" на "Annihilate". каждое условие можно найти над этими строками (описание условий можно посмотреть в лобби сингл или мультиплеера)

Шаг 6:
Следующий шаг - изменение "cl_mapname.scar" файлов. здесь всё несколько сложнее, поэтому нам понадобится подготовить следующий код:

-- Create and Initially Show the Game Timer function Rule_UI_Game_Timer() g_UI_gameTimer = 0 WinWarning_Add( "ui_gameTime", World_GetPlayerAt(0), "", "", "" ) Rule_AddInterval(Rule_UI_Game_Timer_Tick, 1) end -- Updates and shows the Game Timer every second function Rule_UI_Game_Timer_Tick() g_UI_gameTimer = g_UI_gameTimer+1 WinWarning_SetText( "ui_gameTime", Loc_FormatText1( 60445, Loc_FormatTime( 60409, g_UI_gameTimer ) ) ) end

Этот код мы будет добавлять в каждый .scar файл. Изначально этот код был в Soulstorm файле базы, так что используем его для вызова таймера в ивент-картах и картах баз.

Сначала откроем "eres_badlands" и "vandea_coast" файлы, потому что они имеют "нормальный" Relic стиль кода.

Eres Badlands:
  1. Спустись до 510 строки и сделай пустую строку перед "Difficulty" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 476 строки и напиши после Rule_AddOneShot(Rule_Countdown_Timer_Activation, 1) ещё одну строку с Rule_AddOneShot(Rule_UI_Game_Timer, 1)
  4. Сохранись


Vandea Coast:
  1. Спустись до 530 строки и сделай пустую строку перед "Difficulty" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 515 строки и напиши после Rule_AddOneShot(Rule_Countdown_Timer_Activation, 5) ещё одну строку с Rule_AddOneShot(Rule_UI_Game_Timer, 5)
  4. Сохранись



Заметка: Я не знаю почему, но Vandea нестабильна и может нормально запустить оба таймера, а может запустить с задержкой один из них. если знаете как починить - напишите в комментах

Мы закончили 2 ивент-карты и они уже готовы показать тебе таймер.

Следующие 2 это "hyperion_peaks" и "pavonis" которые написаны на "darvin" стиле кода нам придётся добавить код в немного другие места.

Hyperion Peaks:
  1. Спустись до 407 строки сделай пустую строку перед "Rule_Add_Objective" функцией и последней "end"
  2. Вставь наш код
  3. Поднимись до 400 строки и напиши после Rule_AddIntervalDelay(Rule_EndGame_Lose,5,10) ещё одну строку с Rule_AddOneShot(Rule_UI_Game_Timer, 0)
  4. Сохранись


Pavonis:
  1. Спустись до 327 строки сделай пустую строку перед "Rule_Add_Objective" функцией и последней "end"
  2. Вставь наш код
  3. Поднимись до 319 строки и напиши после Rule_AddIntervalDelay(Rule_EndGame_Lose,5,10) ещё одну строку с Rule_AddOneShot(Rule_UI_Game_Timer, 0)
  4. Сохранись


После этого мы закончили с ивент-картами. Можешь пойти и посмотреть изменения в игре!

(RU) Ручная Установка Часть 2
Шаг 7:
"You're the last one, complete the mission"
Шутки в сторону, мы уже прошли половину пути, остались только карты баз. каждый файл базы написан на "нормальном" стиле кода (как и Eres Badlands), так что наша задача простая:
  1. Найти "Difficulty" модуль
  2. Вставить наш код над ним
  3. Найти сверху строку, которая активирует ИИ
  4. Написать перед ним нашу функцию

Но если ты неуверен в своих силах, прямо под этим я напишу каждый шаг для каждой карты баз для твоего же блага ;)

Космодесант Хаоса (Deimos Peninsula):
  1. Спустись до 417 строки и сделай пустую строку перед "Difficulty" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 336 строки и напиши после Rule_StartAI() ещё одну строку с Rule_UI_Game_Timer()
  4. Сохранись



Эльдары (Tyrea):
  1. Спустись до 501 строки и сделай пустую строку перед "Rule_LoadShockTroops" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 269 строки и напиши после Rule_StartAI() ещё одну строку с Rule_UI_Game_Timer()
  4. Сохранись



Имперская Гвардия (Victory Bay):
  1. Спустись до 571 строки и сделай пустую строку перед "Difficulty" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 479 строки и напиши после Rule_StartAI() ещё одну строку с Rule_UI_Game_Timer()
  4. Сохранись




Некроны (Thur'abis Plateau):
  1. Спустись до 371 строки и сделай пустую строку перед "Rule_MidNIS" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 295 строки и напиши после Rule_StartAI() ещё одну строку с Rule_UI_Game_Timer()
  4. Сохранись



Орки (Green Coast):
  1. Спустись до 650 строки и сделай пустую строку перед "Difficulty" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 557 строки и напиши после Rule_StartAI() ещё одну строку с Rule_UI_Game_Timer()
  4. Сохранись



Космодесант (North Vandea):
  1. Спустись до 406 строки и сделай пустую строку перед "Difficulty" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 370 строки и напиши после Rule_StartAI() ещё одну строку с Rule_UI_Game_Timer()
  4. Сохранись



Тау (Or'es Tash'n):
  1. Спустись до 608 строки и сделай пустую строку перед "Difficulty" и после последней "end"
  2. Вставь наш код
  3. Поднимись до 507 строки и напиши после Rule_StartAI() ещё одну строку с Rule_UI_Game_Timer()
  4. Сохранись



... И мы закончили! Проверь, сохранил ли ты все файлы, и сейчас мы можем проверить каждую карту базы!

(EN-RU) Credit - Титры
Thank you for reading up to this point. I was supposed to finish this guide a couple of months ago, but in the end I finished it only now :D

I checked every mission and every defend, so it suppose to work properly. If you have some issues - maybe you wrote wrong or delete something important in code. But if not - write in commentaries, we will seek answer soon.

Will it works with multiplayer? I suppose it was, but i can't check it because of 4GB patch, which blocking mp.

If you like this guide, please click Like and Favorite buttons, so you will help promote this guide to the tops!

Спасибо тебе, что дочитал до этого момента. Вообще я должен был закончить это руководство ещё пару месяцев назад, но по итогу закончил только сейчас :D

Я проверил каждую миссию и каждую защиту, так что должно работать нормально. Если появились какие-то проблемы - возможно что-то неправильно написал или удалил что-то важное в коде. Если же нет - напиши в комментариях проблему, попробуем найти ответ вместе.

Будет ли работать с мультиплеером? Я думаю да, но не могу проверить из-за 4GB патча, который блокирует мульт

Если тебе понравилось руководство - тыкни по лайку и добавь в избранное, так мы продвинем данное руководство в топы!