Author Topic: Item Editor - Warband compatible version - 1.0.0.1  (Read 80246 times)

0 Members and 1 Guest are viewing this topic.

jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #15 on: October 23, 2007, 08:08:52 PM »
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.

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Item_kinds1.txt
« Reply #16 on: October 24, 2007, 06:53:11 PM »
Adding support for items' triggers is pretty cool.

Send me the new version when you have it. I will think of something to test.

jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #17 on: October 24, 2007, 10:41:36 PM »
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 bitch 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.

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Item_kinds1.txt
« Reply #18 on: October 25, 2007, 08:56:16 PM »
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.


jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #19 on: October 25, 2007, 10:46:18 PM »
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.

Wihzzahrd

  • Veteran
  • *
  • Permanently Banned
  • Wihzzahrd - RangedMage
    • View Profile
    • www.freewebs.com/elecid
Re: Item_kinds1.txt
« Reply #20 on: October 25, 2007, 10:48:54 PM »
I still want the program...
Cant you give it to mbrepository?

jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #21 on: October 26, 2007, 01:18:26 AM »
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.



Oh, to delete a trigger/operation/argument, press the arrow next to the row and hit your delete key.  I'll look to adding a right click delete option as well.

jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #22 on: October 26, 2007, 01:39:00 AM »
I still want the program...
Cant you give it to mbrepository?
I will put it up there shortly.

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Item_kinds1.txt
« Reply #23 on: October 26, 2007, 09:01:37 AM »
Nice.

As for the trigger: just note to the users that it is there but not fully supported.

It just need a little more testing to firgure out how it work. Besides, most people who want item trigger will probably use module system.

jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #24 on: October 27, 2007, 02:21:30 PM »
Added to repository.

Janus

  • *spicy* *camper*
  • Administrator
  • *
    • View Profile
    • Mount&Blade Unofficial File Repository
  • Faction: Rhodok
  • M&BWBWF&S
Re: Item_kinds1.txt
« Reply #25 on: October 28, 2007, 05:00:18 AM »
This topic really belongs in the Unofficial Editing Tools board. Do you want this one moved, or do you want to create a new topic for it over there and lock this one?
Tomas asked Dolgan, "What place is this?"
The dwarf puffed on his pipe. "It is a glory hole, laddie. When my people mined this area, we fashioned many such areas."
     - Raymond E. Feist, Magician: Apprentice  (Riftwar Saga)

jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #26 on: October 29, 2007, 04:30:20 AM »
Sorry, I never noticed that board.  Please move it for me.

Thanks

Dain Ironfoot

  • Grandmaster Knight
  • *
  • No sex please, we're dwarves
    • View Profile
  • Faction: Neutral
Re: Item_kinds1.txt
« Reply #27 on: November 04, 2007, 07:07:31 PM »
This is terrific :D If it could edit troops as well it'd be the best thing ever..
Ry'n ni yma o hyd

Arn de Gothia

  • Recruit
  • *
  • Ultima Thule
    • View Profile
Re: Item_kinds1.txt
« Reply #28 on: November 13, 2007, 08:35:51 PM »
hey, i tried your program but it doesnt work. heres the error log after i try to open item_kinds1.txt in .894 native:

************** Exception Text **************
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info)
   at ItemEditor.Item..ctor(String itemString)
   at ItemEditor.ItemKinds..ctor(String path)
   at ItemEditor.Form1.openFileToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ItemEditor
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/Mount%26Blade/ItemEditor.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
« Last Edit: November 13, 2007, 08:37:34 PM by Arn de Gothia »

jordan

  • Sergeant at Arms
  • *
    • View Profile
  • WB
Re: Item_kinds1.txt
« Reply #29 on: November 14, 2007, 05:32:00 PM »
If I had to guess, I would say you're running the editor against an incompatable item_kinds1.txt from before .890.  I did not code any version control in the app, so if you open an old file, it will try to process it.  The error is that it tried to interpret non-numeric data as a number.  Are you sure you're pointing to the .894 version of M&B, and not some other old installation you left on your PC?

If you are sure, send me your item_kinds1.txt file; dejfatman@yahoo.com

hey, i tried your program but it doesnt work. heres the error log after i try to open item_kinds1.txt in .894 native:

************** Exception Text **************
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info)
   at ItemEditor.Item..ctor(String itemString)
   at ItemEditor.ItemKinds..ctor(String path)
   at ItemEditor.Form1.openFileToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
ItemEditor
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/Mount%26Blade/ItemEditor.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.832 (QFE.050727-8300)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------