Login

russian armor

[Guide] Merge the patch with outdated tools

18 Jun 2021, 14:10 PM
#1
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

Hello fellow modmakers,

We all know that the modtools are outdated since April 22nd 2020 for unknown reasons. While this is super annoying, I refused to give up and let my mod die. So after some frustrations I have found a workaround to be able to merge the last patch successfully!
In this small guide I will explain how you can link vanilla files that are unavailable in the tools. Keep in mind, it will not be possible to edit the currently missing files.

First of all, always make a backup of your mod before every major change. Especially now, because we will be messing with the source of the official modding tools.

1. Extract .rgd files:

It is not possible to convert .rgd to readable files for CoH2, but they do have very interesting names that we need. Therefor you need to extract the AttribArchive.sga.
Open the Command Prompt,
  • Either open Command Prompt from the start menu and type: cd C:\Program Files (x86)\Steam\steamapps\common\Company of Heroes 2
  • Or open the explorer at this path 'C:\Program Files (x86)\Steam\steamapps\common\Company of Heroes 2' and type 'cmd' in the quick access bar.
Then execute this: archive.exe -a CoH2\Archives\AttribArchive.sga -e CoH2\attrib
This can take some time, around 40 seconds in my case.

Go to this folder and there you can see all extracted objects from the live game with specific names: C:\Program Files (x86)\Steam\steamapps\common\Company of Heroes 2\CoH2\attrib\attrib

2. Fool the modding tools:

It is possible to add the names of the .rgd files outside the tools in your .xml files, using any text editor. I tried this first, but once you launch the tools it will validate all paths and immediately remove these links without giving you any choice. That raises the question how it knows these paths. Well... it does not know them, it just loads everything from one folder and compares it. So lets just add some files in there!

Close the tools first. If it detects any change in its files, it will close and you will lose unsaved changes. The modding tools has this folder from which it automatically reads all .xml files: C:\Program Files (x86)\Steam\steamapps\common\Company of Heroes 2 Tools\assets\data\attributes\instances

We are just going to add each file which is missing (or just the ones you need). You have to copy a file from the same folder from which you want to add it to be sure it uses the right template. Rename the new file to one of the filenames that is found in step 1. Each file has an unique ID. We don't need to know which one, but to satisfy the tools give each new file an unique ID. This 'pbgid' is located at the end of the .xml. I started counting at 200000 (highest number I could find was somewhere in 180000).

Once you open the tools it will show this new file without issues and you can link it to your own files. Now you can link any new files: abilities, upgrades and even units to your mod which are not yet officially available in te tools! As long as you don't clone the new files and only link them, the game will replace them with the vanilla version.

It can be a challenge to find the new files, here is a short list for the new commander upgrades as a start:
upgrade\aef\commander\ability\m3_halftrack
upgrade\british\commander\passive\tommy_raid_package_unlock
upgrade\british\commander\passive\field_recovery
upgrade\german\commander\passive\vehicle_repair_german
upgrade\german\commander\ability\luftwaffe_field_officer
upgrade\soviet\commander\ability\air_drop_weapon_resupply_soviet
upgrade\soviet\commander\ability\shock_152mm_artillery_mp
upgrade\soviet\commander\ability\supply_truck_zis_6_mp
upgrade\soviet\commander\passive\assault_guard_troops

3. Add new commander abilities

Somehow the new commander abilities for the Wehrmacht and Soviets have been added outside of the ability list in the army category, like the original British commander abilities. This means you don't need to add them in order to have them in your mod, even when you cloned the army category. The new abilities for USF and the Brits on the contrary are added to the ability list in the army file and need to be added:
abilities\aef\modal_ability\dispatch_ability\m3_halftrack_mp
abilities\british\modal_ability\dispatch_ability\raid_section_mp
abilities\british\modal_ability\dispatch_ability\field_recovery

4. Remove commander abilities outside of the army category

In order to remove the new abilities which are linked outside of the army category: Add a requirement action to the HQ in ebps/action_apply. In requirement, add required_player_upgrade which links to a commander upgrade. In actions, add a new custom upgrade with 'player' as owner. Then in this new upgrade add 'upgrade_remove' to remove the commander upgrade which was set in the requirement. As soon as a player selects a commander with this ability, this action will remove it immediately and you won't notice anything ingame.

5. Note

I cannot predict what will happen if the tools will magically finally update some day, but I don't think it this will have any consequences.

This is not ideal, but it is the best I can think of for now. Good luck!
18 Jun 2021, 17:18 PM
#2
avatar of FunnyFruit

Posts: 5

Thanks for the detailed explanation! The modding community need such techniques to keep their stats updated and I believe the trick is a big discovery for all of us!
19 Jun 2021, 15:52 PM
#3
avatar of RoastinGhost

Posts: 416 | Subs: 1

Thank you! This post saved my mod when the new patch bugs seemed unfixable.
21 Jun 2021, 06:54 AM
#4
avatar of Sie_Sayoka
Modmaker Badge

Posts: 100 | Subs: 1

Thank you. I've been looking for a way to remove the new command abilities for a while.
23 Jun 2021, 11:50 AM
#5
avatar of Support Sapper

Posts: 1220 | Subs: 1

i has been unable to built my mod with exit code 1 since the update, can this help me get out of the case ?
23 Jun 2021, 17:11 PM
#6
avatar of SneakEye
Senior Modmaker Badge

Posts: 817 | Subs: 5

i has been unable to built my mod with exit code 1 since the update, can this help me get out of the case ?

I am afraid this won't fix that. Most posts I can find about java error 1 are related to custom icons, have you changed anything about that? Maybe a java update? This thread mentioned a fix regarding adobe Flex: https://www.coh2.org/topic/105995/java-and-exit-code-1
23 Jun 2021, 23:39 PM
#7
avatar of Support Sapper

Posts: 1220 | Subs: 1


I am afraid this won't fix that. Most posts I can find about java error 1 are related to custom icons, have you changed anything about that? Maybe a java update? This thread mentioned a fix regarding adobe Flex: https://www.coh2.org/topic/105995/java-and-exit-code-1


I did attempt to use some icon but failed so i give up and deleted the burn ui, still, i can still built the mod before patch. After patch go live, i come back and try to built again without any change but bug keep happen. I deleted some newly create ability but it doesn't help. To be sure, i event creat a completely new mod with minor change to test, but it also failed to built. I did re install java recently but it doesn't bug pre-ptach, is there any particular version that have to be used ?
Dar
14 Sep 2021, 22:00 PM
#8
avatar of Dar

Posts: 84

With the new patch I finally caved in and left behind the 32bit legacy build, so this guide came in incredibly helpful, thanks a lot Sneakeye!

I have one major issue still: Is it possible to remove newer abilities such as the updated early warning for the UKF Artillery Commander (british\modal_ability\commander_ability\
early_warning_targeted_mp)? The ability is one of those that are magically added in. It has no reference in the army cat, and does not rely on a commander upgrade that I could remove via the HQ workaround. In fact, as many other UKF abilities, it has no requirements and just knows when to show up somehow. Since I can't clone it, I also can't hide it from the UI or change it into something else.

Any ideas on that one?

EDIT: Figured out a solution, outside the AE though. Throw this code into a win condition scar:




0 user is browsing this thread:

Livestreams

unknown 11
Germany 1

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

486 users are online: 486 guests
0 post in the last 24h
6 posts in the last week
38 posts in the last month
Registered members: 49060
Welcome our newest member, starkindustries
Most online: 2043 users on 29 Oct 2023, 01:04 AM