OSP Kit Optimisation Warband Module System 1.166 (with tweaks and giggles)

Users who are viewing this thread

Lav

Sergeant Knight at Arms
Warband Module System 1.166 (with tweaks and giggles)

Download the module system as zip archive (1.3 Mb file size) from:
Nexus Mods | Lav's Warband Workshop

This is essentially the vanilla Module System with a number of fixes and tweaks:
  • File header_operations.py has been completely replaced with properly documented version.
  • Issues with (party_set_marshal{l}) operation have been fixed, Module System will accept either syntax.
  • New 1.165 operations (try_for_prop_instances) and (try_for_players) are now correctly identified as "depth-increasing" operations (this affects compiler checks for unsafe can-fail operations and extra/missing (try_end)'s).
  • Temporary *.pyc files are no longer generated during compilation and won't clutter the folder in case of a failed compilation attempt.
  • Info page references "ip_*" are now correctly recognized by module system compiler and will not throw an "Unrecognized tag" error.
  • Added a small tweak to module_info.py which will provide a trailing slash to export_dir constant if it doesn't have one. Also provided several likely options for export_dir setting (commented out).
  • It is now possible to add items with modifiers to troop inventories directly in module_troops.py. For example, [(itm_item1, imod_rusty), itm_item2] will add rusty "itm_item1" and regular "itm_item2" to a troop. Code used is a slightly modified version of The_dragon's code from a long-forgotten thread in the Forge.
  • Modifications to header_common.py enable numeric, string and position registers up to reg127, s127 and pos127 respectively. Note that numeric and string registers with indexes of 100 and higher cannot be used in string substitutions (i.e. a string like "You have {reg120} gold." will throw errors during run-time).
  • Modifications to header_item_modifiers.py to add information about hardcoded game effects of item modifiers and make imodbit_* constants more readable.
  • Various modifications to header_items.py:
    • Item weight limit was increased from 63.75 kg to 655.35 kg with precision of up to 0.01 kg. Note that the game engine will round displayed weight to nearest 0.1 kg anyway.
    • Item other parameters will no longer overflow into hit points field, resulting in items with ridiculously high HP value (which is usually meaningless and harmless though).
    • Item max_ammo value can now go up to 65535 (compared to vanilla 255).
    • Two new flags for armor items: itp_replaces_helm and itp_replaces_shoes.
  • Modifications to header_skills.py get rid of uncomprehensibly big numbers, extend knows_*_# constants to include skill levels up to 15 and make it easier to change skill constants for mods with a non-standard skills set.
  • Modifications to header_troops.py provide attribute constants for attributes in [3..64) range (upper value not included).
  • Modifications to header_triggers.py to include detailed comments on triggers parameters and their effects (a lot of credit goes to K700, Slawomir of Aaarrghh and _Sebastian_ for providing a lot of useful information).
 
Wow! This looks great! :smile: I have a few questions:

Lav said:
  • Temporary *.pyc files are no longer generated during compilation and won't clutter the folder in case of a failed compilation attempt.
Which file did you change here?

Lav said:
  • Modifications to header_skills.py get rid of uncomprehensibly big numbers, extend knows_*_# constants to include skill levels up to 15 and make it easier to change skill constants for mods with a non-standard skills set.
Do all skills now go to 15? Even the hardcoded ones?
 
Lord of Shadows said:
Wow! This looks great! :smile: I have a few questions:
Lav said:
  • Temporary *.pyc files are no longer generated during compilation and won't clutter the folder in case of a failed compilation attempt.
Which file did you change here?
All process_*.py files. You can check the first two lines of any of them.

Lord of Shadows said:
Lav said:
  • Modifications to header_skills.py get rid of uncomprehensibly big numbers, extend knows_*_# constants to include skill levels up to 15 and make it easier to change skill constants for mods with a non-standard skills set.
Do all skills now go to 15? Even the hardcoded ones?
All skills still go to 10 as defined in module_skills.py. However, if you increase limit for any skill, the constants for higher skill levels will already be in header_skills.py. That's all. :smile:
 
Just to notify everyone, I'm currently working to update this module system with a few things that slipped my mind when I was originally preparing it.

1. Information on hardcoded game effects of item modifiers will be added to header_item_modifiers.py.
2. Information on trigger parameters will be added to header_triggers.py (many triggers are actually missing this information in vanilla file).

If you can remember anything I've missed, please let me know ASAP. :smile:
 
Module system updated.

Files header_item_modifiers.py and header_triggers.py have been modified to include more detailed information about item modifiers and game triggers.
 
Updated the files a bit.

Tweak to guarantee trailing slash in export_dir setting has been moved to process files so that module_info.py now looks normal without any code additions.

All inconsistencies in the code have been fixed (missing (try_end)'s, using undefined variables, unused local variables, misnamed strings).

A number of duplicate items and strings have been renamed by adding "_DUPLICATE" to their name (both items and strings still remain in module files so savegame compatibility isn't broken).

Subjecting updated module system to W.R.E.C.K. reported a 100% clean compile.
 
Can I take out for example operations like:
try_for_prop_instances  =  16  # (try_for_prop_instances, <destination>, [<scene_prop_id>]),
                                # Version 1.161+. Runs a cycle, iterating all scene prop instances on the scene, or all scene prop instances of specific type if optional parameter is provided.

if I have a module system of version 1.158 but game version 1.161+ or do I have to update the whole module system?
 
domipoppe said:
Can I take out for example operations like:
try_for_prop_instances  =  16  # (try_for_prop_instances, <destination>, [<scene_prop_id>]),
                                # Version 1.161+. Runs a cycle, iterating all scene prop instances on the scene, or all scene prop instances of specific type if optional parameter is provided.

if I have a module system of version 1.158 but game version 1.161+ or do I have to update the whole module system?
If you just want to get the new operations, you can try this.
 
Trigger param 4 for ti_on_agent_hit - hit bone. Viking Conquest decompiled script http://prntscr.com/63h97j
The names of the bones can be taken from WSE.

#Human bones
hb_abdomen = 0
hb_thigh_l = 1
hb_calf_l = 2
hb_foot_l = 3
hb_thigh_r = 4
hb_calf_r = 5
hb_foot_r = 6
hb_spine = 7
hb_thorax = 8
hb_head = 9
hb_shoulder_l = 10
hb_upperarm_l = 11
hb_forearm_l = 12
hb_hand_l = 13
hb_item_l = 14
hb_shoulder_r = 15
hb_upperarm_r = 16
hb_forearm_r = 17
hb_hand_r = 18
hb_item_r = 19

#Horse bones
hrsb_pelvis = 0
hrsb_spine_1 = 1
hrsb_spine_2 = 2
hrsb_spine_3 = 3
hrsb_neck_1 = 4
hrsb_neck_2 = 5
hrsb_neck_3 = 6
hrsb_head = 7
hrsb_l_clavicle = 8
hrsb_l_upper_arm = 9
hrsb_l_forearm = 10
hrsb_l_hand = 11
hrsb_l_front_hoof = 12
hrsb_r_clavicle = 13
hrsb_r_upper_arm = 14
hrsb_r_forearm = 15
hrsb_r_hand = 16
hrsb_r_front_hoof = 17
hrsb_l_thigh = 18
hrsb_l_calf = 19
hrsb_l_foot = 20
hrsb_l_back_hoof = 21
hrsb_r_thigh = 22
hrsb_r_calf = 23
hrsb_r_foot = 24
hrsb_r_back_hoof = 25
hrsb_tail_1 = 26
hrsb_tail_2 = 27
 
Back
Top Bottom