Author Topic: Unofficial Troop Editor 1.9 for troops.txt file  (Read 185196 times)

0 Members and 1 Guest are viewing this topic.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Unofficial Troop Editor 1.9 for troops.txt file
« on: March 21, 2008, 05:47:22 AM »
I wrote an Unofficial Troop Editor for Mount & Blade which allows direct editing of the troops.txt, parties.txt and party_templates.txt files and should be compatible with M&B 0.9 - 1.x and M&B Warband. This allows viewing and modifying the following information:
  • troop names
  • troop attributes
  • troop proficiencies
  • troop skills
  • troop items
  • troop upgrade paths
  • troop flags
  • troop factions
  • troop faces
  • troop skins
  • parties
  • party templates

This could be useful to better balance individual troops and factions for your own personal use or possibly to create a new mod for Mount & Blade. Even if this is not used to directly edit the files this may be useful as a modding tool since it allows the ability to easily review troop information which may be helpful in balancing the game when making mods. I've done testing with this on several versions and everything seems to work fine but please let me know if there are any problems.  A screenshot and link to download is below:



DOWNLOAD - http://www.mbrepository.com/file.php?id=709



NOTE: Unfortunately, I no longer have time to work on this editor or mod M&B. I have updated this post with as much troubleshooting information as I can and the source code is also available as well.  If you have a question with this editor then I suggest posting it in this forum.  Morgh and k0nr@d have also created text editors, links below, that you can use as well.  I really appreciate and wanted to thank everybody again that has enjoyed this program and the rest of the Taleworlds community for their help. I will try to check back in the future and respond to PM's if possible, but my free time is very limited so I wanted to say thanks again and wish everybody the best of luck!

official goodbye thread - http://forums.taleworlds.com/index.php/topic,24796.msg3185096.html#msg3185096



Additional Notes:

Morgh's Text Editor - Morgh is working on a text editor that is similar or most likely better then mine.  I recommend checking out the thread below if you are interested in trying this on as well:
http://forums.taleworlds.com/index.php/topic,105928.msg2606968.html

k0nr@d Excel Editor - k0nr@d also has an excel based text file editor that you can download in the thread below:
http://forums.taleworlds.com/index.php/topic,117997.0.html

Changes and Saved Games - A lot of information in these text files are also saved within your saved game file so any changes made with the troop editor may not take effect immediately in your saved game. When testing saved games some changes seem to take effect immediately, some after waiting several days of game time for a new troop or party to spawn on the map, and some never update. This behavior may have also switched between version 0.9x and 1.x and the M&B developers would be the only ones that could tell us exactly what changes would and would not work.  Therefore, if you are modifying these text files and want to guarantee that your changes are working you should start a new game.

NOTE:     It is possible to refresh the module data so some changes can be visible in saved games.
               1) You need to enable edit & cheat mode in the M&B configuration menu
               2) Then press CTRL+M on the world map in-game
               3) You should see a message that it was refreshed. 

I do not know exactly what this functionality does but it has been helpful when doing some testing and not having to always start a new game each time.  However, if you want to guarantee your changes work then you need to start a new game.


Adding new Troops - Troops are referenced in other files by a troop number, therefore it is not possible to add new troops to the middle of the text file without messing up the rest of the game.  It is possible to add new troops to the bottom of the file and then add them into the party_templates or as an upgrade path.
+ Balrog wrote a text summary of this process:  http://forums.taleworlds.com/index.php/topic,34154.msg1259116.html#msg1259116
+ skiddledou wrote a summary with pictures:  http://forums.taleworlds.com/index.php/topic,68375.0.html

Changing Gender and Skins - This editor allows you to switch the gender and also to choose order skins (ie. races) in the game.  There is an undead troop in the Native game which is Skin 2 and other mods may have added additonal skins.  Switching between Male & Female should not cause a problem, but using other skins may cause problems.  If you want to use Skin 2 or higher then you need to make sure you have limit_hair_colors = 0 in your module.ini and also that that Skin # exists in the skins.txt file.

Backup your files - This editor does not create backup copies of any files it modifies so I suggest at the minimum backing up the troops.txt, parties.txt and party_templates.txt files before modifying them.  if you are going to try this editor out for the first time you can make a copy of the Native module and then try and edit that.

Converting text files to the module system - The troop editor directly updates troops.txt, so if you were to re-build your mod using the module system your changes to this file will be overwritten. However, kt0 has written a script to convert the troops.txt and parties.txt into python code which would then be usable in the module system.  So if you want to use this editor to make changes and then re-compile your mod you now can.
+ troops.txt - http://forums.taleworlds.com/index.php/topic,69313.0.html
+ parties.txt - http://forums.taleworlds.com/index.php/topic,61873.0.html
+ item_kinds1.txt - http://forums.taleworlds.com/index.php/topic,59985.0.html (if you used the unofficial item editor)
+ party_templates.txt - these changes cannot be converted to module system code

Windows Vista - Several users have had issues trying to use the unofficial editors (and mods in general) with the Windows Vista operating system. I do not have Vista but most likely you will need to start this editor with Admin rights or it will prevent you from modifying text files.  I believe this functionality is a security feature called VirtualStore that primarily protects the C:\Program Files\ folder so I think problems installing mods or using editors in Vista is most common for people who have the game installed into that directory.  Apparently you can find the files under the "C:\Users\YOURUSERNAME\AppData\Local\VirtualStore\Program Files\" folder or some people have re-installed M&B into a different directory and found that this worked as well.

Release History:
March 21, 2008 - version 1.0 - Initial release with the ability to edit troop names, attributes, proficiencies, skills, and items.
April 4, 2008 - version 1.1 - Editor now includes the ability to edit troop upgrade paths and flags. Also included some minor bug fixes.
April 10, 2008 - version 1.2 - Editor now includes the ability to edit troop factions and faces. Also included some data validation and minor bug fixes.
May 5, 2008 - version 1.3 - Editor now has the ability to modify some of the data in the party_templates.txt file. Made the editor compatible with M&B version 0.950 (version 0.90x still works). Removed COMDLG32 from the code so Windows Vista users will not get an error. Minor changes to the interface and some bug fixes.
June 3, 2008 - version 1.4 - Editor now has the ability to modify some of the data in the parties.txt file. Minor changes were made to the Browse button
functionality and the interface.
March 12, 2009 - version 1.5 - Very minor update to fix the parties.txt option to work with M&B 1.x, enabled changes to the looting skill, fixed a crash when trying to remove items, and removed the Face Codes section since it doesn’t currently work in 1.x.
January 8, 2010 - version 1.6 - Updated to allow changing face codes and skins for troops in M&B 1.x, also some minor bug fixes.
February 1, 2010 - version 1.7 - Minor update so if the editor cannot determine what version the mod is it will default to M&B 1.010/1.011.
February 3, 2010 - version 1.8 - Another minor update to try and fix a bug that was causing the invalid line #8 error for some users.
April 8, 2010 - version 1.9 - Updated editor to also make it compatible with M&B Warband.

Troop Editor Installation Package:
This is a full installation package for the Troop Editor that contains all the required files.  You should download and try running this version if you get any errors when trying to use the editor.  For example, one user reported an ActiveX error in Windows Vista and this resolved his issue.
http://www.mbrepository.com/file.php?id=1372

Troop Editor Source Code:
The Troop Editor should currently be compatible with M&B 1.x. However, I do not have time to update or maintain this in the future so have published my source code in case anybody is interested in reviewing it.
http://www.mbrepository.com/file.php?id=1517

Credits:
+ thanks to Jordan and his great item editor for assistance with understanding the troops file
    http://www.mbrepository.com/file.php?id=567
+ thanks to Palestine & SPD_Phoenix for helping me understand the face codes in M&B 1.x

Signature:
If you wish to support this program please add this link to your signature and the following image should be displayed.  thanks!

Code: [Select]
[url=http://forums.taleworlds.com/index.php/topic,34154.0.html][img]http://img508.imageshack.us/img508/4917/troopeditor2ep0.gif[/img][/url]

« Last Edit: April 26, 2013, 03:53:54 AM by HokieBT »
 

Darkwood

  • Veteran
  • *
  • Errr... Hello!
    • View Profile
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #1 on: March 21, 2008, 10:38:33 AM »
Sounds great, I'll try it out. Thank you very much!
Now some .txt to .py would be usefull for .903 - anyone volunteer to make one?  :)

Errr... Hello!... Me Willy, me Willy Thrombone... With this I tell you a story, story about good, story about bad, this disc is all that are left of the true story...

toonknight

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #2 on: March 21, 2008, 11:13:56 AM »
I think you should add these option.
-Faction
-Troop Tree

TEATRC has ceased production. For now? TDM will try to finish Chapter III if he has a coder in his team! Help finish TEATRC!

vanedor

  • Recruit
  • *
    • View Profile
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #3 on: March 23, 2008, 07:04:18 AM »
Getting the error message that COMDLG32.OCX is missing when trying to start the program. Using Vista if it might helps...

And the file is indeed in the folder where I extracted it.
« Last Edit: March 23, 2008, 07:06:24 AM by vanedor »

vanedor

  • Recruit
  • *
    • View Profile
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #4 on: March 23, 2008, 04:35:02 PM »
Seems like going in the program properties and clicking «Execute as administrator» (or whatever it is in the english version of Vista) made it.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #5 on: March 23, 2008, 06:06:00 PM »

vanedor - I don't have Windows Vista so thanks for finding that workaround!  COMDLG32.OCX is a file I used in my program and may not be on every computer so I included it.  I thought placing it in the same folder would work, but it sounds like in Vista you have to execute as an administrator or something....
 

fisheye

  • Back in Black
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #6 on: March 23, 2008, 06:16:26 PM »
Wow, nice work.

Kolba

  • Guest
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #7 on: March 23, 2008, 06:20:03 PM »
Looking very good editor! Trying to download...

Spawn Of Achilles

  • Grandmaster Knight
  • *
  • Seksueel Overdraagbare Aandoening
    • View Profile
  • Faction: Neutral
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #8 on: March 23, 2008, 08:10:39 PM »
WOW!  This is VERY easy to use and I must say, a great tool to any modders out there.  My only question is...How do you make the player file work?

EDIT: Nevermind I just did the Update and Save Troop File button in the wrong order. :)
« Last Edit: March 23, 2008, 09:05:22 PM by Spawn Of Achilles »
I think I'm gonna have to start calling you "The Negotiator", Spawn. And that's just one short step from Obi-Wan in my book.


HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Re: troops.txt - Unofficial Troop Editor 1.0
« Reply #9 on: March 24, 2008, 02:17:08 AM »
WOW!  This is VERY easy to use and I must say, a great tool to any modders out there.  My only question is...How do you make the player file work?

EDIT: Nevermind I just did the Update and Save Troop File button in the wrong order. :)

thanks!  I agree it could be helpful for a lot of mods because its an easy way to review the troops to compare items, skills, etc, if you are trying to balance the game. Anyway, glad you liked it, the buttons are a little confusing so I could try to fix those in a later version.  :)
 

Dragonhour

  • Sergeant at Arms
  • *
  • Strength and honor
    • View Profile
  • Faction: Neutral
Re: Unofficial Troop Editor 1.0 for troops.txt file
« Reply #10 on: March 30, 2008, 06:53:09 PM »
Most excellent tool, thanks so much for sharing.

I assume that the Troop file also contains the range of face codes used....how can I determine which are the face codes when I open the Troop file in Notepad?  I would like to assign the same range of face codes for all the troops in a specific faction, and different range of codes for another faction, etc.
« Last Edit: March 30, 2008, 09:36:53 PM by Stone »

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Re: Unofficial Troop Editor 1.0 for troops.txt file
« Reply #11 on: March 31, 2008, 05:46:53 PM »
Most excellent tool, thanks so much for sharing.

I assume that the Troop file also contains the range of face codes used....how can I determine which are the face codes when I open the Troop file in Notepad?  I would like to assign the same range of face codes for all the troops in a specific faction, and different range of codes for another faction, etc.

very good question and I believe you are correct that this information is stored in the troops file.  Unfortunately, I don't know which line it is, so if somebody knows what line this is or how to translate it then let us know and I could potentially add it into a future version of this editor.
 

The_Dark_Fire

  • Veteran
  • *
  • spurs for the win
    • View Profile
  • Faction: Vaegir
Re: Unofficial Troop Editor 1.0 for troops.txt file
« Reply #12 on: April 02, 2008, 05:24:03 AM »
This isn't working for me. When ever i change something, the original data is restored.
Wheels&Gears: A Need For Speed total conversion of Mount&Blade.

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&B
Re: Unofficial Troop Editor 1.0 for troops.txt file
« Reply #13 on: April 02, 2008, 06:10:36 AM »
This isn't working for me. When ever i change something, the original data is restored.

made sure you read that README.txt file with instructions.  But the basic idea is for each troop you change you have to click "Update Troop", then when you are done you can click the "Save File" button to create the updated file.  If you don't click Update for each troop you modify then no changes will be made.
 

The_Dark_Fire

  • Veteran
  • *
  • spurs for the win
    • View Profile
  • Faction: Vaegir
Re: Unofficial Troop Editor 1.0 for troops.txt file
« Reply #14 on: April 02, 2008, 06:40:41 AM »
Ahh danke. Awesome tool. It makes modding really easy.
Wheels&Gears: A Need For Speed total conversion of Mount&Blade.