Item Editor - Warband compatible version - 1.0.0.1

Users who are viewing this thread

jordan

Sergeant at Arms
ItemEditor V1.0.0.1

Description:
This utility edits item_kinds1.txt directly and allows for editing, inserting, and deleting items without having to mess with Python scripts. BACK UP YOUR ITEM_KINDS1.TXT FILE BEFORE USING!!!

Features:
-Edit, add, and delete items
-Allows changing of item flags, capabilities, and modifiers
-Limited support for triggers
-Export/Import to/from CSV files - New
-Auto-calculate weapon/armor speed, damage, difficulty and cost (discontinued)

NOTE: THIS REQUIRES .NET FRAMEWORK

File History:

Wed, May-04-2011

Bug fixes for:

-attribute editing - was using the wrong edit control; weight (double) and other controls (ulong) were reversed

-revert item - now reverts unless file saved

-File save prompt should only appear if changes made to current open file

Tue, May-03-2011
Totally reworked version - should work for the original game (later versions) and for Warband. Some minor differences in functionality:

- filtering by flags/capabilities/modifiers/text

- Export/import to CSV file. When you export, it does NOT include factions, meshes, or triggers. You can make edits via a spreadsheet program like Excel, and then import your changes back into the program to apply to the current open items file. You cannot insert new items via this method, only update items. The column names are important when importing, although you can move columns around and resort the items if you wish. The import function keys off the itemNumber column, so as long as it is present, the order of the items/columns doesn't matter, but if that column is missing, the import function will do nothing. Also, you can remove columns you don't wish to update.

-Better multi-language support. The best method to translate the text is to open the editor, open a file, and then select "Languages/Create Language Settings File". This will generate an XML with all translatable text in the editor. You can change what you want by editing the XML. When done, if you save the XML in the same directory as the EXE as ItemEditor.EXE.language.XML, it will load your translations automatically the next time you run the editor. You can also select "Languages/Load Language Settings File" to load your translations at any time.

-"Tools/Clone Item" will clone the current item to the end of the items list (or in Warband it will place it second to last).

-"Tools/Revert Item" will revert the current item back to it's original state as long as you haven't updated the item yet by selecting another item.

FYI, weapon attribute auto-calculation is not included as I don't think anyone was using it anyways

Tue, May-19-2008
-Changed to work for .952.  The item modifiers changed.  Included in ZIP are 2 language files, english.lang (use for pre .952) and english_.952.lang (for .952).  As you can see in the files, there are many more modifiers, although only about half appear to be used.

Sun, May-10-2008
-Fixed bug where using the translation feature for terms "Blunt", "Pierce", and "Cut" could screw up Thrust and Swing damages.

Thu, May-08-2008
-Fixed one more regional setting bug. Some PC's with "." as thousands separator and "," as decimal separator would screw up item weights when saving. Hopefully this will fix that issue

Tue, May-06-2008
-Reverted trigger handling to simpler interface. Triggers show up as text lines that you can edit or ignore to your hearts content. Very few triggers were valid for items anyways, and it makes this compatible with older versions (Possibly even .751?) This also means that there is no control on triggers, you can type whatever you want there, so be careful.

-Added application config file

-Config file has autoSave option. When turned on, every time you use the "Save File" option, it will back up your current file first. For example, saving "item_kinds1.txt" would create "item_kinds1.txt_20080506_095501". Obviously, the date/time stamp varies depending on when you save it

-Added language support. In the config file, you define a language file. Use key "languageFile" and a value pointing to the location of the file. The file layout is pretty simple. Use the "english.lang" file as a template. The file contains entries such as "Save_File=". If you change this to "Save_File=Avesay Ilefay", then the editor will show "Avesay Ilefay" where it originally showed "Save File". Be warned: the variables are case sensitive. So if you change the entry to "save_file=test", "test" will not show up because "save" and "file" were not capitalized. If you mispell an entry, leave it blank, or delete an entry, it will used default values.

Fri, Apr-04-2008
-Should work for older versions (.800+) still. Triggers still will not work for .890+, but the only native items using them are the flintlock and torch. There is some partial language support, but not working totally yet.

-Why a new version? Some foreign (non-US) users could not get it to work. I guess Windows has regional settings, and if you live in a place where a thousands separator is "." as opposed to "," and where the decimal indicator is "," as opposed to ".", the program would die trying to read decimal data. This version forces the numeric parsing to expect US style numbers as is used in the items file.

Tue, Nov-20-2007
-Added item numbers to all items for easier identification when modifying troops/parties

-Fixed bug where editing inserted was quirky (sometimes edits affected item that was cloned).

Mon, Nov-19-2007
-No longer tries to default to :\Program Files\Mount&Blade\Modules\Native, but should remember last folder opened.

-Can now edit .808 version of file with one caveat - the file seems to be the exact same format except for triggers, so if you load up a .808 file and save it, you will loose all triggers. You can add them back in manually if you want, but don't try to add them through the editor or you will probably crash the game.

Nov-2007
-Fixed bug where edited damage values would not save

Hi,

First off, I'm new to the forums but have played this game since .751.  And this game is probably my all time favorite, so hats off to the developers.

Secondly, I am trying to write an app in C# that will allow editing of items in the Item_kinds1.txt file.  I plan on having check boxes for all flags (like item modifiers, etc), text boxes to change weapon hit points, etc, and even an option to have the app adjust all the weapon stats automatically (calculating speed, damage, strength requirement, and price depending on the weapon type, length, and weight). 

I've viewed the file and by looking at the module system, I've figured out all the fields EXCEPT for one field as it pertains to weapons.  I do not know what the field prior to the weapon speed attribute is.  For example, in this slightly modified line for the bastard sword, the data after the name and animations reads:

4259843 9223635954298781951 279 532 2.250000 100 0 0 0 9 50176 88 0 120 0 35 49

I know what each field is and how it works except for the 11th one of 50176.  Each weapon has a different value.  It appears to be flags of some sort because converted to hex it is x'C400' in this case.  Does anyone know what it is?
 
Miclee said:
Yeah, but what's the point of it? We have a module system that allows this, and more.

GUI editor

Edit: my guess based on the process_item.py, that's supposed to be item's hit point.
 
Miclee said:
Yeah, but what's the point of it? We have a module system that allows this, and more.
Most people dont know how to mod. Besides this would allow people to edit items from any mod, without having the source file.
 
Yes, but the UE doesn't exist for these versions; SO, this is at least a start.
 
D'Sparil said:
Miclee said:
Yeah, but what's the point of it? We have a module system that allows this, and more.
Most people dont know how to mod. Besides this would allow people to edit items from any mod, without having the source file.
Yes, you've got it.  This would allow editing of all item attributes, not only weapons, without having to recompile the python scripts, and make it easy for anyone, not just modders, to do.
SPD_Phoenix said:
GUI editor

Edit: my guess based on the process_item.py, that's supposed to be item's hit point.

I saw that too, and it makes sense for the horses.  But for the weapons, not so much.  Here's the values for some swords from .894.

Bastard sword: 33792 = 0x8400
Great sword: 36864 = 0x9000
Sword of war: 37888 = 0x9400
Nomad sabre and broadsword: 27648 = 0x6C00
Scimitar: 26624 = 0x6800

According to the scripts, these seem to be related to the ibf_hitpoint... variables in header_items.py.  But those variables do not seem to have anything to do with the weapons as far as I can tell...unless Armagan plans on adding weapon and armor durability in the future.  Which would be pretty cool I think.

ibf_hitpoints_mask      = 0x0000ffff
ibf_hitpoints_bits      = 40
 
I know that the hitpoints are used for shields. It seems the ibf_hitpoints_mask would mask out the four hex values you give in your list, if I understand how that works.

Code:
ibf_hitpoints_mask = 0x0000FFFF

Bastard_sword = 0x00008400

Bastard_sword | ibf_hitpoints_mask = 0x0000FFFF // Gives zero hit points for the bastard sword

Whether Armagan intends to implement durability in the future, only he knows.
 
Well, I coded up a small app that lets you edit all the flags/attributes etc for all items.  If anyone is interested in trying it out, let me know at [email protected]

As for the hitpoint field for weapons, I left it as editable, although I don't know what changing it will do.

By the way, it requires .NET framework.
 
Since horses and shields use hit point, the field should be editable. I believe game doesn't read weapon hitpoint for now.

Edit: I just spent a little time playing around with the your editor. It's pretty cool that I can load the text file from any mod and change the stats as I like. The editor has pretty much everything about items' stats. All kind of stats: from item capabilities, item when carry, modifiers used with item, to the usual weapon length, damage,...However, the items flags and item's capabilities don't seem to be saved (or is it intended?). For example, changing spear capability to polearm capability (giving spear the ability to swing like poleaxe).

The interface remind me of the old Unofficial Editor and quite easy to use.

It is limited to changing stats for now (means: no adding/deleting or changing name or mesh selection capability yet). Still, it can be a great tool for someone who just want to change item stats, but don't want to go through the whole module system thing.

It is great work in progress.

Jordan, are you going to expand/add more ability to the editor this or this is it? Because if you are going to add more feature, may I suggest that you speak with Effidian and Thorgrim to see if they could share their experiences from the Unofficial Editor (for 0.751).
 
SPD_Phoenix said:
Since horses and shields use hit point, the field should be editable. I believe game doesn't read weapon hitpoint for now.

Edit: I just spent a little time playing around with the your editor. It's pretty cool that I can load the text file from any mod and change the stats as I like. The editor has pretty much everything about items' stats. All kind of stats: from item capabilities, item when carry, modifiers used with item, to the usual weapon length, damage,...However, the items flags and item's capabilities don't seem to be saved (or is it intended?). For example, changing spear capability to polearm capability (giving spear the ability to swing like poleaxe).

The interface remind me of the old Unofficial Editor and quite easy to use.

It is limited to changing stats for now (means: no adding/deleting or changing name or mesh selection capability yet). Still, it can be a great tool for someone who just want to change item stats, but don't want to go through the whole module system thing.

It is great work in progress.

Jordan, are you going to expand/add more ability to the editor this or this is it? Because if you are going to add more feature, may I suggest that you speak with Effidian and Thorgrim to see if they could share their experiences from the Unofficial Editor (for 0.751).
I've fixed the flag setting bug in the new version I sent.  Also, I've updated the automatic weapon settings now.  The only issue with it is when it calculates weapons speed and damage for swinging polearms, it tends to give them very high swing damage.

I may add more functionality to the editor.  I can easily allow simple mesh modification (add, delete, change names, etc).  But if I wanted to validate mesh data entered, that might take more effort.  It's been a fun way for me to improve my C# as I've only been coding in it a few months.  What type of things do you (or anyone) think would be good to add to it? 
 
What type of things do you (or anyone) think would be good to add to it?

Well I imagine a lot of people would like to be able to edit the parties.txt and the troops.txt, particularly the troops.txt for the purpose of easily adding troop trees and heroes.
 
Jordan, I tested the new version. It works great.

As for new functions of this module (item_kinds1):

- The ability to Add/Clone an item: this may require that the item's name fields are editable. Also, need a field for mesh name and this should be editable (user must use valid mesh name just like in UE).
- With the ability to add/clone, I may need the ability to delete item.
- With the ability to add/clone/delete, you will need to make sure the items count (at the beginning of the text file) is adjusted correctly. Otherwise, it may create a problem for mod.

Currently, all of the above can be done manually. To add/delete item: manually copy and paste or delete the item from the text file. Change the item count. If adding, manually change item name (so it is not duplicated) and mesh name if needed. Load the file in the Editor and edit other attributes that can not be edited directly in the text file.

Like, rlg85 said, I love to have the ability to edit troops. And if possible, party_templates.
 
SPD_Phoenix said:
Jordan, I tested the new version. It works great.

As for new functions of this module (item_kinds1):

- The ability to Add/Clone an item: this may require that the item's name fields are editable. Also, need a field for mesh name and this should be editable (user must use valid mesh name just like in UE).
- With the ability to add/clone, I may need the ability to delete item.
- With the ability to add/clone/delete, you will need to make sure the items count (at the beginning of the text file) is adjusted correctly. Otherwise, it may create a problem for mod.

Currently, all of the above can be done manually. To add/delete item: manually copy and paste or delete the item from the text file. Change the item count. If adding, manually change item name (so it is not duplicated) and mesh name if needed. Load the file in the Editor and edit other attributes that can not be edited directly in the text file.

Like, rlg85 said, I love to have the ability to edit troops. And if possible, party_templates.
Well, you're in luck.  I've coded the ability to change item ID and names, add/delete new meshes (as well as change their 'ID' to 'none', 'ixmesh_inventory', 'ixmesh_flying_ammo', or 'ixmesh_carry'), and also inserting/deleting items.  When you insert, it automatically clones the item you had selected.  For the item count, I was already storing all items in a list and rewriting the count when saving the file.  It's almost ready to go, although I'm not sure how to validate the mesh names.

I am now working on a better way to edit the triggers.  In your version, it is referred to as 'Addendum lines'.  I have parsed out these triggers and can display their names, what operations they trigger, and the arguments for those operators.  I'm presently looking for an intuitive way to edit them because there can be multiple triggers, each with mutliple operations, each with multiple arguments.  I'll probably have to use multiple forms.

If its OK with you, after I have that finished, I'll send it and let you test.  If you think everything is OK, I'll dump it to the repository.

As for item parties/troops, I'll look into it.  Figuring out the file format and writing the GUI and code to edit is really a pain in the ass going solo.  I've been really slow at work, but that won't continue forever.  However, if anyone is interested in fleshing this out into a more comprehensive editor, or even a full fledged game editor, let me know.
 
Adding support for items' triggers is pretty cool.

Send me the new version when you have it. I will think of something to test.
 
I've got the new version ready.  I'm sending it to you (SPD_Phoenix) shortly.  Keep in mind, I finished it at work (I'm still here), so I have not tried loading a game with it yet.  However, I compared the new item_kinds1.txt to the original, and it looks in order.

Anyways, if anyone wants this new version. let me know.  If no one finds problems, I'll dump it to the repository. 

For a quick review:

This will allow you to edit every aspect of the item_kinds.txt file except for the version number.  You can edit, add, and delete items.  You can set all flags, capabilities, modifiers, and even triggers. 

Note: Trigger support allows you, for each item, to select any number of triggers the game uses, assign any number of operations to those triggers, and give any number of arguments to those operations.  This means you can set triggers that may break your game.  I also do not validate any of the arguments passed to the triggers, except to make sure they are numeric.  I do not feel like writing code to validate the arguments for all of the hundreds of possible operators.  It was a real ***** adding the item triggers as it is.  I used a dataGridView, and it is damn complicated and not intuitive to code with at all.  But in the end, I was able to keep everything in one simple form.
 
I tested the new version.

b) Insert new item: this function will clone the selected item and insert it right under the selected item. Pretty simple. However, it may cause compatibility in mod. If you insert a new item in the middle of the file, you won't be able to use your save game. All of the items (or item IDs) below the newly inserted item will be displaced (game use the new ID while save game have the old ID). Some troops' inventory will be changed.

To ensure compatibility for save game, new item have to be added at the bottom.

If the user don't mind starting a new game everytime he/she insert a new item, then the function works as intended.

In my opinion, it is best if the new item can be added at the bottom instead of inserting it in the middle as it is right now.

b) Delete an Item: this function work as intended. Notice: if the deleted item is somewhere in the middle of the file, the item ID will be referring to a different item. Savegame will not be compatible.

To keep your savegame working, it is best to modified the item so that it will not show up (i.e. not merchandise) rather than deleting it.

c) Item trigger: I haven't be able to get this to work yet. It either does nothing or it will crash the game. I have to admit that I'm not very good at doing item trigger, so I need someone with a bit better knowledge to help testing it.

Another thing is this function is hard to work with. First, as the author said, you will have all of the available triggers in the list. That means you will have to firgure out which one can be used and which one may crash the game. Second, the layout is not label clearly for new user. You have to have pretty good knowledge of how trigger work in order to input correct parameters. Example: if I select "set_position_delta", the set of parameters should be numbers for "x,y,z". Or when I use particle system "particle_system_add_new", the next parameter should be a particle system name or ID. Third, I can't seem to be able to delete the trigger.

 
SPD_Phoenix said:
I tested the new version.

b) Insert new item: this function will clone the selected item and insert it right under the selected item. Pretty simple. However, it may cause compatibility in mod. If you insert a new item in the middle of the file, you won't be able to use your save game. All of the items (or item IDs) below the newly inserted item will be displaced (game use the new ID while save game have the old ID). Some troops' inventory will be changed.

To ensure compatibility for save game, new item have to be added at the bottom.

If the user don't mind starting a new game everytime he/she insert a new item, then the function works as intended.

In my opinion, it is best if the new item can be added at the bottom instead of inserting it in the middle as it is right now.

b) Delete an Item: this function work as intended. Notice: if the deleted item is somewhere in the middle of the file, the item ID will be referring to a different item. Savegame will not be compatible.

To keep your savegame working, it is best to modified the item so that it will not show up (i.e. not merchandise) rather than deleting it.

c) Item trigger: I haven't be able to get this to work yet. It either does nothing or it will crash the game. I have to admit that I'm not very good at doing item trigger, so I need someone with a bit better knowledge to help testing it.

Another thing is this function is hard to work with. First, as the author said, you will have all of the available triggers in the list. That means you will have to firgure out which one can be used and which one may crash the game. Second, the layout is not label clearly for new user. You have to have pretty good knowledge of how trigger work in order to input correct parameters. Example: if I select "set_position_delta", the set of parameters should be numbers for "x,y,z". Or when I use particle system "particle_system_add_new", the next parameter should be a particle system name or ID. Third, I can't seem to be able to delete the trigger.
You can now insert at the item you are cloning or at the end of the file.  The 'insert' menu option now has a dropdown so you can specify.  As for triggers, like I said, I let you do anything, and it may kill your game.
 
Back
Top Bottom