Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Hexedit stronghold.cfg to easily unlock military campaign missions

When I installed the Stronghold HD patch to take my CD installation of Stronghold v1.2 up to the latest, version 1.3, I had to rearrange the savegame files as indicated in the helpful documentation (for me, that was file ~/.wine/drive_c/Program Files/FireFly Studios/Stronghold/readme_en.html ).

Old savegames and settings Stronghold HD stores user maps, saves and settings in the Documents\Stronghold folder. If you have upgraded to Stronghold HD from an old version of Stronghold you will need to copy the maps, saves and settings from the Program Files\Firefly Studios\Stronghold folder (default location) to the Documents\Stronghold folder. Savegames (.sav files) Old Location: Program Files\Firefly Studios\Stronghold\saves New Location: Documents\Stronghold\Saves Maps (custom .map files) Old Location: Program Files\Firefly Studios\Stronghold\maps New Location: Documents\Stronghold\maps Settings (stronghold.cfg) Old Location: Program Files\Firefly Studios\Stronghold New Location: Documents\Stronghold

Because I'm using the proper ISO saved from the original game disc, I've never needed a no-cd patch. Anyway, I noticed that my military campaign mission status was not transferred to the new HD installation. I ensured the .sco files were in the new spot (the Saves directory) but it did not unlock the missions. I helpfully had a mission 17 b save that was right at the tail end of that mission, so loading and finishing it got me up to mission 18. However, I didn't want to have to go through the difficult fixed-force invasion of the Pig's castle, so I looked for cheat codes for a computer game for the first time in about a decade. Believe it or not, but I couldn't find any (working) cheats that just declare "success" for a mission. So, I decided to hack the stronghold.cfg. I'm old-school, so I whipped out vim and :%!xxd and here is the results of my research:

To set the military campaign level unlocked, modify byte 0x147 which is in line:

    00000140: 0000 0055 0000 0013 0000 0021 0000 0000  ...U.......!....
#                               ^
#                               +-- this is hex 0x13 or decimal 19.
This corresponds to being able to play level 19 of the military campaign.

You can use vi with :%!xxd and :%!xxd -r to convert stronghold.cfg to hexedecimal and back.

For Stronghold HD, that is file ~/Documents/Stronghold/stronghold.cfg

Of course you could abuse this, but I was just using it to recover my progress. castle gate with soldiers
garrisoned

References

My own original research and hacking on the config file.

Comments