project-navigation
Personal tools

Author Topic: Edit Save Game File  (Read 12005 times)

l1n00x

  • Guest
Edit Save Game File
« on: January 17, 2008, 05:24:13 pm »
I'm trying to edit the save game file because I wanted to set the civilian casualties to 0.
I was annoyed by losing about 1 civilian average per mission. Plus there was a spot on the map at the very beginning of the game I could not reach, thus having 6 casualties every few days. Therefore I lost the game really quickly.
If I altered the save game file (or is there another way), I would be able to make the game last for an infinite amount of time, which I would appreciate much, because I don't wanna start the game over and over again.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Edit Save Game File
« Reply #1 on: January 17, 2008, 06:47:54 pm »
you should load your savegame, set the cvar save_compressed to 0 and resave your game - then you can edit the savegame file without a problem

l1n00x

  • Guest
Re: Edit Save Game File
« Reply #2 on: January 17, 2008, 07:11:47 pm »
I did as you said, but the savegame file is only partly unencrypted/compressed... I also can't find the currently killed civilians.
Is there a way to change the maximum allowed number of civilians killed ?

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: Edit Save Game File
« Reply #3 on: January 17, 2008, 07:21:09 pm »
You can change the number of civilians by editing /base/campaign.ufo. You may need to decompress your 0ufos.pk3 first.

Note that if you edit your ufo files, you will not be able to play multiplayer anymore.

Zewock

  • Guest
Re: Edit Save Game File
« Reply #4 on: January 18, 2008, 04:06:53 pm »
How do you decompress it.

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: Edit Save Game File
« Reply #5 on: January 18, 2008, 04:44:08 pm »
It's just a zip file.

Dr Ludic

  • Guest
Re: Edit Save Game File
« Reply #6 on: February 03, 2009, 01:13:34 pm »
...set the cvar save_compressed to 0...

Hello,

How can I do that ?

thx

Edit: I play to 2.2.1 on PC

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: Edit Save Game File
« Reply #7 on: February 03, 2009, 06:09:41 pm »
open Console (^ or Shift-Esc ?)
type "save_compressed 0" and <Enter>.
resave your games.

odie

  • Guest
Re: Edit Save Game File
« Reply #8 on: February 05, 2009, 06:41:21 am »
You can change the number of civilians by editing /base/campaign.ufo. You may need to decompress your 0ufos.pk3 first.

Note that if you edit your ufo files, you will not be able to play multiplayer anymore.

Hi Zewock,

Not sure if u already figured out what BTAxis meant....

You will need a decompressor.... archiving tool.

The tool we are using here is 7zip (the dos version).

You can get it at:
7Zip Download

The batch file used to compress the pk3 files are:
(Extracted from \base\archives.bat)
Code: [Select]
rem NOTE: This batch file requires you to have the 7-zip command line utility, 7za.exe, in your path.
rem You can get this utility here: http://www.7-zip.org/download.html
rem -r recurse subdirectories. for example, this ensures that 0models.pk3 will contain stuff from "models\aliens" as well as "models".

7za a -tzip 0base.pk3 *.cfg irc_motd.txt -x!".svn"
7za a -r -tzip 0maps.pk3 materials\*.mat maps\*.bsp maps\*.ump -x!".svn"
7za a -r -tzip 0media.pk3 shaders\*.fp shaders\*.vp media\*.ttf -x!".svn"
7za a -r -tzip 0models.pk3 models\*.md2 models\*.md3 models\*.jpg models\*.png models\*.tga models\*.anm models\*.txt models\*.tag -x!".svn"
7za a -r -tzip 0music.pk3 music\*.ogg -x!".svn"
7za a -r -tzip 0pics.pk3 pics\*.jpg pics\*.tga pics\*.png textures\*.jpg textures\*.tga textures\*.png -x!".svn"
7za a -r -tzip 0snd.pk3 sound\*.ogg sound\*.wav -x!".svn"
7za a -r -tzip 0ufos.pk3 ufos\*.ufo -x!".svn"
7za a -r -tzip 0vids.pk3 videos\*.roq -x!".svn"

Hence, the file u will need is simply a reversal of the 7za command.
Where a = archives, e = extract, or u might want to try x for parameter.

For help on 7za,
Code: [Select]
Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -v{Size}[b|k|m|g]: Create volumes
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries

You might want to also consider repacking the pk3 files after editing the required files....