Save-game importer/exporter

Users who are viewing this thread

fisheye

Has anyone written one of these yet? For character transfer (just stats and items, no global vars or map events) across fixed versions / modules given knowledge of how the item table has changed.
 
I dont think anyone did so yet. At least i dont know such a thing. Also i dont know how hard/useful such a thing would be.

Items for example may be bound to quests, so transfering them would mess the game up and stats alone can be recreated with cheats if you want to.
 
I've stared at the save files using a hex editor and it doesn't seem too hard to implement. There's a very small element of chance involved since I haven't nailed down what that last extra party at the end of the parties data structure is... but I can locate the troops data structure in the savegame of any mod with 99% accuracy.

My next project is going to be a save game editor, followed by a character-transfer utility that allows you a limited capability to move your character (with stats and inventory intact) and NPCs from one module to another.
 
Since Thorgrim expressed interest, I'm posting my plan of attack on this one. Current as of v0.711.

Goal: Find the start of the Troops data structure

It appears that the Parties data structure is right before the Troops data structure in the save file. This is a good thing since the beginning of the Parties data structure is easily recognisable: the text string "p_main_party" is stored in the file.

(side note: words in M&B are 4 bytes long, little-endian).

Furthermore each entry of the parties data structure follows the format of the .txt files: 2 words (typically 1, 0), followed by a string for the party id (or template id) and a string for the name of the party, followed by 19 words of blah blah (location, ai behavior, etc etc) followed by a list of troops: 1 word indicating the number of troops, and each troop entry is 4 words, following .txt format exactly. After the troops field is 3 words, I think they are morale, hunger and fatigue.

Unfortunately at the end of the parties data structure, sometimes there is an unrecognisable party entry with no identifier and no name, and it's really hard to make out how long it's supposed to be. I'm punting on that one.

The troops data structure is easy to find on account of the inventories. Each troops stores its inventory in triplicate (initial inventory, battle inventory???, current inventory???), each copy has 32 item slots. Each item consists of 2 words: item id and imodbits. If no item is in that slot, then the item ID is -1 (FF FF FF FF) and the imodbits is typically 0 but could be some rubbish value left over in memory (typically less than 255). So, to find where the troops record starts, we go to the end of the parties data structure, search for a multiple occurrence of FF FF FF FF 00 00 ?? ?? FF FF FF FF 00 00 00 ?? ...). The beginning of the troops data structure (corresponding to the main character's Strength) is exactly 64 words (256 bytes) before this location. As a sanity check, the word before this should be the number of troop types in the module (i.e. 43 in Native).
 
Lu Bu said:
I dont think anyone did so yet. At least i dont know such a thing. Also i dont know how hard/useful such a thing would be.

Items for example may be bound to quests, so transfering them would mess the game up and stats alone can be recreated with cheats if you want to.

I personally think this would be pretty handy. With new versions of mods and such constantly being released I'm starting to get tired of starting new characters over and over.

Yeah, you can kind of boost your character a bit using the cheats but... those are CHEATS... nobody really wants to use them if there is a better option. Plus cheats can only boost your level, that doesn't help your weapon skills or restore a party of 30 Hired Blades you spent hours of play time training...
 
well, the inbuilt cheats will actually allow you to train troops up quickly, give you XP and money, there is also the character editor that was around while ago that alows you to edit everything you have, from xp to you weapon points, altho haven't managed to edit proficiencies before, only thing that seems not to work
but the character editor is one way of getting around having to cheat, but to train troops, the only way is with the xp cheat
 
I think I recall training outer heroes in the party with the XP cheat once but unless there is something major I'm missing, I don't think you can use it to train regular stackable troops.
 
You can use the cheats to upgrade normal troops too. At least there is a cheat for upgrading them, or does it not work?
 
I know there are cheats, but that's not the purpose of this utility (or this thread).

The real goal is to make a character transfer utility to enable multi-module storylines. :smile:
 
pere said:
Transferring characters would be a good thing, much better than having to mess around with the cheats.

Exactly what I'm saying. This would be a great utility that would save you the time of having to level a new character up every time you start a new mod or download a new version.

If there is a cheat to level regualr troops, its not listed on the cheats thread on the forum.
 
The cheat to level normal troops is the same as the normal one you just have to select the troop in the pary window and hit ctrl + X (takes several times for High level troops)
 
Is it really worth it now? Your planning on mapping out a saved file's structure to be able to transfer chars from a mod to another, but are we sure of the stability of the file's structure?

Of course, if you think you can figure out what you need quickly, go for it. Otherwise, if you need help, we can probably help.

sv
 
A lot of the operatons to store character data are already defined in the header_operations.py file.

I think the big issue is going to be transferring non-standard items between mods. Most everything except equipment is accessible to store (IIRC) - but if you bring items along, the target mod must have the right definitions for them etc, etc..

AFAIK

DE
 
Deus Ex said:
I think the big issue is going to be transferring non-standard items between mods. Most everything except equipment is accessible to store (IIRC) - but if you bring items along, the target mod must have the right definitions for them etc, etc..

Should be easy since the data files are in txt, very readable.

If item doesn't exist in dest. mod, discard. Easy.
 
For starters, you could create a quick little tool for removing the 'kidnapped daughter' from .730 savegames. :cool:
 
SharkD said:
For starters, you could create a quick little tool for removing the 'kidnapped daughter' from .730 savegames. :cool:

Thread Necromancer die! :razz: And also now you can export your chars without any prog, so its no longer needed. Also who knows if the problem with the girl still is there in 730?
 
Lu Bu said:
And also now you can export your chars without any prog, so its no longer needed.

Yup. I'm bloody relieved I never actually started on this program, since it'd now be as outdated as Simpson's savegame editor.
 
Back
Top Bottom