I was asked on Twitter how one could change what things are trained or researched in a building/socket. So that's the focus today. I may do some other simple guides in the future, if I get the time. However, it will always be time taken away from writing code. Would be nice to instead guide a minion with the drive to explore without full assistance, who would then write/vlog the guides for the everyman/lady.
- You'll need to own and install Halo Wars Definitive Edition.
- You'll need to dump the game package using UWPDumper. Download the lastest x64 build here.
- With all the files dumped, you'll need to then uninstall the packed game.
- With the game uninstalled, you can put this bat file in the folder with the dumped game files to install the game 'loosely'. If you run into any errors, check that you have side loading enabled in your Windows settings. If you continue to run into an error at this point, try deleting the .p7x file from the dump directory.
- At this point you'll need the latest version of the PhxTools from github.
- Run PhxGui.exe. It's a simple drag-n-drop tool.
- Set the Game Version to DefinitiveEdition
- Select the directory for ERA Expand Path, where files will be extracted.
- Select the directory for ERA Build Output, where new ERA files will be placed.
- Now, drag-n-drop the xgameFinal.exe (one of the dumped game files) into the app.
- If the exe version is recognized, a back up will be made and the input will be modified to accept custom ERA files.
- From here, you'll need to drag-n-drop root.era, and the contained files will be extracted to the path in step 8.
- Go to the output path and open root.eradef file in a text editor that works with XML (you'll need to modify it later)
- Now view the "data" folder
- You want to find the files "objects.xml.xmb" and "techs.xml.xmb"
- Drag-n-drop these files to have PhxGui create the .xml versions of these files.
- Now find the files mentioned in step 15 in root.eradef and remove the ".xmb" extension so that the .xml files are referenced instead. Don't forget to save.
- Drag-n-drop root.eradef into PhxGui to have it spit out a new root.era to the directory mentioned in step 9.
- Assuming you didn't encounter any errors up to this point, you're ready to make changes to the files mentioned in step 15 to change the train/research options of buildings.
Changing build commands
Let's pretend you want to change what is trained out of the UNSC's barracks building. You'll want to open the objects.xml file in a text editor and search for an <Object> entry for unsc_bldg_barracks_01. Inside this element you'll find its <Command> elements. Refer to this excerpt for what you should be seeing.
There are various kinds of commands that a building can respond to. Research, Kill (self destruct), TrainSquad, etc. If you're wanting to mess with these different types, refer to other buildings. For now, let's just replace the command to train unsc_inf_marine_01 with unsc_veh_scorpion_01. These proto squads are defined in the squads.xml file (you'll need to convert the .xmb first), but you don't really need to change that file for command modding.
If the squad you were trying to train was say, a scarab or a unit that you don't normally have access to as the UNSC or leader you're playing with, you'd need to modify the techs.xml data. Specifically, the unsc_basic proto tech. See this doc for the stock unsc_basic data. Refer to it to figure out how to enable other proto squads for all UNSC leaders.
If you repeat step 18, after having saved any changes you made to the XML files, you'll have a root.era with your modifications in it. Back up the root.era that's in your game folder and then drop your custom root.era in.
Assuming there were no errors or mistakes up to this point, the next time you boot the game and play as the UNSC in Skirmish (campaign is a different beast), you should see the tank as the unit option in the barracks where the marines would normally be. It will still require the same amount of tech levels and cost as it normally would. Again, we're just changing the commands used to build units.
Sure, pictures or a video showing each step would have been nice, but I don't have the time to curate such a guide right now. So make like an explorer, and figure this brace new world out on your own and with others. Claim no land as your own, only territory for you and your fellow modder to brave share. No, I'm not communist, I just prefer to put the "kind" in mankind.