[Outdated] Character Editor v0.5 **BETA RELEASED**

Users who are viewing this thread

hehe, I definitely wouldn't call myself an expert on M&B editors.  Jordan actually helped me understand the troops file and my programming skills are pretty basic. One reason why I did the troop editor was it had been a few years since I had programmed and I wanted to practice.  :smile:  Now, I have wanted to do a saved game editor for a while and think it would be a huge help to the community.  I can re-format a text file easy enough, but I get lost when it comes to all the binary or hex editing (actually, anything math related), so I'm not sure I'll be a lot of help with the saved games....  I also don't have a lot of free time in real life, so usually am not on a chat or anything like that.  But I'll monitor this post, and feel free to copy me on any PM's, and I'll also try and take another look at the file and see if I can find a way to contribute.
 
HokieBT said:
hehe, I definitely wouldn't call myself an expert on M&B editors.  Jordan actually helped me understand the troops file and my programming skills are pretty basic. One reason why I did the troop editor was it had been a few years since I had programmed and I wanted to practice.  :smile:   Now, I have wanted to do a saved game editor for a while and think it would be a huge help to the community.   I can re-format a text file easy enough, but I get lost when it comes to all the binary or hex editing (actually, anything math related), so I'm not sure I'll be a lot of help with the saved games....  I also don't have a lot of free time in real life, so usually am not on a chat or anything like that.   But I'll monitor this post, and feel free to copy me on any PM's, and I'll also try and take another look at the file and see if I can find a way to contribute.
I'll do some digging into my savegames tomorrow (I'm from belgium, 21:36 atm) and see if I can find anything useful.
Also, I'll be gone from tomorrow till next week saturday (mayb even sunday) on holiday, great timing as always >.<

Really looking forward to this, will be a nice practice for my VB.Net skills :smile:
 
I couldn't get the download to run. It gave me some 'application is missing files' error.

Oof. On the side topic of npc editing, I need to take some time to digest what Jordan posted. I started looking for an editor in the first place because I wanted to shift all my companions' skill points in UTTERLY USELESS ( for companions >.>; ) SKILLS like Leadership and Inventory Management to something actually worth having T.T Honestly, I guess it gives them a little flavor, but who needs someone with 7 in inventory management when it has no impact on how many items you can carry? Or they can, for that matter? D:

Are all the companions together in troops.txt, or spread around?
 
they are together in troops.txt, before the section with lords/ladies I think.

Did you get .net framework 3.5 installed? Because, from what I've noticed, people that get problems with the installer get stuck on installing .net framework and not my actual application :s
 
It didn't even get that far, just when I tried to open the program at all it errored/crashed. I'll redl it in a bit and try again :3

Edit: Same problem as before. Here's a copy of the error file it generated:

PLATFORM VERSION INFO
Windows : 5.1.2600.196608 (Win32NT)
Common Language Runtime : 2.0.50727.3053
System.Deployment.dll : 2.0.50727.3053 (netfxsp.050727-3000)
mscorwks.dll : 2.0.50727.3053 (netfxsp.050727-3000)
dfdll.dll : 2.0.50727.3053 (netfxsp.050727-3000)
dfshim.dll : 2.0.50727.3053 (netfxsp.050727-3000)

SOURCES
Deployment url : file:///D:/Downloads/Character%20Editor.application

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of D:\Downloads\Character Editor.application resulted in exception. Following failure messages were detected:
+ Downloading file:///D:/Downloads/Character Editor.application did not succeed.
+ Could not find file 'D:\Downloads\Character Editor.application'.
+ Could not find file 'D:\Downloads\Character Editor.application'.
+ Could not find file 'D:\Downloads\Character Editor.application'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [3/20/2009 8:51:01 AM] : Activation of D:\Downloads\Character Editor.application has started.

ERROR DETAILS
Following errors were detected during this operation.
* [3/20/2009 8:51:01 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading file:///D:/Downloads/Character Editor.application did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- Could not find file 'D:\Downloads\Character Editor.application'.
- Source: System
- Stack trace:
at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.FileWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
--- Inner Exception ---
System.Net.WebException
- Could not find file 'D:\Downloads\Character Editor.application'.
- Source: System
- Stack trace:
at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
at System.Net.FileWebRequest.GetResponseCallback(Object state)
--- Inner Exception ---
System.IO.FileNotFoundException
- Could not find file 'D:\Downloads\Character Editor.application'.
- Source: mscorlib
- Stack trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
 
I was able to look at a few save game files for a few minutes last night before my wife started nagging me.  I'm at work now, but from what I remember:

1) The file starts with 5 or 6 bytes that seem to be common between each save file (I can't remember the exact count)
2) There is a 32 bit int indicating the length of the player name, followed by the player name
3) There is a 32 bit int indicating the length of the player name, followed by the player name (yes, it's in there twice).
4) There is a section of unknown bytes that runs after the second player name for 0x76??? bytes (same amount of bytes in 3 save files I checked)
5) There is a 32 bit int indicating the length of the history section (log of happenings in the game world) followed by the history
6) ??? This section seems to be a b*tch to figure out, at least in the little time I had.  Lots of 0x0 bytes, and lots of sections of 8 consecutive 0xff bytes.  This may represent mission template data, as I saw some text intermittently in the file. 

So that's as far as I got, and I was still a far way off from the troop data. 

I wonder if there's any chance of the developers sharing some info on the file layout?  Anyone have a contact they can ask?
 
jordan said:
I was able to look at a few save game files for a few minutes last night before my wife started nagging me.  I'm at work now, but from what I remember:

1) The file starts with 5 or 6 bytes that seem to be common between each save file (I can't remember the exact count)
2) There is a 32 bit int indicating the length of the player name, followed by the player name
3) There is a 32 bit int indicating the length of the player name, followed by the player name (yes, it's in there twice).
4) There is a section of unknown bytes that runs after the second player name for 0x76??? bytes (same amount of bytes in 3 save files I checked)
5) There is a 32 bit int indicating the length of the history section (log of happenings in the game world) followed by the history
6) ??? This section seems to be a b*tch to figure out, at least in the little time I had.  Lots of 0x0 bytes, and lots of sections of 8 consecutive 0xff bytes.  This may represent mission template data, as I saw some text intermittently in the file. 

So that's as far as I got, and I was still a far way off from the troop data. 

I wonder if there's any chance of the developers sharing some info on the file layout?  Anyone have a contact they can ask?

1. Could be the game version? Dunno just guessing, it would make sense they put that in the start of the file so, it's possible.

And yeah would be great if dev's could lighten our "mission impossible" a bit :razz:

Good work, keep going... while I'm a week off on holiday :razz:
Sorry about that, bad timing I know... first thing I'll do when I get back is check this topic and my pm's, I promise ^^
 
jordan - yeah, when I tried looking at this a while back I basically came to the same conclusion that it was going to be a ***** to figure out.  :wink:    Either I'm not smart enough or don't have enough time to do it.  hehe.    Maybe we can start in small increments, first edit the name, then the stats or experience, etc....

KittenyKat said:
Oof. On the side topic of npc editing, I need to take some time to digest what Jordan posted. I started looking for an editor in the first place because I wanted to shift all my companions' skill points in UTTERLY USELESS ( for companions >.>; ) SKILLS like Leadership and Inventory Management to something actually worth having T.T Honestly, I guess it gives them a little flavor, but who needs someone with 7 in inventory management when it has no impact on how many items you can carry? Or they can, for that matter? D:

Are all the companions together in troops.txt, or spread around?

If you just want to edit the NPC skills then you could just use my troop editor.  You will probably need to start a new game tho....
http://forums.taleworlds.com/index.php/topic,34154.0.html
 
Yeah I found it and have been tinkering with it since my last post, but you think you could add a field to edit how many skill points they have unspent? That way I could decide how to reassign them ingame on a case-by-case basis :3
 
KittenyKat said:
Yeah I found it and have been tinkering with it since my last post, but you think you could add a field to edit how many skill points they have unspent? That way I could decide how to reassign them ingame on a case-by-case basis :3
I don't believe that information is stored in the troops file, it would probably have to be assigned with a script or editing the saved game, etc. 
 
I think character inventory is stored right after the character level. Each item is stored with 8 bytes. Start with:
- Item ID (1 byte)
- Don't know about the next 3 bytes.
- Next 2 bytes is item hitpoint. For food item, store the amount consumed. I think this one is a 2 bytes value.
- Don't know about the 7th byte.
- The 8th byte is item modifier (the one in game folder\data).

Empty inventory slot will be "FF FF FF FF" and the next 4 bytes seems to store info ralated to whatever previously stored in that inventory slot. I got bunch of item modifiers that seem to belong to the looted items I just sold.

The currently equiped items are stored last. There are two set of horse data that seems to be the previously ridden? I'm not sure. Then weapon slots and armor slots and curent riding horse last.

Next is the character info: vassal of, current faction, current renown (not sure if editable), current fiefs.

I will try to alter the inventory, make some changes and compare the save later.

@ Shagrath,
Sorry for hijacking and derailing your original inteded subject.
 
SPD_Phoenix said:
I think character inventory is stored right after the character level. Each item is stored with 8 bytes. Start with:
- Item ID (1 byte)
- Don't know about the next 3 bytes.
- Next 2 bytes is item hitpoint. For food item, store the amount consumed. I think this one is a 2 bytes value.
- Don't know about the 7th byte.
- The 8th byte is item modifier (the one in game folder\data).

Empty inventory slot will be "FF FF FF FF" and the next 4 bytes seems to store info ralated to whatever previously stored in that inventory slot. I got bunch of item modifiers that seem to belong to the looted items I just sold.

The currently equiped items are stored last. There are two set of horse data that seems to be the previously ridden? I'm not sure. Then weapon slots and armor slots and curent riding horse last.

Next is the character info: vassal of, current faction, current renown (not sure if editable), current fiefs.

I will try to alter the inventory, make some changes and compare the save later.

@ Shagrath,
Sorry for hijacking and derailing your original inteded subject.
Thanks, please continue messing around with individual troops.  I'd be particularly interested to know if each troop has the same number of fields (byte count for each troop data is the same, etc).  If you can map it out, that would help alot.  For now I'll concentrate on how to get to the start of troop text starting from the beginning of the file.
 
A little update on my hex hacking process:

It seems that each NPC character has the same data block size. Base on all NPCs that I can access (have a way to locate them), I obtain the address different between the 1st known data (STR attribute) of the two consecutive character, I got 3140 (bytes?) for all. Known data within the block (as posted above):

* Note: as I state the data length, I do not know where the data actually start or the actual length. I just state the block length from one data to another.

- Character attributes: STR is the 1st known data. Seem to be a 4 bytes block for each attributes.
- Character weapon prof: 4 bytes for each prof. 6 weapons (including firearm).
- 4 bytes unknown.
- Skill level: half a byte each. At least 21 bytes for all skills including the reserved ones. Seems to be a full 24 bytes block
- Some unknown data. 12 bytes.
- Character money. Seems to be 4 bytes. May be longer?
- Character experience. Seems to be 4 bytes long or may be longer.
- Some known data. 8 bytes.
- Unused skill points. 4 bytes.
- Unused attribute points. 4 bytes.
- Unused weapon prof points. 4 bytes.
- Character level. 4 bytes.
- Character inventory. 8 bytes for each item. Start with 1 byte for item ID and the last byte is item modifier. 5th and 6th may store the item hitpoint or ammo used (for food items). This data block is reserves for the full inventory space at level 10. IIRC, that is 96 inventory spaces.
- Character's current equipped weapons (top slot down). 8 bytes each. Seems to have the same structure as normal inventory.
- Character's current equipped armor (head, body, feet, hands). 8 bytes each just like other inventory items.
- Character's current riding horse. 8 bytes just like others.

- For player, the next block is for current faction, vassal, renown, fiefs. Unknown size.

Based on the offset addresses of the characters that I can locate, player character listed first then follow by the NPCs. NPCs seem to follow the same order as they are defined in the module_troops.py (or their ID number).
 
damn, that is some good info!  While I basically understand it, my programming skills are probably not up to trying to code something like this...  I'm pretty busy in real life but if I get some time I may try and play around a little bit, but doubt I'm going to be of much help unfortunately.  Something to make a few changes to saved games would be a major help tho, especially allowing the ability to switch items since that would make testing SOO much easier...
 
SPD_Phoenix said:
A little update on my hex hacking process:

It seems that each NPC character has the same data block size. Base on all NPCs that I can access (have a way to locate them), I obtain the address different between the 1st known data (STR attribute) of the two consecutive character, I got 3140 (bytes?) for all. Known data within the block (as posted above):
* Note: as I state the data length, I do not know where the data actually start or the actual length. I just state the block length from one data to another.
Hopefully all characters data is the same size then; that makes it easier to code.

- Character attributes: STR is the 1st known data. Seem to be a 4 bytes block for each attributes.
- Character weapon prof: 4 bytes for each prof. 6 weapons (including firearm).
- 4 bytes unknown.
- Skill level: half a byte each. At least 21 bytes for all skills including the reserved ones. Seems to be a full 24 bytes block
- Some unknown data. 12 bytes.
- Character money. Seems to be 4 bytes. May be longer?
- Character experience. Seems to be 4 bytes long or may be longer.
- Some known data. 8 bytes.
- Unused skill points. 4 bytes.
- Unused attribute points. 4 bytes.
- Unused weapon prof points. 4 bytes.
- Character level. 4 bytes.
- Character inventory. 8 bytes for each item. Start with 1 byte for item ID and the last byte is item modifier. 5th and 6th may store the item hitpoint or ammo used (for food items). This data block is reserves for the full inventory space at level 10. IIRC, that is 96 inventory spaces.
- Character's current equipped weapons (top slot down). 8 bytes each. Seems to have the same structure as normal inventory.
- Character's current equipped armor (head, body, feet, hands). 8 bytes each just like other inventory items.
- Character's current riding horse. 8 bytes just like others.

- For player, the next block is for current faction, vassal, renown, fiefs. Unknown size.
Thanks for the work; it should be easy enough to code a dll to edit the player data, BUT I'm still unable to find a way to get to the first player programatically.  Manually, you can search for your experience to find it, but I don't want to code a dll that you have to provide the player's data offset.  I've actually sent an inquiry to Armagan, but I haven't heard back yet.  Is there someone else on the development team we can contact, as I assume Armagan is the hardest to get hold of?

Based on the offset addresses of the characters that I can locate, player character listed first then follow by the NPCs. NPCs seem to follow the same order as they are defined in the module_troops.py (or their ID number).
I assumed it would have to be this way, otherwise the game would not know what data was for which character as there does not appear to be troop names in the save game file.
 
Back
Top Bottom