Character Editor v0.5 **BETA RELEASED**

Shagrath

Sergeant at Arms
WB
Best answers
0
M&B Character Editor

Current Version: v0.5
Release date: March 17, 2009 (BETA)


BETA RELEASE v0.5
First public release, please read this first:
  • This is a BETA release, the editor is far from finished but the basic functions work (edit, clone, new, ...)
  • Error catching is very limited at this moment, it's not fool/idiot proof in any way and will crash if you poke it the wrong way. Keep this in mind when screwing around; but please post any errors/bugs/comments.
  • The graphical design is very basic (read: crappy). Functionality is what I'm trying to improve now, layout can be done later.
  • Lots of improvements are on their way, how long it will take mainly depends on community interest.


--> DOWNLOAD BETA v0.5 (installer)
After installing you should be able to find it in your Start menu in the folder Character Editor

--> DOWNLOAD BETA v0.5 (zipped)
Some people pm'd me that the installer fails to install the .net framework and can't be completed.
This zip contains the executable, you may have to install .net framework 3.5, depending on your OS etc.

How to use:
1. In the game, go to your character page and click the "Statistics" button.
2. Export your character by click the appropriate button. (You can just alt-tab out now, no need to shut down M&B).
3. Install/launch the character editor (make sure you enter the correct path on installing)
4. Select your character, click "Load Character", make changes, click Update "Character"
5. Now back ingame click the import button and your editted character is loaded! (Unless you changed its name, duh)


Some of the planned features, ideas are welcome:

    • Edit your characters in a few clicks without risking typos or worse
    • Prepare new characters (all you'll have to do is create the character ingame and import)
    • Create character templates for mod testing
    • Batch operations (for example, raise all skills to 10 in a single click)
    • ...
    • Your idea here??
    • ...


    Too bad I can't make this for the actual savegames instead of exported characters... that would've been awesome :smile:


    Known bugs:
    • Editor crashes when trying to load a character without any character being selected (common error of non-idiot-proof-ness, will be fixed asap)
 

Shagrath

Sergeant at Arms
WB
Best answers
0
You don't... I've just started working on it a few hours ago ^^
Atm all you can do is install and edit name/xp/money and the amount of free attribute/skill/weapon points.
Expect a first release somewhere this weekend, maybe earlier don't know how much I'll be able to work on it this week.
 

Shagrath

Sergeant at Arms
WB
Best answers
0
First public release, see first post (read it, it's not that long).

Please give it a try and let me know if you find any errors/bugs/...
Comments are also very welcome.

I'm a bit tired right now (getting quite late) so chances are that I forgot something major. Please inform me of my possible failure before everyone has downloaded a copy. Thx.
 

KittenyKat

Recruit
Best answers
0
Sweet! Weird coincidence that I just started looking into this tonight and it was just released 12 hours ago.. xD

So, why can't you edit current savegames with this? Is there a way to do so manually without an advanced degree in programming? xD
 

Shagrath

Sergeant at Arms
WB
Best answers
0
Even with an advanced degree in programming, savegames are pretty impossible to edit at this moment (well, except for some, mostly useless, strings that explicitly appear in the savegame).
The moment someone cracks down the savegames I'll start making a savegame editor right away ^^

For now we'll have to go with character export/import, and that's what this editor is made for :smile:

Anyway, does the character editor work fine for you?


EDIT: Added a simple how-to-use to the first post, as I realised there wasn't one yet.
 

Shagrath

Sergeant at Arms
WB
Best answers
0
If it works for you, let me know (and if it doesn't too, ofc ^^).
I'd like to know it works for everyone before I continue working on it.
 

SPD_Phoenix

Master Knight
Best answers
0
I'm more interested in NPC editor, because character export/import work fine for me.

My current method of NPC editing is hex hacking. However, I can only edit attribute level, experience point (up/down level), available skill points/attribute points/weapon points (but can't find the existing points), available money. What I can't do is changing existing skill level and weapon proficiency. Looking at header_skills.py, it seems to be impossible to decode and change skill level just by looking at the numbers.

0F 00 00 00 0F 00 00 00 0F 00 00 00 0A 00 00 00 BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42 00 00 00 00 03 00 00 00 10 25 03 00 50 00 00 00 55 50 00 00 00 50 05 00 00 00 00 00 1A 10 00 10 00 00 00 00 00 00 00 00 39 A2 00 00 56 7A 02 00 00 00 70 42 01 00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 18 00 00 00
The above is an example of a NPC data block or part of the data block. Begin with attribute level (0F...0F...0F...0A). The next string "BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42" is what I suspect to be skills level (24 skills bit mask). Weapons proficiency may be next, but I can't figure out. IIRC, the "39 A2" is current available money. Skip to "56 7A 02" is the experience points. Then skip past "70 42 01", the first "02" is the available (unused) skill points, then available attribute point (is zero in this case), then available weapon points (02). I think the last "18" is the NPC current level. That's all I know for now.
 

Shagrath

Sergeant at Arms
WB
Best answers
0
SPD_Phoenix said:
I'm more interested in NPC editor, because character export/import work fine for me.

My current method of NPC editing is hex hacking. However, I can only edit attribute level, experience point (up/down level), available skill points/attribute points/weapon points (but can't find the existing points), available money. What I can't do is changing existing skill level and weapon proficiency. Looking at header_skills.py, it seems to be impossible to decode and change skill level just by looking at the numbers.

0F 00 00 00 0F 00 00 00 0F 00 00 00 0A 00 00 00 BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42 00 00 00 00 03 00 00 00 10 25 03 00 50 00 00 00 55 50 00 00 00 50 05 00 00 00 00 00 1A 10 00 10 00 00 00 00 00 00 00 00 39 A2 00 00 56 7A 02 00 00 00 70 42 01 00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 18 00 00 00
The above is an example of a NPC data block or part of the data block. Begin with attribute level (0F...0F...0F...0A). The next string "BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42" is what I suspect to be skills level (24 skills bit mask). Weapons proficiency may be next, but I can't figure out. IIRC, the "39 A2" is current available money. Skip to "56 7A 02" is the experience points. Then skip past "70 42 01", the first "02" is the available (unused) skill points, then available attribute point (is zero in this case), then available weapon points (02). I think the last "18" is the NPC current level. That's all I know for now.
SPD_Phoenix said:
I'm more interested in NPC editor, because character export/import work fine for me.

My current method of NPC editing is hex hacking. However, I can only edit attribute level, experience point (up/down level), available skill points/attribute points/weapon points (but can't find the existing points), available money. What I can't do is changing existing skill level and weapon proficiency. Looking at header_skills.py, it seems to be impossible to decode and change skill level just by looking at the numbers.

0F 00 00 00 0F 00 00 00 0F 00 00 00 0A 00 00 00 BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42 00 00 00 00 03 00 00 00 10 25 03 00 50 00 00 00 55 50 00 00 00 50 05 00 00 00 00 00 1A 10 00 10 00 00 00 00 00 00 00 00 39 A2 00 00 56 7A 02 00 00 00 70 42 01 00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 18 00 00 00
The above is an example of a NPC data block or part of the data block. Begin with attribute level (0F...0F...0F...0A). The next string "BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42" is what I suspect to be skills level (24 skills bit mask). Weapons proficiency may be next, but I can't figure out. IIRC, the "39 A2" is current available money. Skip to "56 7A 02" is the experience points. Then skip past "70 42 01", the first "02" is the available (unused) skill points, then available attribute point (is zero in this case), then available weapon points (02). I think the last "18" is the NPC current level. That's all I know for now.
I use a simple memory editor to accomplish that, if I need to change such things on my companions etc.
To edit npc's out of the game, you'd need to edit the savegames which isn't possible as far as we know.
Unless you edit the troops.txt file and start a new game, but that's not what we're after.

This tool however, is designed to simplify the editting of exported chars.
Yeah, you don't really need it, it's probably not as useful as the troop or item editor.. but it's something ^^
I really like the way I can just alt-tab between M&B and the editor, change a few things, save, alt-tab, import and done!
Will be even better once templates, batch operations etc. will be implemented.

If anyone knows a better tool I could make, please tell me, this was the most useful I could come up with :razz:
 

Shagrath

Sergeant at Arms
WB
Best answers
0
Updated first post, can anyone who downloads the .zip version give some feedback on it please?
I'm waiting to continue/release the next version until I get some feedback/bugs/...
 

jordan

Sergeant at Arms
WB
Best answers
0
SPD_Phoenix said:
I'm more interested in NPC editor, because character export/import work fine for me.

My current method of NPC editing is hex hacking. However, I can only edit attribute level, experience point (up/down level), available skill points/attribute points/weapon points (but can't find the existing points), available money. What I can't do is changing existing skill level and weapon proficiency. Looking at header_skills.py, it seems to be impossible to decode and change skill level just by looking at the numbers.

0F 00 00 00 0F 00 00 00 0F 00 00 00 0A 00 00 00 BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42 00 00 00 00 03 00 00 00 10 25 03 00 50 00 00 00 55 50 00 00 00 50 05 00 00 00 00 00 1A 10 00 10 00 00 00 00 00 00 00 00 39 A2 00 00 56 7A 02 00 00 00 70 42 01 00 00 00 02 00 00 00 00 00 00 00 02 00 00 00 18 00 00 00
The above is an example of a NPC data block or part of the data block. Begin with attribute level (0F...0F...0F...0A). The next string "BD 86 A5 42 4B 28 83 43 D9 03 92 42 F9 29 A4 42 75 85 84 43 A8 71 9E 42" is what I suspect to be skills level (24 skills bit mask). Weapons proficiency may be next, but I can't figure out. IIRC, the "39 A2" is current available money. Skip to "56 7A 02" is the experience points. Then skip past "70 42 01", the first "02" is the available (unused) skill points, then available attribute point (is zero in this case), then available weapon points (02). I think the last "18" is the NPC current level. That's all I know for now.
You're not quite right.  The green string you highlighted is the weapon proficiency.  It is actually stored as floating decimal numbers for some reason.  Each 4 bytes is a proficiency.  If I convert that string, your proficiencies were 82, 262, 73, 82, 265, and 79 (the last is firearms I think). 

After that is skill levels.  Each half of a byte is one skill.  I'll just quote myself in a topic about the troops.txt file:
jordan said:
If you want to edit skills in the text file you look at 5th line for that character in troops.txt.  For example, Marnid's 5th line in Native looks like:

3 131072 0 2 0 0

The first 5 numbers separated by a space represent his skills.  The 6th number may be reserved for future skill enhancements.  To change the starting skills, you must convert each number to hex.  Make it 8 digit hex, because each number can hold 8 skills.  So, the line above converted is:

00000003 00020000 00000000 00000002 00000000

Each digit is a skill, and can be 0-A.  Well, you could try 0-F, but F is 15, and I think the max for each skill is 10 (hex A), so F might break the game.

So which digit is which skill?  Here is a mapping in form x:y where x is the number and y is the digit from left to right:
1:1 Persuasion
1:2 <unused>
1:3 <unused>
1:4 <unused>
1:5 <unused>
1:6 Prisoner Management
1:7 Leadership
1:8 Trade
2:1 Tactics
2:2 Pathfinding
2:3 Spotting
2:4 Inventory Management
2:5 Wound Treatment
2:6 Surgery
2:7 First Aid
2:8 Engineering
3:1 Horse Archery
3:2 <unused>
3:3 <unused>
3:4 <unused>
3:5 <unused>
3:6 <unused>
3:7 Trainer
3:8 Tracking
4:1 <unused>
4:2 <unused>
4:3 <unused>
4:4 <unused>
4:5 Weapon Master
4:6 Shield
4:7 Athletics
4:8 Riding
5:1 <unused>
5:2 <unused>
5:3 <unused>
5:4 Iron Flesh
5:5 Power Strike
5:6 Power Throw
5:7 Power Draw
5:8 <unused>

You can see that Marnid has 3 Trade, 2 Inventory Management, and 2 Riding.  If you want to give him 10 Athletics, and 9 Horse Archery, you would need to change the hex to:
00000003 00020000 90000000 000000A2 00000000
Then convert it back to decimal:
3 131072 2415919104 162 0

If you replace Marnid's 5th line with the above and start a new game, he will have 10 Athletics and 9 Horse Archery. 

I figured this out because I'm thinking of writing a GUI for the Troops.txt similar to my item_kinds1.txt editor.
In your case, you already have the hex values, so you can skip the first part of the quote.  The second part explains what skill is where in the troops.txt file.  This post is old, there are new skills now, and the post pertained to the troops.txt, so I cannot vouch for the order (which half-byte is which skill), but you could find it out by finding your own character in the save file, exporting him and changing skills, and then checking the save file again.
 

SPD_Phoenix

Master Knight
Best answers
0
You're not quite right.  The green string you highlighted is the weapon proficiency.  It is actually stored as floating decimal numbers for some reason.  Each 4 bytes is a proficiency.  If I convert that string, your proficiencies were 82, 262, 73, 82, 265, and 79 (the last is firearms I think). 

After that is skill levels.  Each half of a byte is one skill.
Excellent. You solved the mystery for me. Now I can make some "corrections" to my band of heroes.
 

jordan

Sergeant at Arms
WB
Best answers
0
Shagrath,

I'd been thinking of creating a character editor to edit troops (yourself, companions, and any other) using the save files.  However, I have not yet found a programatic way to locate the area where troop data starts.  I can do it manually with a hex editor by searching for the experience values for the troop I want to edit, since those are pretty unique, but I don't yet know enough about the layout of the save file to start coding.

If I can figure it out, and if you're interested, I was thinking of coding a .NET dll that you can call to extract a troop's save data into a text file similar to the export file created by the game.  Then you might be able to use most of your character editing code to change the values.  After that, a call to the dll could write those new values back to the save game file.
 

HokieBT

Grandmaster Knight
M&BWB
Best answers
0
Jordan - that would be very cool, I think any type of a saved game editor would be a huge help.  I've looked at this off and on, but never could really figure out the best way to get started or exactly how to translate all the files, etc.  I was hoping for something to editor my players inventory to make testing models easier, but an import/export of troop data would be very cool as well.
 

Shagrath

Sergeant at Arms
WB
Best answers
0
jordan said:
Shagrath,

I'd been thinking of creating a character editor to edit troops (yourself, companions, and any other) using the save files.  However, I have not yet found a programatic way to locate the area where troop data starts.  I can do it manually with a hex editor by searching for the experience values for the troop I want to edit, since those are pretty unique, but I don't yet know enough about the layout of the save file to start coding.

If I can figure it out, and if you're interested, I was thinking of coding a .NET dll that you can call to extract a troop's save data into a text file similar to the export file created by the game.  Then you might be able to use most of your character editing code to change the values.  After that, a call to the dll could write those new values back to the save game file.
If you could really accomplish this, you'd be doing me and lots of others a big favor :grin:
The charexport editor is written in VB.Net (saw no reason to use c# or others, and VB.Net is what I'm most experienced in) so we could indeed work on from there.

I would be very pleased to work on this with you, perhaps we should discuss some stuff over pm/mail/msn?


@HokieBT: Would you join us in our holy quest? As far as I know you're the expert when it comes to M&B editors :grin:
 

jordan

Sergeant at Arms
WB
Best answers
0
HokieBT said:
Jordan - that would be very cool, I think any type of a saved game editor would be a huge help.  I've looked at this off and on, but never could really figure out the best way to get started or exactly how to translate all the files, etc.  I was hoping for something to editor my players inventory to make testing models easier, but an import/export of troop data would be very cool as well.
I think I've located where the inventory was stored some time back.  I'd have to look at the file again, but I think it is stored by the item number.  And I think the troops are stored by troop number as well; there doesn't appear to be companion names, for instance, in the save game file.

Shagrath said:
If you could really accomplish this, you'd be doing me and lots of others a big favor :grin:
The charexport editor is written in VB.Net (saw no reason to use c# or others, and VB.Net is what I'm most experienced in) so we could indeed work on from there.

I would be very pleased to work on this with you, perhaps we should discuss some stuff over pm/mail/msn?


@HokieBT: Would you join us in our holy quest? As far as I know you're the expert when it comes to M&B editors :grin:
I'm optimistic I can find a programmatic way to locate each troop in the save game file, but it really depends if my wife allows me the time needed to look at it. :wink:

I do C# for a living, so I'll code the dll in that; it shouldn't make a difference if your code is VB.Net. 

If you (and hopefully Hokie) can take a look at your save game files, I'll do the same, and then we can discuss any findings.  I do have an IM account - [email protected] .  I'm at work now, but if you guys want, send me an add request, and I'll add you guys.  I'm on central time US (Chicago).  Does this work for you guys?