OSP Kit QoL Lav's Companions Overseer OSP v.1.20

Users who are viewing this thread

Ikaguia said:
I get no string error when I try to equip an item I can't
Hmm, all strings should be there. Try compiling the code again.

And if that doesn't help, please post the error message, I get nothing of the sort. :sad:
 
Okay, we finally tracked the problem with Ikaguia, and seems this is a Warband bug (searching brought up several other reports of "NO STRING!" appearing for no apparent reason, and many of them are related to equipment/inventory handling). I'll implement failsafes into the code and do some further research, but right now it seems to me that some Warband operation has an undocumented and intermittent side-effect of clearing reg0.
 
I have uploaded the bugfixed code and increased the version to 1.01.

Problem is purely visual ("NO STRING!" displayed instead of proper message when trying to equip an item without meeting it's prerequisites) and only appears on some machines (after 20 downloads only one Ikaguia apparently had this problem) but I still recommend to update so as not to annoy your mod players. :smile:

Or you could implement the patch yourself, it's rather simple and you only need to replace a single script in the module_scripts.py:

Code:
	("cf_lco_can_drop_item",
		[
			(store_script_param, ":troop_id", 1),
			(store_script_param, ":slot_id", 2),
			(store_script_param, ":item_id", 3),
			(store_script_param, ":modifier", 4),

			(assign, reg0, "str_lco_drop_error_control"),
			(call_script, "script_cf_lco_controllable", ":troop_id"),

			(assign, ":can_drop", 0),
			(assign, ":result", "str_lco_drop_error_type"),
			(try_begin),
				(ge, ":slot_id", num_equipment_kinds),
				(try_begin),
					(this_or_next|eq, ":troop_id", "trp_player"),
					(eq, ":troop_id", "$g_lco_garbage_troop"),
					(assign, ":can_drop", 1), # We can drop anything into player's inventory slots or to the garbage
				(else_try),
					(item_get_type, ":type", ":item_id"),
					(eq, ":type", itp_type_book), # We can only drop books into other companions inventory slots
					(assign, ":can_drop", 1),
				(try_end),
			(else_try),
				(item_get_type, ":type", ":item_id"),
				(try_begin),
					(lt, ":slot_id", 4), # Weapon slot
					(this_or_next|eq, ":type", itp_type_one_handed_wpn),
					(this_or_next|eq, ":type", itp_type_two_handed_wpn),
					(this_or_next|eq, ":type", itp_type_polearm),
					(this_or_next|eq, ":type", itp_type_arrows),
					(this_or_next|eq, ":type", itp_type_bolts),
					(this_or_next|eq, ":type", itp_type_shield),
					(this_or_next|eq, ":type", itp_type_bow),
					(this_or_next|eq, ":type", itp_type_crossbow),
					(this_or_next|eq, ":type", itp_type_thrown),
					(this_or_next|eq, ":type", itp_type_pistol),
					(this_or_next|eq, ":type", itp_type_musket),
					(eq, ":type", itp_type_bullets),
					(assign, ":can_drop", 1),
				(else_try),
					(eq, ":slot_id", 4), # Head armor
					(eq, ":type", itp_type_head_armor),
					(assign, ":can_drop", 1),
				(else_try),
					(eq, ":slot_id", 5), # Body armor
					(eq, ":type", itp_type_body_armor),
					(assign, ":can_drop", 1),
				(else_try),
					(eq, ":slot_id", 6), # Leg armor
					(eq, ":type", itp_type_foot_armor),
					(assign, ":can_drop", 1),
				(else_try),
					(eq, ":slot_id", 7), # Hand armor
					(eq, ":type", itp_type_hand_armor),
					(assign, ":can_drop", 1),
				(else_try),
					(eq, ":slot_id", 8), # Horse
					(eq, ":type", itp_type_horse),
					(assign, ":can_drop", 1),
				(try_end),
				(try_begin),
					(eq, ":can_drop", 1), # Item and slot match by type, but can the character actually equip this item?
					(neq, ":type", itp_type_arrows),  # Do not check for ammo
					(neq, ":type", itp_type_bolts),   # Do not check for ammo
					(neq, ":type", itp_type_bullets), # Do not check for ammo
					(neq, ":type", itp_type_shield),  # Do not check for shields
					(assign, ":result", "str_lco_drop_error_reqs"),
					(call_script, "script_lco_replicate_attributes", ":troop_id"),
					(call_script, "script_lco_clear_all_items", lco_storage),
					(troop_set_auto_equip, lco_storage, 0),
					(troop_set_inventory_slot, lco_storage, num_equipment_kinds, ":item_id"),
					(troop_set_inventory_slot_modifier, lco_storage, num_equipment_kinds, ":modifier"),
					(troop_equip_items, lco_storage),
					(troop_get_inventory_slot, ":copy_item_id", lco_storage, num_equipment_kinds),
					(call_script, "script_lco_clear_all_items", lco_storage),
					(ge, ":copy_item_id", 0), # He did not equip it!
					(assign, ":can_drop", 0), # Hence original troop cannot equip it either!
				(try_end),
			(try_end),
			(assign, reg0, ":result"),
			(eq, ":can_drop", 1),
		]
	),

And of course my GREAT GREAT GREAT thanks go to Ikaguia for his invaluable help in tracing the bug.
 
Lav said:
Okay, we finally tracked the problem with Ikaguia, and seems this is a Warband bug (searching brought up several other reports of "NO STRING!" appearing for no apparent reason, and many of them are related to equipment/inventory handling). I'll implement failsafes into the code and do some further research, but right now it seems to me that some Warband operation has an undocumented and intermittent side-effect of clearing reg0.
Undocumented?? How can that be? :smile:
Use locals where possible, regs are globals and can be overwritten by all kinds of things. If you only sometimes get a bug like this, a good bet is that some trigger code overwrites a reg.

EDIT: Ah, I see it was a callback that did you in, as explained in another thread. Yes, they suck too and change regs.
 
MadVader said:
EDIT: Ah, I see it was a callback that did you in, as explained in another thread. Yes, they suck too and change regs.
Yup. Making that callback register-safe would be a wise move for Taleworlds (and something I already did in my copy of MS). Or at least adding a comment for store_skill_level in header_operations, that this operation is making a reg-unsafe callback so beware.
 
When trying to compile the module I get these errors.  The warning about "camp_supply" is not from your kit, i know where it comes from and will deal with it accordingly.




Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :qty_max
ERROR: Usage of unassigned local variable: :ex_quantity_max
ERROR: Usage of unassigned local variable: :ex_quantity_max
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: camp_supply
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
yes i did not see it in the folder as i was looking at the folder that only contained the changes, not the full files.  this header file was not in that directory so i do not see it and add it to my mod.  however i did find it by sheer accident and replace my existing one and the problem did indeed go away.  speaking of which.  what exactly did you change in that file?  i did not see any comment sections from you in there.  unless i am just blind.  it is a rather large file after all.


I did have  a few requests after getting this up and running:

i kind of like the old inventory view with the icons.  any way to add that view back in? possibly with a check box or a button to switch between the views so what ever peeps like best they can see.

and secondly this mod seems to do a bit of inventory sorting, and that is a mod i was going to work on any way.  i wanted to make a mod that with a few user inputs like price, weapon damage etc.  could sort my inventory to make finding the best armor or sword in my bags easier.  your mod seems to do an inventory sort already, so this is perfect.  if you just include some check boxes or a drop list etc. to let me define how to sort my bags.  things like food to the top, or sort by value, weapon damage, armor value etc.
 
ah yes i am blind.  i even read the bit about this file has been modified ny you, but missed what it was you had changed.  i guess i was in too big a hurry to get the mod up and running to really look into it.



So any input on my ideas.  i realize i had edited my last post not make a new one, so you may not have seen them as you replied while i was editing the previous post.
 
eswallie said:
I did have  a few requests after getting this up and running:

i kind of like the old inventory view with the icons.  any way to add that view back in? possibly with a check box or a button to switch between the views so what ever peeps like best they can see.
It's not "add that view back in", because that view never was there in the first place. You can try it if you want, you'll have to replace overlay generation code (instead of rectangular mesh panels and text labels you will have square mesh panels and item overlays), fill_hero/player_panels scripts (instead of filling text labels, you'll have to initialize item overlays) and the code related to drag-n-drop (there are multiple occurences, but they can be easily found by searching for "$g_drag").

and secondly this mod seems to do a bit of inventory sorting, and that is a mod i was going to work on any way.  i wanted to make a mod that with a few user inputs like price, weapon damage etc.  could sort my inventory to make finding the best armor or sword in my bags easier.  your mod seems to do an inventory sort already, so this is perfect.  if you just include some check boxes or a drop list etc. to let me define how to sort my bags.  things like food to the top, or sort by value, weapon damage, armor value etc.
What Overseer does is call (troop_sort_inventory), that's nothing spectacular.

To implement filtered sorting, you need to do the following:

1. Get some temporary troop with empty inventory (trp_temp_troop is fine).
2. Move all items matching filter criteria from player's inventory to temp troop inventory.
3. Sort temp troop inventory.
4. Move all items from temp troop inventory back to player's inventory.

Steps 1 and 3 are easy. For steps 2 and 4 you can use lco_hero_grab_equipment and lco_hero_return_equipment scripts from the mod, with some modifications. Overseer mod is using those functions for auto-equipping heroes (hero grabs all items from player's inventory matching auto-equip filter, equips the best items possible, and returns the rest to player's inventory). The sorting mod you want will do essentially the same, but you will need more fine-grained filter (and consequently more (else_try) operations in lco_hero_grab_equipment script, though otherwise script will remain the same).

However I'm not planning any major improvements to Overseer mod. I don't mind others improving and extending it, but my personal opinion is that the presentation is already overloaded with functionality and adding even more controls will only confuse the players.
 
So far i am hitting a wall with the presentations.  i can't figure out how to make them and script the actions on them.  i know it can't be that hard, but it never seems to work for me.  do you have any information on how to make and automate them?
 
I'm planning to write a tutorial on them.

It's just that I'm a bit busy at work for the last two weeks, so those plans got delayed a bit.

If you have any specific questions - ask, preferably at the Q&A thread.
 
Nope. I did not need that. Screen dimensions in presentation are 1*0.75 (multiplied by fixed point multiplier, I used 1000 so screen dimensions for me were 1000*750). So I just pre-planned the screen layout on paper, and only then started coding.
 
Bit of a thread necromancy, but I wanted to say thank you to Lav and let you know we'll be added this to version 2.5 of the Floris Mod.  Great work.
 
Presentation updated to version 1.10!

New features and bugfixes:

Introduced a new configuration variable to enable/disable companion book slots. May be useful for mods where book slots for companions are undesired.

Introduced "freezing" of player's slots. Freezing and unfreezing is done by right-clicking on player's inventory slots when nothing is dragged. Frozen slots can only be changed manually, by picking and dropping items one by one. Auto-equip functionality will not take items from frozen slots, they will not be filled when retrieving loot, and they will not be affected when player sorts his inventory.

Bugfix. When Companions Overseer was used as a loot screen, for the first time it would be called in any game, nothing would be available to loot.

Bugfix. Fixed the price multiplier for popup boxes displaying item stats and prices. Prices are now displayed correctly for all items.

Bugfix. Shields were previously exempt from skill checks, so it was possible to equip a shield which the character did not meet prerequisites for. This has been fixed and all checks are now implemented properly.

Download new version from: http://www.mbrepository.com/file.php?id=3159
 
Back
Top Bottom