[Tutorial] Let's make a mod!
#Let's Make a Mod!#
Objective
We're going to make a simple mod that lets you cancel the move disk with a left mouse click. Currently, once a unit's move disk is present, either a left or right mouse-click will execute the move order.
We will:
-
Download and set up our tools
-
Decrypt a .big archive
-
Extract files so we can make changes
-
Make a modification
-
Run our mod locally
-
Wrap up
YOU WILL NEED AT LEAST 5 GB OF AVAILABLE DISK SPACE FOR THIS TUTORIAL
Note: Some of these steps are subject to change once official HW:R mod tools are released. Gearbox's priority right now is prioritizing/addressing hot issues, so the ETA for Remastered mod tools is still unknown.
Tools
- mon's bigDecrypter
- Homeworld Remastered Toolkit (available on Steam after you've purchased/activated your key)
1. Download and set up our tools
First, we need two tools. We need mon's bigDecrypter (available on Github and just recently updated!), and we need the HW:R toolkit, to extract the files from the decrypted archive.
To download the bigDecrypter, go to the link provided above and download the latest release's zip file. Open the zip, and extract the executable bigDecrypter.exe to your desktop.
To download the Steam toolkit, go to Tools under Library, and find the Homeworld Remastered Toolkit. Install it. It will be automatically downloaded to your HW:R path, under "<Steam>\SteamApps\common\Homeworld\GBXTools\WorkshopTool". (On my 64-bit Win7 machine, Steam is installed at "C:\Program Files (x86)\Steam", but this may vary based on your system.)
2. Decrypt a .big archive
We are going to extract the biggest, baddest .big file of all: Homeworld2.big. It's a monster, and this tutorial could have started with a smaller file, but Homeworld2.big is the bread and butter of this game, so let's crack it open.
First, it has to be decrypted. Fortunately, an Internet Genius named mon has provided us the means to do that. Move bigDecrypter.exe, which you copied to your desktop, into "<Steam>\SteamApps\common\Homeworld\HomeworldRM\Data". Now, open a command prompt and cd to that area. On my PC, that looks like:
- <windows key> + R
- cmd in the dialog box, then ENTER
In the command prompt:
cd "C:\Program Files (x86)\Steam\SteamApps\common\Homeworld\HomeworldRM\Data"
Note: quotes are necessary when there are spaces in the full path. Also, your full path may be different.
Now, we run the decryption program. Its call looks like:
bigDecrypter.exe <old file> <new file>
DO NOT PROVIDE THE SAME FILENAME FOR OLD AND NEW! In the age of digital distribution, the penalty is nothing more than re-installing HW:R through Steam, but with care, it doesn't have to come to that. In our command prompt, let's run the following command:
bigDecrypter.exe Homeworld2.big decr.big
It may take a few minutes to decrypt, and the new file, "decr.big," will be just as huge: a whopping 1.5 GB.
Once it's done, move bigDecrypter.exe back to the desktop. There's no need to keep it in the official game folder.
3. Extract files
Move the decrypter big file, "decr.big," to the Toolkit path (<Steam>\SteamApps\common\Homeworld\GBXTools\WorkshopTool). Then, cd there within the command prompt:
cd "C:\Program Files (x86)\Steam\SteamApps\common\Homeworld\GBXTools\WorkshopTool"
In order to extract, run this command:
archive -a decr.big -e extracted
This will create a new folder in the Toolkit area called "extracted," and place your files in that folder.
It takes a while to run - I think it took 10-20 minutes for me. It will consume approximately 4 GB of disk space, so if you're running on an IBM that you bought from Circuit City when Czechoslovakia was still a country, now's the time to consider an upgrade.
You can delete the massive "decr.big" file once everything is extracted.
4. Make the mod
FYI, "ship" is by far the largest ship subdirectory, so if you won't be making any changes to individual ships, you can consider deleting that folder.
You can move the "extracted" folder wherever you want to keep things organized, just make sure that you keep the file hierarchy underneath intact.
Open up the file "extracted\ui\ui.lua" in your favorite text editor (which is Notepad++, right?) and go to line 39. The value for muiTwkLeftClickCancels is currently false. Set it to true. One line lower, the value for muiTwkLeftClickAcknowledges is true. Set it to false.
Save the changes to ui.lua.
5. Run the mod locally
Create a new folder in the HomeworldRM directory called "LeftClickMod". Under that, create a folder called "ui", and below that, copy your modified "ui.lua" file. In the LeftClickMod folder, also create an empty text file called "Keeper.txt". This is required.
Your HomeworldRM area should look like this (lines added to clearly denote folder hierarchy).
Create a shortcut of "<Steam>\steamapps\common\Homeworld\HWLauncher.exe" and move it to your desktop. Be careful: there is a Launcher.exe.config file which will look like the launcher if you don't have file extensions visible in Windows.
Right-click your new shortcut, select Properties, and in the Target field after the double-quotes, add:
-moddatapath LeftClickMod
That's it! Fire up a quick Skirmish with a CPU, and try moving a unit. Now, try bringing up the movement disk with a right-click, and canceling with a left-click.
You can check that your change applies to both the HW1:R and HW2:R campaigns, as well as multiplayer. Neat, huh?
6. Conclusions
You only need to perform steps 1-3 once, unless you delete extracted scripts that you later require.
The info for step 5 was gleaned from a guide published by Gearbox on the Steam Workshop. Although official tools only exist for HW2 Classic at present, it is apparently still possible to upload mods that interact with Homeworld Remastered, since I've already downloaded a few myself.
You do not need to repackage your files into a .big - the Toolkit does that automatically. See the Steam article.
Finally, keep track of your changes! If you know that you are making a UI-only mod, you may want to copy the ui folder to another area and make your changes there. Consider using revision control to track your progress, just be careful how you back up your work. Remember, the contents of Homeworld2.big, along with the entire Homeworld Remastered package, are the property of Gearbox Software.
If you're at a loss for what to do next, here are two assignments:
-
Check what happens when you set both of the values in ui.lua to true. Use the scientific method.
-
Change the color of your units' health bars from green/yellow/red to blue/pink/mint. This will require some detective work - the change isn't in ui.lua, as it may first appear.
Phew! There's an awful lot of scripts/values to sort through just in Homeworld2.big, and people are already pushing out mods based on what we can extract. There are also other big files, as well as mods that you can extract with this process to see how modders are making their changes. All you need to get started is curiosity and persistence.
Was this helpful? I cannot personally provide support for the tools used, but reply with any hang-ups/confusion you have, and hopefully somebody will be able to help. Also, please point out typos. Thanks!
*Homeworld: Remastered mods made using this tutorial may be released without crediting this tutorial. Just be sure to send any feedback you may have. Thanks again!
Posted Mar 4, 2015, 7:36 PM UTC · edited