Morgh's M&B WB/WFAS Editor v1.50

Users who are viewing this thread

Bug report, because the tools told me to.

Bug level: Slight inconvenience.
Morgh's version: 1.5.0
Warband Version: Latest. 1.174 I believe.
Mod used: A Clash of Kings
Error message: "Error #5 occured in function 'ShowFlags'"
Happens when: Clicking on items with the following type flags: type 2h weapon, type 1h weapon. The rest of the items seem fine.
Effects: Capability flags of said items to be messed up. The flags normally associated of the weapon type are unchecked (thrust_onehanded, etc).

Adding those capability flags manually (thrust_onehanded, etc) and updating them seems to work fine. I've seen nothing wrong with the items I updated manually, and the error doesn't show up again when I click on those items, even after closing and reopening Morgh's Tools.
 
Lord Engineer said:
Does anyone know how to fix this error?, I only get this error when I try to open the troops.py and items.py from the Diplomacy 1.173 mod and it's rather annoying. There is no other information from my computer besides the included screenshot which is quite frustrating and I have found very little relevant information online about this.
While it's still quite tedious to edit files with the tool it's far more without so I would quite like to be able to use it.
qoG3P.png

I too would like to know to fix this issue
 
I've got an interesting issue myself...

Using Morghs (on WB 1.174) to tweak the Prophesy of Pendor mod, and after a recent patch that overwrote the troops.txt file, I expected to have to go into Morghs and re-do the tweaks I had made.  But in Morghs, they were showing as still being there.  But when I open the troops.txt file itself, the values/changes don't match, and don't reflect in-game.

I presumed that Morghs would read the .txt files each time it ran, so I tried what I thought would be the nuclear option...delete everything, re-download, and use fresh files (both Morghs and the mod).  But even with removing Morghs completely, it still shows the last changes I tweaked to the Troops file (and partytemplates.txt as well!).

Not sure how this is even possible..but it is frustrating as heck. 

Update:  After a lot of trial-and-error, the only thing I can think of causing it somehow (compared to previously) is a recent upgrade to using Windows 10.
 
Just downloaded this - looks great! Thank you for all the effort over the years.

Had a question about the Item Editor. If I want to change the Ammo count on something, can I do it so that it only affects MY items or will it affect the items of all the other soldiers / units as well?

If it does affect all, would I need to create a clone of the item I want to change and then somehow make it available only to me? To do so, do I set the Faction to 13 - fac_player_faction?

Thanks in advance!
 
Dionaea said:
Lord Engineer said:
Does anyone know how to fix this error?, I only get this error when I try to open the troops.py and items.py from the Diplomacy 1.173 mod and it's rather annoying. There is no other information from my computer besides the included screenshot which is quite frustrating and I have found very little relevant information online about this.
While it's still quite tedious to edit files with the tool it's far more without so I would quite like to be able to use it.
qoG3P.png

I too would like to know to fix this issue

I checked Diplomacy 1.174 source code and same error. It is caused by function definitions.
Code:
def heraldic(item_tableau):
  return (ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", item_tableau, ":agent_no", ":troop_no")])
def add_mesh(item_meshes):
  cur_meshes = [(store_trigger_param_1, ":agent_no"),(ge, ":agent_no", 0)]
  for mesh in item_meshes if not isinstance(item_meshes, basestring) else [item_meshes]:
    cur_meshes.append((str_store_string, s1, mesh))
    cur_meshes.append((cur_item_add_mesh, s1))
  return (ti_on_init_item, cur_meshes)
def reskin(item_material):
  return (ti_on_init_item, [(str_store_string, s1, item_material),(cur_item_set_material, s1, 0),])
If you place these definitions after the items array, it opens, but it still causes errors at some items. These're caused by parsing errors. Editor can't handle function calls in triggers.

smagnet said:
Just downloaded this - looks great! Thank you for all the effort over the years.

Had a question about the Item Editor. If I want to change the Ammo count on something, can I do it so that it only affects MY items or will it affect the items of all the other soldiers / units as well?

If it does affect all, would I need to create a clone of the item I want to change and then somehow make it available only to me? To do so, do I set the Faction to 13 - fac_player_faction?

Thanks in advance!

Items work like party templates. If you edit one, it effects everyone uses that item. You should create new one.
Native module doesn't alter troop inventories, so any newly created item doesn't appear anywhere unless you make it.
You should check the merchandise flag, add factions of the merchants that you want to buy your item from to the new item's faction list and set abundance, price etc. Then you can buy it from shops.

Scuba Steve said:
Is there a way to edit the values of multiple items at the same time? I'm assuming not after looking around, but I'm uncertain if there's something I'm missing.

Editor doesn't seem to have that kind of capability, but you can do it with python, if you're using this editor to edit python files.
You can create your own variables and pass them instead of hardcoded values. Module system also does that sometimes. Example:
Code:
# Some constants for ease of use.
imodbits_none = 0
imodbits_horse_basic = imodbit_swaybacked|imodbit_lame|imodbit_spirited|imodbit_heavy|imodbit_stubborn
imodbits_cloth  = imodbit_tattered | imodbit_ragged | imodbit_sturdy | imodbit_thick | imodbit_hardened
imodbits_armor  = imodbit_rusty | imodbit_battered | imodbit_crude | imodbit_thick | imodbit_reinforced |imodbit_lordly
imodbits_plate  = imodbit_cracked | imodbit_rusty | imodbit_battered | imodbit_crude | imodbit_thick | imodbit_reinforced |imodbit_lordly
imodbits_polearm = imodbit_cracked | imodbit_bent | imodbit_balanced
imodbits_shield  = imodbit_cracked | imodbit_battered |imodbit_thick | imodbit_reinforced
imodbits_sword   = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_tempered
imodbits_sword_high   = imodbit_rusty | imodbit_chipped | imodbit_balanced |imodbit_tempered|imodbit_masterwork
imodbits_axe   = imodbit_rusty | imodbit_chipped | imodbit_heavy
imodbits_mace   = imodbit_rusty | imodbit_chipped | imodbit_heavy
imodbits_pick   = imodbit_rusty | imodbit_chipped | imodbit_balanced | imodbit_heavy
imodbits_bow = imodbit_cracked | imodbit_bent | imodbit_strong |imodbit_masterwork
imodbits_crossbow = imodbit_cracked | imodbit_bent | imodbit_masterwork
imodbits_missile   = imodbit_bent | imodbit_large_bag
imodbits_thrown   = imodbit_bent | imodbit_heavy| imodbit_balanced| imodbit_large_bag
imodbits_thrown_minus_heavy = imodbit_bent | imodbit_balanced| imodbit_large_bag

imodbits_horse_good = imodbit_spirited|imodbit_heavy
imodbits_good   = imodbit_sturdy | imodbit_thick | imodbit_hardened | imodbit_reinforced
imodbits_bad    = imodbit_rusty | imodbit_chipped | imodbit_tattered | imodbit_ragged | imodbit_cracked | imodbit_bent
Changing these variables affects every item using these.
 
Seear said:
This error happens when clicking 630 and 631 in the perisno mod.
I answered a similar question there, probably the same reason. Here is my answer there.
RecursiveHarmony said:
For some reason I get errors while looking up some of the characters in Morgh's Editor
I checked the problematic troops and the errors are caused by item modifiers of inventory items. Normally you can't add item modifiers to the inventory items, but some modders figured it out long time ago. Check this link.
 
RecursiveHarmony said:
I checked Diplomacy 1.174 source code and same error. It is caused by function definitions.
Code:
def heraldic(item_tableau):
  return (ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", item_tableau, ":agent_no", ":troop_no")])
def add_mesh(item_meshes):
  cur_meshes = [(store_trigger_param_1, ":agent_no"),(ge, ":agent_no", 0)]
  for mesh in item_meshes if not isinstance(item_meshes, basestring) else [item_meshes]:
    cur_meshes.append((str_store_string, s1, mesh))
    cur_meshes.append((cur_item_add_mesh, s1))
  return (ti_on_init_item, cur_meshes)
def reskin(item_material):
  return (ti_on_init_item, [(str_store_string, s1, item_material),(cur_item_set_material, s1, 0),])
If you place these definitions after the items array, it opens, but it still causes errors at some items. These're caused by parsing errors. Editor can't handle function calls in triggers.

Sorry, after the items in module_items.py?
 
Back
Top Bottom