Savegame Editing
This guide works for 0.E (Ellison)
This page is not complete enough; please help if you can. The topic needs: more prowling in the source-code, some help on NPCs (doubt it is even really possible without breaking stuff) |
Where to find your savegame and world files
Mac OS X: (Home Dir)/Library/Application Support/Cataclysm ... the ~/Library folder is hidden, so you'll have to do Cmd+Shift+. in order to show them if they're not already visible.
Linux: ~/.cataclysm-dda
Windows: (C:DDA install directory)\save
Editing your savegame
The savegame files for Cataclysm: Dark Days Ahead are all saved on a (most of the time) easily readable format, it is possible to simply open and edit them with any text editor. You can move your character(s) between worlds/versions - useful when using the unstable branch - or edit your location in world. You can add a vehicle someone else made to your map right next to your character or edit such character giving him whatever bionics, mutations and items you wish.
To edit files, you can any text editor which supports large-files (not limited by memory) like Notepad++, jEdit (cross-platform), Vim or Emacs (a little bit hard to use but most powerful than any of the available Text-Editors on the market, provided you know how to use it). Any compatible Text-Editor is enough, you should use the one you know how to use or the one you're used to.
Editing your character
To edit your character you only need to edit its associated file:
- [character_name].sav
Cataclysm though uses a different name when saving your character, so the best way to find this file is to save your character and them lookup for the most recently modified '.sav', that will be the one. Once you open it, the data is pretty self explanatory. Here are the interesting categories:
"player": Contains all the data of your character, such as stats and effects. Also contains a male = true line you can change if you want to change sex without restarting. "traits": Subcategory where you can access your traits "skill": Your skills "my_bionics": All of your bionics
You can edit this file just as you'd edit any other, but make sure you are using either a plain text editor (notepad) or a source-code editor (Notepad++, Scintilla) else you'll corrupt the file
Moving characters and optionally vehicle
Last tested for 0.E (Ellison) worked for both the vehicle and the character, if you encounter errors, mention them on the talk page please.
This is how you can move your character between different worlds on the same or different revisions. Keep in mind strange mysterious things may happen if you move not only to a different world, but to a different version (0.8 (Romero) or 0.9 (Ma) to 0.A (Kaufman), for instance). If you want to move between versions and worlds, it is better to first load your old save in the new version, and save that (after working through the bugs) and then transfer your character to a new world. (Moreover, it is best to move one version step at a time - from 0.C (Cooper) to 0.D (Danny) before trying loading into 0.E (Ellison), for instance.)
BACK UP YOUR FILES FIRST!
Transferring character and vehicle (plus contents) between worlds in C:DDA
Terms used:
- SourceChar (character in old world, to be transferred to new world)
- TargetChar (character in new world, sacrifice to be converted into SourceChar, all equipment, skills, and stats, etc will be lost)
- SourceCar (car in old world, must have a unique name, if in doubt name it sourcecar before saving your game and doing the transfer)
- TargetCar (car in new world that is unimportant, will be removed from reality and replaced with old vehicle, must have a unique name, if in doubt name it targetcar)
Important files from old save: (The 'encoded_character_name' part which looks like random gibberish is your character name in base-64, and can be read using something such as an base64 decoder)
- [encoded_character_name].sav
- [encoded_character_name].log
- [encoded_character_name].apu.json
- artifacts.gsav - optional if you have artifacts
- uistate.json - optional if you have filter settings.
Pre-transfer instructions:
First off, go to your vehicle and make sure it has a unique name with the e key, SourceCar is the default used in this guide. After making sure of that, stand outside in open space on the surface (not above or below ground or in a vehicle) and save your game.
Second, create a new world with the same mods (or a compatible modlist, you can usually also add mods) and create a character in that world. Go find a car in a large open space such as in between cities on a road and rename it to a unique name - TargetCar will be used in this guide.
Transfer step one: character save files
Find your save in: '[path to cataclysm]\save\[name of your world]'. Backup old save and copy needed files to the new directory. The majority of the files in your old save will not be used, so you can either backup the save, or just copy the few files you need to edit and delete the old save. Inside your old save folder, you will find a number of files with a large 'gibberish' name including .log, .apu.json, .sav -- these are your character data files, and need to be saved. In addition, if you have artifacts you need to copy artifacts.gsav over. If you would like to save your filter settings, also copy over uistate.json.
Transfer step two: locate final important files
Next you need to find the specific map file your vehicle is in. The easiest way to do this is to use your computers 'last changed/modified' system for the files. Don't play for a short while, load the game, dropping or picking something up, and save and quit -- this will save just nearby areas, leading to an easy to check 'modified' time - you can then delete everything that was not modified recently and have much less to check. You will see a large number of folders in the map directory, but you can also cut it down further by deleting any that do not end in .0 -- these are ground level, and your vehicle is most likely on the surface. Locate the proper map file (open recently saved ones and search for TargetCar - the file you find it in is the only file you need) and once you have it found, locate your vehicle data inside of it. Do this for both old and new worlds, as we need to access both vehicles.
Transfer step three: vehicle transfer
Once you have your vehicle's name located in a .map file, find the full data from the start. This will look something like the following at the start:
{"type":"car","posx":0,"posy":10,"om_id":0,"faceDir":180,"moveDir":0,"turn_dir":180,"velocity":0,"falling":false,"cruise_velocity":0,"vertical_velocity":0, "cruise_on":true,"engine_on":false,"tracking_on":false,"skidding":false,"of_turn_carry":0.000000,"name":"SourceCar","parts":[{ ... etc
To fully select the vehicle, it is easiest to use something that highlights brackets, such as Notepad++ - we need to copy the entire vehicle data to an empty file to verify it as well as swap out some basic values. For Notepad++, put the cursor before the {"type":" and hit enter to split it onto a new line, then ctrl+b to go to the matching bracket, and once behind it, hit enter again to split the vehicle completely out of the mess. For reference, the last bit of the vehicle data should be something similar to "autodrive_local_target":[0,0,0]} with either more vehicle data after that for other vehicles, or ]} for the end of the local area. After that, you can easily copy it to a new notepad sheet to work on easier, and it is easy to undo the steps to put it back if you have not made a backup.
Repeat this process to locate your TargetCar in the new save and copy it out of the save into its own empty file as well. Once this is done, you need to copy some values (starting from the posx part up to just before the name part) from the TargetCar to the SourceCar - this makes sure that when you put the vehicle into the new save that it will be facing the same way, same speed, etc. After that is done, place the entire chunk of SourceCar into the map file in the new save where TargetCar came from, and ensure it is back in proper shape (all one line, not missing any brackets) and then save the file. This should place your vehicle from the old save into the new save where the sacrificial TargetCar was sitting.
Transfer step four: character transfer
Once that is done, all the remains is the character. In this case, open the 'gibberish'.sav from both your new and old worlds. The following needs to be copied from the TargetChar to SourceChar before moving it:
mostseen, levx, levy, levz, om_x, om_y, grscent, active_monsters, stair_monsters
When those have been replaced, search for active_mission and set the value to -1, then you need to delete everything from the following sections (everything between the brackets beside them):
active_missions, completed_missions, failed_missions, known_traps
Finally, we need to set the location of our player. Do a search in your text editor for the line that starts with "player"
. The first entry within this object should be called "location"
. Copy the location coordinates in square brackets from TargetChar to SourceChar.
After performing all the above steps, copy your entire SourceChar and replace TargetChar with it (be careful to copy the files in the folders, not the contents of the .sav files). The changes you have made will prevent any issues with missions by clearing mission data, prevent potential ghost traps by removing remembered trap data, and place your character where the sacrificial character was previously located.
Transfer step five: final transfer
Next we simply need to copy over the .log, .apu.json, artifacts.gsav, and uistat.json (last is optional, artifacts.gsav only needed if you or your vehicle has artifacts) -- keep in mind the .log and .apu.json need the same name as the .sav to be properly used, in case you have changed the character name between the worlds.
|