Hacking FreeCol savegame

Dear,

Today I will show how to modify a freecol save to get some advantage against AI.

Firstly I searched how to modify a freecol file save, because when Bartolomé de las Casas was come to continental congress all Indian converts was converted to free colonist but after all new Indian converts was not converted to free colonist. I though that was a bug ( but not ) and I searched a workaround.

Before start

You need to have on your system:

  • freecol
  • xmlstarlet
  • file-roller

Method

  • Save game
  • open a terminal ( alt + F2 gnome-terminal )
  • move to freecol save directory
$ cd ~/.freecol/save
  • open nautilus
$ nautilus . 2>/dev/null &
  • open  .fsg file archive
$ file-roller  save.fsg 2>/dev/null &
  • extract savegame.xml file from archive and put the file into  ~/.freecol/save with  file-roller
  • Used xmlstarlet on savegame.xml
  • drag and drop savegame.xml file to opened archive though file-roller

Modify Indian converts to free colonist Indian

  •  How many Indian converts do you have?
$ xmlstarlet sel -t \
    -c 'count(//unit[@owner="player:1" and @unitType="model.unit.indianConvert"])' savegame.xml
6

You have 6 Indians converts.

  • update Indian
$ xmlstarlet ed -L \
    -u '//unit[@owner="player:1" and @unitType="model.unit.indianConvert"]/@unitType' \
    -v "model.unit.freeColonist" savegame.xml
  • Now they are not anymore Indians converts.
$ xmlstarlet sel -t \
    -c 'count(//unit[@owner="player:1" and @unitType="model.unit.indianConvert"])' savegame.xml
 0

Add movement point

$ xmlstarlet ed -L \
    -u '//unit[@owner="player:1" and @ID="unit:47754"]/@movesLeft' \
    -v 12 savegame.xml

Update all dragoons to veteran

  • How many noob dragons do you have?
$ xmlstarlet sel -t \
    -c 'count(//unit[@owner="player:1" and @role="DRAGOON" and @unitType!="model.unit.veteranSoldier"])' savegame.xml
11
  • update dragoons
$ xmlstarlet ed -L \
    -u '//unit[@owner="player:1" and @role="DRAGOON"]/@unitType' \
    -v "model.unit.veteranSoldier"  savegame.xml

Increasing number of tools in all our colonies

  • Count number of colony with less 200 tools
$ xmlstarlet sel -t \
    -c 'count(//colony[@owner="player:1"]/goodsContainer/storedGoods/goods[@type="model.goods.tools" and @amount<200])' \
    savegame.xml
7
  • Put 200 tools to all colony which had less than 200 tools
$ xmlstarlet ed -L \
    -u '//colony[@owner="player:1"]/goodsContainer/storedGoods/goods[@type="model.goods.tools" and @amount&lt;200]/@amount' \
    -v 200 savegame.xml

Increasing gold

  • How many gold do you have ?
$ xmlstarlet sel -t \
    -v '//player[@ID="player:1"]/@gold' savegame.xml
2645
  • Update it
$ xmlstarlet ed -L \
    -u '//player[@ID="player:1"]/@gold' -v 9999999 savegame.xml

Remember

drag and drop updated file through file-roller

Share Button

Leave a Reply