Developing CC2 mods on Linux

I’ve mentioned before that my Gaming PC is now basically Linux (Windows still on the disk, but I’ve not wanted to play StarCraft 2 for a while)

It’s taken me a couple of hours of experimentation to get to grips with messing about with Steam/Linux (Proton) apps but I’ve got myself a fairly clean workflow which is a similar to how I had in windows.

What you (I) need when developing CC2 mods of any complexity is two important things:

  • Run the game in -dev mode
  • Show the output of lua “print()” statements

While you can just about develop a basic mod without print output, it is hard. On windows I’ve been running cc2 in a git-bash window by running "./carrier_command.exe -dev" which works and prints to the screen.

This however doesn’t work on Linux. For some reason installing git-bash into Steam’s Proton doesn’t result in a working environment. No matter.

I’ve created https://github.com/cc2modteam/cc2run which lets me just type in “python cc2run\cc2run.py” and it does what I want (which some minor improvements)

How does this work?

Well, this is for as much my own reference as others..

Steam creates different “WINEPREFIX” folders for each windowsy steam app you install. I wanted an interactive environment so I created a custom steam proton app that just runs “cmd” by doing. “Games > Add a non-steam game to your library” I clicked browse and followed https://steamcommunity.com/app/221410/discussions/0/2913220877896597582/

Once done I changed the target to simply “cmd” then used the little dos window to install python (that I’d downloaded)

I then located the proton WINEPREFIX for cc2, and symlinked the AppData/ (which for CC2 is: "~/.local/share/Steam/steamapps/compatdata/1489630/pfx/drive_c/users/steamuser/AppData/Roaming" into the prefix created for my cmd.

I was then able to do:

z:
cd z:\home\inb\.local\share\Steam\steamapps\common
cd Carrier Command 2
carrier_command.exe -dev

To run the game!

Using my cc2run app to capture the command output was even better. I now have steam set to start my “cmd” in the steamapps\common folder, and have installed cc2run in there. I then simply type:

python cc2run\cc2run.py --dev

Troubleshooting

At first I had one problem, In -dev mode, CC2 is supposed to re-load lua scripts from your mods that you save when they have changed. This wasn’t working at first.

Luckly, by sheer accident, I found that if before loading or starting a map, I went into the MODS menu and enabled/disabled a mod, the -dev reload feature would start working again! yay!

By:

Posted in:


Leave a comment