Lav's Warband Workshop


Table of Contents


Expanded header_operations.py

download v.1.0.1 (direct), download v.1.0.1 (MB Repository), download v.1.0.1 (Nexus Mods), official thread, research thread

This file is intended as a modding aide for both starting and experienced Warband modders, replacing Native header_operations.py file with it's chaotic organization and poor, obsolete or nonexistent comments with a properly organized, structured and streamlined version. Most Warband scripting operations have been thoroughly tested and documented, new operations introduced in Warband patches 1.153 to 1.160 are clearly marked so there would be no conflict between mod and Warband engine versions. Additionally, a lot of comments have been added to the file to explain most unobvious Warband conventions to a starting modder.

Features:

Instructions:

Previews:

Table of Contents (click to show/hide)
################################################################################
# TABLE OF CONTENTS
################################################################################
#
# [ Z00 ] Introduction and Credits.
# [ Z01 ] Operation Modifiers.
# [ Z02 ] Flow Control.
# [ Z03 ] Mathematical Operations.
# [ Z04 ] Script/Trigger Parameters and Results.
# [ Z05 ] Keyboard and Mouse Input.
# [ Z06 ] World Map.
# [ Z07 ] Game Settings.
# [ Z08 ] Factions.
# [ Z09 ] Parties and Party Templates.
# [ Z10 ] Troops.
# [ Z11 ] Quests.
# [ Z12 ] Items.
# [ Z13 ] Sounds and Music Tracks.
# [ Z14 ] Positions.
# [ Z15 ] Game Notes.
# [ Z16 ] Tableaus and Heraldics.
# [ Z17 ] String Operations.
# [ Z18 ] Output And Messages.
# [ Z19 ] Game Control: Screens, Menus, Dialogs and Encounters.
# [ Z20 ] Scenes and Missions.
# [ Z21 ] Scene Props and Prop Instances.
# [ Z22 ] Teams and Agents.
# [ Z23 ] Presentations.
# [ Z24 ] Multiplayer And Networking.
# [ Z25 ] Remaining Esoteric Stuff.
# [ Z26 ] Hardcoded Compiler-Related Code.

[Z12] Items Section (click to show/hide)

################################################################################
# [ Z12 ] ITEMS
################################################################################

  # The title is a bit deceitful here. Items, despite the name, are not actual
  # game items. Rather these are the *definitions* for real game items, and you
  # can frequently see them referenced as "item types". However you should not
  # confuse this with so called itp_type_* constants which define the major item
  # classes existing in the game.

  # Consider this: a Smoked Fish (50/50) in your character's inventory is an
  # item in the game world. It's item type is "itm_smoked_fish" and it's basic
  # class is itp_type_food. So take care: operations in this section are dealing
  # with "itm_smoked_fish", not with actual fish in your inventory. The latter
  # is actually just an inventory slot from the Module System's point of view,
  # and operations to work with it are in the troops section of the file.

# Item slot operations

item_set_slot                       =  507  # (item_set_slot, <item_id>, <slot_no>, <value>),
item_get_slot                       =  527  # (item_get_slot, <destination>, <item_id>, <slot_no>),
item_slot_eq                        =  547  # (item_slot_eq, <item_id>, <slot_no>, <value>),
item_slot_ge                        =  567  # (item_slot_ge, <item_id>, <slot_no>, <value>),

# Generic item operations

item_get_type                       = 1570  # (item_get_type, <destination>, <item_id>),
                                            # Returns item class (see header_items.py for itp_type_* constants).
store_item_value                    = 2230  # (store_item_value, <destination>, <item_id>),
                                            # Stores item nominal price as listed in module_items.py. Does not take item modifier or quantity (for food items) into account.
store_random_horse                  = 2257  # (store_random_horse, <destination>),
                                            # Deprecated since early M&B days.
store_random_equipment              = 2258  # (store_random_equipment, <destination>),
                                            # Deprecated since early M&B days.
store_random_armor                  = 2259  # (store_random_armor, <destination>),
                                            # Deprecated since early M&B days.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods without any need for permission or credits.

Information contained in this file can be freely used to create any kinds of Warband scripting references and documentation for as long as credit is given to people who contributed their efforts in researching and collection of this information.

Credits:

A number of people from Taleworlds Forums Forge have contributed their time and knowledge to the creation of this file. In no particular order, they are: cmpxchg8b, Caba'drin, SonKidd, MadVader, dunde, Ikaguia, MadocComadrin and Cjkjvfnby. Their help was invaluable and will never be forgotten for as long as Calradia stands.


Module System Compiler

download (direct), download (Google Drive), report bugs, official thread

This is an alternative to vanilla Module System compiler script.

It was developed to be much faster and more versatile than the collection of bat/py scripts provided together with Warband Module System.

Features:

  1. Much faster.

    Speed improvement compared to the vanilla Module System compiler is considerable: where vanilla compiler spends 20-22 seconds to compile a module, this compiler will do the same job in five. Less time spent waiting for compilation to finish means more time spent on productive modding.

  2. Better (mostly) error identification.

    Most errors are identified and tracked to the root of the problem whenever possible. Additionally, every generated error is only reported once, unlike vanilla compiler which often produces an entire textwall of error messages because of a simple typo.

    As an additional bonus, parser is much more robust, finding problems that vanilla compiler doesn't detect. Don't be surprised to see a couple of non-fatal errors when compiling Native source where vanilla compiler succeeds without any issues - Warband Native code does indeed contain a couple of mistakes that are not of any consequence.

  3. Less quotes.

    Most objects can be referenced OOP-style. So instead of:

    (call_script, "script_add_numbers", ":number1", ":number2"),

    You can write instead:

    (call_script, script.add_numbers, l.number1, l.number2),

  4. No dependencies. All objects can be referenced from anywhere. No double compilations.

    With vanilla compiler, there are plenty of spaces where you simply *must* use object references directly. For example, in module_parties.py, you must use party icons as direct numeric values as opposed to just referencing them within quotes. This means that if you add a new map icon to your module and want to use it for one of your parties, you must first compile the module to generate new ID_map_icons.py file, which will contain the new numeric value for your map icon, and only then can you use that icon in module_parties.py file.

    This compiler supports fully abstract referencing. Just typing icon.my_new_icon will not require it's numeric value to be known immediately - instead, it will be calculated during compilation and substituted fully transparently for the modder.

  5. Quick math with references. Automatic code generation.

    There are plenty of places in the code where some math using references is done. With this compiler, you can use mathematical expressions directly in the code. If expression value can be calculated at compilation time (i.e. it only contains references but not registers or variables) it will be calculated by the compiler and the resulting value put in the code. If expression cannot be calculated at compilation time (for example, it may contain some local variable which may contain any value during run-time), compiler will generate scripting code to calculate your expression for you and inject it into your code. In both situations developer doesn't have to bother with writing numerous scripting commands to calculate stuff - compiler does that for him.

  6. Plugin support.

    To ease the development of new features, compiler supports plugins. Unlike module_* files, which always contain one and only one class of game data (meshes, animations, troops etc), plugin files can contain all types of game objects. So you can keep all code and tuples relating to the feature you're developing in a single file, and you can add or remove it from compiled project with just a few minor edits of module_info.py file.

    Normally, all data entries defined in plugin will be added to the end of respective entity lists. So if your plugin defines it's own troops array with several new troops, during compilation they will be added to the end of the troops array which is defined in module_troops.py file. In most situations, this is exactly what's required, but sometimes you need to insert your data entries or even code lines somewhere into the middle of the module files. This is handled by "injections".

    Anywhere in the module code where you want to inject your plugin data later, you need to put an inject() command. Parameter of this command will determine what data will replace it during compilation. To see an example of inject() command, have a look at the very beginning of module_dialogs.py file in the "Adapted Native" subfolder. To see how entries are being injected, have a look at the end of plugin_companions_overseer.py file in the same subfolder. You will see that parameters for inject() marker in module file and injection[] command in plugin file are the same. This is how compiler matches injections and inject points.

    Note that several different plugins may inject to the same injection point. Order in which their data is injected is determined by their loading order in module_info.py.

  7. New module files.

    Compiler supports several new module files. These are:

    • module_item_modifiers.py - if present, is compiled to Data/item_modifiers.txt file.
    • module_ui_strings.py - if present, is compiled to Languages/en/ui.csv file.
    • module_user_hints.py - if present, is compiled to Languages/en/hints.csv file.

    These modules are optional - if they are not present, resulting files are simply not created and Warband will use default versions of these files which are contained in the base Warband folder.

    Module module_item_modifiers allows modder some degree of control over item modifer names, price and rarity coefficients. Warband does not allow changing item modifier actual game effects, so their effects are listed in the file as comments for modder's reference.

    Module ui_strings allows modder to edit a lot of game interface text, including attribute names, weapon proficiency names and most standard UI elements.

    Module user_hints contains all hints that are being displayed to user in some situations. Note that compiler DOES NOT modify module.ini file to set the correct value for num_hints parameter.

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Companions Overseer

download v.1.2.0 (direct), download v.1.2.0 (MB Repository), download v.1.2.0 (Nexus Mods), official thread

Companions Overseer adds two interface screens to the game.

First screen allows the player to overview attributes, skills and weapon proficiencies for himself, his own companions, his loyal lords and troops within his party on a single screen without any need for traversing a number of interface and dialogue options. Player can access character screen for any of his companions directly from this screen whenever he wants to distribute attribute and skills points to his companions, thus potentially saving a lot of time and mouse clicks.

Second screen provides a unified alternative to vanilla game screens for player's inventory/equipment, equipping companions and looting. With this interface, player can equip all his companions directly, once again without any need to traverse numerous interface and dialogue options.

Features:

Instructions:

Previews:

Screenshots (click to show/hide)

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.

Credits:

For the attribute overview part of the functionality credits go to Jedediah Q, whose "Companions Overview" project inspired me to start with this presentation scripting in general and this project in particular.

Special credits go to cmpxchg8b for digging out the actual xp-to-level table used by the game (though it's no longer used as of 1.20).

Special credits go to Ikaguia for his help with debugging the first version of presentation.

Special credits go to soulmata for bringing my attention that Warband does, in fact, check prerequisites for shields.


F.I.S.H. & C.H.I.P.

download (direct), download (Google Drive), download (Nexus Mods), official thread

C.H.I.P. Armor Pack

download (direct), download (Google Drive), official thread

FISH&CHIP (which stands for Flag Icons Support Heraldry & Camo/Heraldry Items Pack) is a modder-oriented pack providing the modders with heraldry support for map flag icons, allowing them to get rid of a hundred plus heraldic banner icons, freeing reference space for a greater variety of normal map icons. Also, support for camo items is provided, namely the possibility to retexture items dynamically using tableau materials. This is similar to heraldic items, but retexturing is done using shared background textures and solid colors. Final (and least interesting) feature of the pack is a number of heraldic versions of Native armors.

CHIP Armor Pack is an adaptation of heraldic armors from FISH&CHIP pack for Native that can be added to any mod and does not require Module System. It does not support camo items and as such is of little interest for modders, but might be useful for regular players looking to enhance the looks of their companions with a greater variety of heraldic armors.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.

Credits:

Special credit goes to Zagibu, without his tutorial I probably would never learn how Warband heraldry works.


Emoticons

download (direct), download (Nexus Mods), official thread

A small OSP mod to add "emoticons" - small icons indicating current status and activity - to all (or at least most) game parties on the global map so the player can tell at a glance what exactly some party is currently doing (attacking, patrolling, fleeing, razing etc).

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.

Credits:

All graphics in the mod are works by Mandible.

Special thanks to Caba'drin for solving some problems with the mod.


W.O.R.M.S.

download (direct), download (Nexus Mods), official thread

W.O.R.M.S., which stands for Warband Object-Resembling Module Syntax, is an extension of vanilla Module System compiler (and can be freely integrated into other compilers). It's primary objective is twofold: first, to enable Module System syntax which is closer to syntax of classic object-oriented programming languages, and second, to enable the scripter to use arbitrarily large mathematical expressions in the code without bothering to write actual Module System code to calculate those expressions - WORMS will automatically generate nearly optimal code and insert it, fully transparently for the modder.

Due to development of my own version of Module System Compiler, which offers some similar functionality, further development of WORMS is not planned.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.

Credits:

This project was heavily inspired by works of Invictus and Swyter.


My Book Models Collection

download (direct), download (MB Repository), download (Nexus Mods), official thread

A small mod with a couple of book models I designed as a training excercise (as well as several retextures of said models). Models are pretty simplistic and not detailed enough to be used in scenes, but looks pretty decent as inventory items which is all I currently care about.

Mod archive contains Wings model source and obj file.

Features:

Previews:

Previews (click to show/hide)

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Map Viewing Tool

download (direct), download (MB Repository), official thread

An unfinished tool for editing maps which currently can only load and view maps, but little more.

This program was created as a training excercise when I was researching Warband maps. However with much better and more functional editors being developed at that time, this project was abandoned as by itself it held little purpose.

Instructions:

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Dynamic Villages and Scene Props Iterator

official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


AgentFinder Script Library

download (MB Repository), download (Nexus Mods), official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Improved Trade Goods

download (MB Repository), download (Nexus Mods), official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Civilians Mod

download (MB Repository), download (Nexus Mods), official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Siege Camp Icon

download (MB Repository), download (Nexus Mods), official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Retextured Map Icons Pack

download (MB Repository), download (Nexus Mods), official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Custom Lord Notes

download (MB Repository), download (Nexus Mods), official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Moar BookZ

download (Google Drive), official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.


Resource Mining/Gathering System

official thread

No description available yet.

Features:

Instructions:

Previews:

Previews (click to show/hide)
No previews available yet.

Terms and Conditions:

This file is distributed under the generally accepted terms of Warband Open Source Project. It can be freely used in any Warband mods. No permission is necessary, credits are not obligatory but will be appreciated.