Hussar Heraldic Armor

Users who are viewing this thread

Erundil

Regular
Due to the wings mesh and textures coming from WFaS this is a limited source pack (LSP), which means that you are allowed to use it only in a mod/submod for WFaS.
The code is fully OSP though.
Feather sounds are licensed under CC - free to use as long as license and author information is given (see text file in the audio package).


The code below was designed for Warband, but would require very minimal changes to put it in WFaS (different armor for a base, maaaybe different mission templates to plug into).
Or don't adapt the code - use it in Warband. In that case you need some other non-licensed wings.

Pics how it looks like are here: https://www.loverslab.com/files/fil...ource-code-to-create-a-hussar-heraldic-armor/

For most armors adding 1 submesh is an easy matter, so I have created a tutorial on how to create a heraldic armor with wings.
And how to make those wings appear only during mounted combat, just like hussars were using them.

I have posted the necessary resources here: https://www.loverslab.com/files/fil...ource-code-to-create-a-hussar-heraldic-armor/
Put:
- BRF in Modules\your module\Resource
- textures in Modules\your module\Textures
- sounds in Modules\your module\Sounds

First let's start with module.ini:
We gotta register our BRF. Add this somewhere below all the load_resource commands:
INI:
load_mod_resource = rndl_hussar_wings
Also in module.ini find this line:
INI:
scan_module_sounds = 0
and change it to:
INI:
scan_module_sounds = 1
While you're at it, make sure that this line is set to 1:
INI:
scan_module_textures = 1
It normally is, but it won't hurt to make sure.

Then go to module_items.py - new entries should be added somewhere at the end of the file for savegame compatibility:
Python:
    #MOD BEGIN - hussar heraldic armor (winged on horseback, not winged on foot)
    #based on itm_heraldic_mail_with_surcoat, same stats and look, except for wings; 1st item is what's actually available in the game world, 2nd item is version with wings, we swap to it when agent is riding a horse
    ["rndl_hussar_heraldic_mail_on_foot","Hussar Heraldic Mail",[("heraldic_armor_new_a",0)],itp_merchandise|itp_type_body_armor|itp_covers_legs,0,3454,weight(22)|abundance(100)|head_armor(0)|body_armor(49)|leg_armor(17)|difficulty(0),imodbits_armor,[(ti_on_init_item,[(store_trigger_param_1,":agent_no"),(store_trigger_param_2,":troop_no"),(call_script,"script_shield_item_set_banner","tableau_heraldic_armor_a",":agent_no",":troop_no"),                                         ])]],
    ["rndl_hussar_heraldic_mail_riding","{!}not inventory item",[("heraldic_armor_new_a",0)],                itp_type_body_armor|itp_covers_legs,0,3454,weight(22)|abundance(100)|head_armor(0)|body_armor(49)|leg_armor(17)|difficulty(0),imodbits_armor,[(ti_on_init_item,[(store_trigger_param_1,":agent_no"),(store_trigger_param_2,":troop_no"),(call_script,"script_shield_item_set_banner","tableau_heraldic_armor_a",":agent_no",":troop_no"),(cur_item_add_mesh,"@rndl_hussar_wings"),])]],
    #MOD END - hussar heraldic armor (winged on horseback, not winged on foot)
First item has no wings and is what should be accessible in the game. This is the item you want to give to troops or player.
Second item is the actual armor with wings. This is necessary for wing attaching/detaching, which I will explain later.
Notice the unusual call in item trigger - this makes sure that tableau mesh (the flag pattern) is only attached to base armor, not the wings. That's why they are not originally a part of the armor, and are added later, after tableau is applied.

This is it for adding the wings themselves - the code above is all you need to attach them to any armor you want.
Code below deals strictly with attaching/detaching the wings.

Now for the extra functionalities:
- attaching/detaching wings when we are riding/not riding a horse in battle
- wings making their famous noise
- wings scaring the hell out of enemies

Let's start with a helper script for switching troop's equipment (from riding gear to on-foot gear and vice versa). We will be using it a lot later.
This goes in module_scripts.py:
Python:
    #MOD BEGIN - swap riding/on foot equipment
    #helper script to swap agent's gear in battle
    #Input: param1 = agent id, optional param2 = mode
    #mode = 0 means swapping to on-foot gear from riding gear
    #mode = 1 means swapping from on-foot gear to riding gear
    ("rndl_agent_swap_weapons",
        [
            (store_script_param,":agent",1),
            (store_script_param,":mode",2),
            #it's possible that both are true
            (try_begin),
                (eq,":mode",0), #swapping to on foot gear
                (agent_has_item_equipped,":agent","itm_rndl_hussar_heraldic_mail_riding"),
                (agent_unequip_item,":agent","itm_rndl_hussar_heraldic_mail_riding"),
                (agent_equip_item,":agent","itm_rndl_hussar_heraldic_mail_on_foot"),
            (else_try),
                (eq,":mode",1), #swapping to riding gear
                (agent_has_item_equipped,":agent","itm_rndl_hussar_heraldic_mail_on_foot"),
                (agent_unequip_item,":agent","itm_rndl_hussar_heraldic_mail_on_foot"),
                (agent_equip_item,":agent","itm_rndl_hussar_heraldic_mail_riding"),
            (try_end),
        ]
    ),
    #MOD END - swap riding/on foot equipment
Remember that for maximum savegame compatibility, new entities should always be added at the end of the file.

Now a helper variable for fear effect. Place this in module_constants.py, preferably somewhere logical, like after all the agent slot definitions and right before faction slot definitions:
Python:
#!#MOD BEGIN - hussar wings
#this slot looks unoccupied, so unless other mods use it, let's take it
slot_agent_rndl_wings_fear  = 40
#!#MOD END - hussar wings

Next the declarations for sounds that our wings will use. Historically their sound was supposedly so loud that people would lose their ability to think straight hearing them! Well, worry not, I struggled to make them this loud. Even after all my efforts they are no louder than horse hooves. But if you feel like they are too loud, just replace the 0 with sf_vol_15 flag (15 means "maximum" volume, which is like 30% of achievable volume. Lower numbers are even lower volumes.
Anyway, this goes in module_sounds.py:
Python:
    #MOD BEGIN - hussar wings effects
    #sadly, testing shows that max volume of sf_vol_15 is actually not full volume, but maybe like 30% of it, and it can't even compete with the sound of horse hooves...
    #solution - don't set any flags (then the sound pwith full amplitude barely  so quiet that it can barely compete with the sound of horse hooves - the only way to make the wings actually loud is to NOT set any flags for them... even setting max priority and max volume makes them so quiet, that they can't even compete with the sounds of horse hooves...
    ("rndl_hussar_wings_1",0,["freesound_org_102192_wing01.ogg","freesound_org_102192_wing02.ogg","freesound_org_102192_wing03.ogg","freesound_org_102192_wing04.ogg","freesound_org_102192_wing05.ogg","freesound_org_102192_wing06.ogg","freesound_org_102192_wing07.ogg","freesound_org_102192_wing08.ogg","freesound_org_102192_wing09.ogg","freesound_org_102192_wing10.ogg","freesound_org_102192_wing11.ogg","freesound_org_102192_wing12.ogg","freesound_org_102192_wing13.ogg","freesound_org_102192_wing14.ogg"]),
    ("rndl_hussar_wings_2",0,["freesound_org_102192_wing15.ogg","freesound_org_102192_wing16.ogg","freesound_org_102192_wing17.ogg","freesound_org_102192_wing18.ogg","freesound_org_102192_wing19.ogg","freesound_org_102192_wing20.ogg","freesound_org_102192_wing21.ogg","freesound_org_102192_wing22.ogg","freesound_org_102192_wing23.ogg","freesound_org_102192_wing24.ogg","freesound_org_102192_wing25.ogg","freesound_org_102192_wing26.ogg","freesound_org_102192_wing27.ogg","freesound_org_102192_wing28.ogg"]),
    ("rndl_hussar_wings_3",0,["freesound_org_102192_wing29.ogg","freesound_org_102192_wing30.ogg","freesound_org_102192_wing31.ogg","freesound_org_102192_wing32.ogg","freesound_org_102192_wing33.ogg","freesound_org_102192_wing34.ogg","freesound_org_102192_wing35.ogg","freesound_org_102192_wing36.ogg","freesound_org_102192_wing37.ogg","freesound_org_102192_wing38.ogg","freesound_org_102192_wing39.ogg","freesound_org_102192_wing40.ogg","freesound_org_102192_wing41.ogg","freesound_org_102192_wing42.ogg"]),
    ("rndl_hussar_wings_4",0,["freesound_org_102192_wing43.ogg","freesound_org_102192_wing44.ogg","freesound_org_102192_wing45.ogg","freesound_org_102192_wing46.ogg","freesound_org_102192_wing47.ogg","freesound_org_102192_wing48.ogg","freesound_org_102192_wing49.ogg","freesound_org_102192_wing50.ogg","freesound_org_102192_wing51.ogg","freesound_org_102192_wing52.ogg","freesound_org_102192_wing53.ogg","freesound_org_102192_wing54.ogg","freesound_org_102192_wing55.ogg","freesound_org_102192_wing56.ogg"]),
    ("rndl_hussar_wings_5",0,["freesound_org_102192_wing57.ogg","freesound_org_102192_wing58.ogg","freesound_org_102192_wing59.ogg","freesound_org_102192_wing60.ogg","freesound_org_102192_wing61.ogg","freesound_org_102192_wing62.ogg","freesound_org_102192_wing63.ogg","freesound_org_102192_wing64.ogg","freesound_org_102192_wing65.ogg","freesound_org_102192_wing66.ogg","freesound_org_102192_wing67.ogg","freesound_org_102192_wing68.ogg","freesound_org_102192_wing69.ogg","freesound_org_102192_wing70.ogg"]),
    #MOD END - hussar wings efects

Here's a short explanation on what wings will do to enemies. It took a lot of consideration on how to approach it, so I wrote an essay about it. Spoilering it because it's long. Has no code, you can skip it if you don't care. TL;DR is - random chance to scare, scared horses run from the field and never come back, troops get paralyzed with fear for about 2 sec and don't defend themselves nor attack.
Wings were the hallmark of Polish hussars - unit generally considered as one of the best of that time period. The rumors that hussars have never lost a battle were so common, that mercenary contracts would often include a clause allowing the troops to leave the battlefield with no repercussions, if the opposing army fielded hussar units.
The wings are easy to spot - just that, paired with the infamy of hussars was already enough to influence the mental state of troops. On top of that, when hussars were charging in formation, wings were making terrible noise, causing further panic, chaos and disorganizing enemy lines. Hussar charge often had almost no casualties - enemies were dropping the pikes, not sure whether to run, or surrender, or play dead. The usual choice was to flee. Then hussars would just cut down the disorganized enemy.
This will of course not work on allies. It will also not work on hussars attacked by hussars (including horses).
For horses, we will give them a random chance to flee if hussars are nearby. The noise scares them away. They will throw off the rider and run away from the battlefield. This is a hard counter for Khergit armies.If chances are set high enough, it could make wings an absolute bane of Khergits.
In Warband making troops flee is easy to code, but would cause problems. First of all, there are already many mods that try to make the enemies flee less. Historically, hussars would rout the enemy and then slaughter the easy to kill fleeing opponents. In Warband however troops would get stuck on each other, fail to chase, switch to non-fleeing targets, and then most of the enemy army would have fled with no casualties, which makes the situation as if the battle haven't even happened. That wouldn't happen in real life. So instead of making them flee, we will make them "paralyzed with fear" - make them easier to kill by impairing their ability to defend themselves.

Anyway, next up are module_mission_templates.py - somewhere at the beginning of the file, preferably right under
Python:
af_castle_lord = af_override_horse|af_override_weapons|af_require_civilian
put these definitions:
Python:
#MOD BEGIN - swap riding/on foot equipment
rndl_riding_gear_swap_on_spawn = (ti_on_agent_spawn,0,0,
    [],
    [
        (store_trigger_param_1,":agent_no"),
        (neg|agent_is_human,":agent_no"), #it's a horse - riders spawn right before their horses, so best way to check if human agent has a horse is to catch the horse spawning, and then get its rider, not check the rider, because at spawn he has no horse yet
        (agent_get_rider,":rider",":agent_no"),
        (gt,":rider",-1), #horses normally spawn with riders, but just in case
        (call_script,"script_rndl_agent_swap_weapons",":rider",1), #1 means swapping from on-foot gear to riding gear
    ]
)
rndl_riding_gear_swap_on_dismount = (ti_on_agent_dismount,0,0,
    [],
    [
        (store_trigger_param_1,":agent_no"),
        #not checking if agent is human, because horse can't dismount a horse
        (call_script,"script_rndl_agent_swap_weapons",":agent_no",0), #0 means swapping from riding gear to on-foot gear
    ]
)
rndl_riding_gear_swap_on_mount = (ti_on_agent_mount,0,0,
    [],
    [
        (store_trigger_param_1,":agent_no"),
        #not checking if agent is human, because horse can't dismount a horse
        (call_script,"script_rndl_agent_swap_weapons",":agent_no",1), #1 means swapping from on-foot gear to riding gear
    ]
)
#MOD END - swap riding/on foot equipment
#MOD BEGIN - hussar wings effects
rndl_wings_fear_effect = (2,0,0, #trigger frequency (2 sec), 0 delay, 0 rearm delay (no point doing it more often than 2 sec, because enemies get cached every 2 sec anyway)
    [],
    [
        #for simplicity, in the comments below I will refer as "hussar" to all agents wearing Hussar Heraldic Armor with wings attached to it
        (try_for_agents,":agent_no"), #horse agent to scare
            (neg|agent_is_human,":agent_no"), #scaring horses - they will throw the rider off and flee the battlefield
            (try_begin),
                (neg|agent_slot_eq,":agent_no",slot_agent_rndl_wings_fear,1), #isn't already affected by wings
                (agent_get_rider,":rider",":agent_no"),
                (ge,":rider",0),
                (neg|agent_has_item_equipped,":rider","itm_rndl_hussar_heraldic_mail_riding"), #horses of hussars shouldn't be scared of enemy hussars
                (call_script,"script_rndl_count_nearby_winged_troops",":rider"), #returns 0~16 to reg0 (number of hussars among the 16 closest enemies, counting only hussars within 50m radius)
                (assign,":fear_factor",reg0),
                (gt,":fear_factor",0), #skip if no hussars found
                #here there will be some math, you can trust me on this or try changing the code below at your own risk...
                #here's how it works - you can assign the % chance of the horse fleeing for every hussar found
                #you can also make the 1st hussar found count more, which may be useful when you're not planning to give winged armor to regular troops, to give more impact the the player wearing the winged armor (although the wings reduce visibility in 3rd person, so you may actually prefer to give them to your companions instead?)
                #if you're planning to field armies of hussars, I'd recommend using 0.1% for 1st hussar, and then +0.1% for every next, up to neat 1.6% chance (remember - this triggers every 2 sec, and once they flee, they never stop, so 1.6% is plenty!)
                #if you're planning small numbers of hussars however, my suggestion is 0.5% for first hussar (5x bonus) and 0.1% for every next hussar beyond the 1st
                #if however you're planning to be the only one on the battlefield wearing hussar wings, you may want to give a bigger chance for the 1st hussar found
                (assign,":chance_per_hussar_denominator",1000), #value of 1000 means 1/1000 or 0,1% chance for every hussar found among those 16 closest enemies to cause horses to flee (up to 1.6% chance in best case scenario with 16 hussars in range)
                (assign,":1st_hussar_chance_multiplier",1), #this multiplies the chance of making horse flee for the 1st hussar found - make him count double, triple or whatever (1 means no bonus and he counts as 1 hussar, 2 means double the chance for 1st hussar, 3 means triple and so on, while a negative value means negative bonus, so with -1 for example, you need at least 2 hussars in range to cause any fleeing at all, and with -2 you need at least 3)
                (val_sub,":1st_hussar_chance_multiplier",1),
                (store_sub,":apply_effect_threshold",":chance_per_hussar_denominator",":1st_hussar_chance_multiplier"),
                (store_random_in_range,":rand",0,":chance_per_hussar_denominator"), #getting random chance for this horse
                (val_add,":fear_factor",":rand"), #fear factor is now 1~1015 (1-1000 if there was 1 winged enemy, 2-1001 if there were 2, up to 16-1015 if there were 16)
                (ge,":fear_factor",":apply_effect_threshold"), #comment out this line for testing (makes the chance 100%)
                #applying effect - making the horse agent to flee
                (agent_start_running_away,":agent_no"), #force the horse to flee
                (agent_set_slot,":agent_no",slot_agent_is_running_away,1), #note that it's fleeing
                (agent_set_slot,":agent_no",slot_agent_rndl_wings_fear,1), #note that it's because of wings
                #forcing horse to flee means that rider gets thrown off without triggering ti_on_dismount, so we need this:
                (call_script,"script_rndl_agent_swap_weapons",":rider",0), #0 means swapping from riding gear to on-foot gear
            (try_end),
        (else_try), #human agent to scare
            (neg|agent_slot_eq,":agent_no",slot_agent_rndl_wings_fear,1), #isn't already affected by wings
            (try_begin),
                (neg|agent_has_item_equipped,":agent_no","itm_rndl_hussar_heraldic_mail_riding"), #hussars shouldn't be scared of enemy hussars
                (call_script,"script_rndl_count_nearby_winged_troops",":agent_no"), #returns 0~16 to reg0
                (assign,":fear_factor",reg0), #currently stores how many winged enemies were among the 16 closest ones, counting only enemies within 50m radius
                #math here is the same as for horses above, the only difference are chances - humans don't get scared permanently, only for 2 sec, so we can risk some higher chances of the effect being applied
                (assign,":chance_per_hussar_denominator",100), #value of 100 means 1/100 or 1% chance for every hussar found among those 16 closest enemies to paralyze the agent with fear (up to 16% chance in best case scenario with 16 hussars in range)
                (assign,":1st_hussar_chance_multiplier",1), #this multiplies the chance of making horse flee for the 1st hussar found (1 means no bonus and he counts as 1 hussar)
                (val_sub,":1st_hussar_chance_multiplier",1),
                (store_sub,":apply_effect_threshold",":chance_per_hussar_denominator",":1st_hussar_chance_multiplier"),
                (store_random_in_range,":rand",0,":chance_per_hussar_denominator"), #getting random chance for this horse
                (val_add,":fear_factor",":rand"), #fear factor is now 1~1015 (1-1000 if there was 1 winged enemy, 2-1001 if there were 2, up to 16-1015 if there were 16)
                (ge,":fear_factor",":apply_effect_threshold"), #disable this line for testing (makes the chance 100%)
                #applying effect - rooting agent in place, making him stop fighting
                (agent_get_position,pos17,":agent_no"), #get his current position
                (agent_set_scripted_destination_no_attack,":agent_no",pos17), #make him go there (distance to walk: 0m) and wait until further notice without attacking
                (agent_set_slot,":agent_no",slot_agent_is_in_scripted_mode,1), #note that he's being controlled
                (agent_set_slot,":agent_no",slot_agent_rndl_wings_fear,1), #note that it's because of wings
            (try_end),
        (else_try), #human agent already scared
            (call_script,"script_rndl_count_nearby_winged_troops",":agent_no"), #returns 0~16 to reg0
            (assign,":fear_factor",reg0), #currently stores how many winged enemies were among the 16 closest ones, counting only enemies within 50m radius
            (try_begin),
                #math here is the same as for scaring humans above, but this time we want to check if the chance is below threshold, and remove the effect - one thing worth noting is that no hussars around means guaranteed instant removal of effect
                (assign,":chance_per_hussar_denominator",100), #value of 100 means 1/100 or 1% chance for every hussar found among those 16 closest enemies to paralyze the agent with fear (up to 16% chance in best case scenario with 16 hussars in range)
                (assign,":1st_hussar_chance_multiplier",1), #this multiplies the chance of making horse flee for the 1st hussar found (1 means no bonus and he counts as 1 hussar)
                (val_sub,":1st_hussar_chance_multiplier",1),
                (store_sub,":apply_effect_threshold",":chance_per_hussar_denominator",":1st_hussar_chance_multiplier"),
                (store_random_in_range,":rand",0,":chance_per_hussar_denominator"), #getting random chance for this horse
                (val_add,":fear_factor",":rand"), #fear factor is now 1~1015 (1-1000 if there was 1 winged enemy, 2-1001 if there were 2, up to 16-1015 if there were 16)
                (lt,":fear_factor",":apply_effect_threshold"), #disable this line for testing (makes the chance 100%)
                #removing effect - allowing agent to move and attack again
                (agent_clear_scripted_mode,":agent_no"),
                (agent_force_rethink,":agent_no"),
                (agent_set_slot,":agent_no",slot_agent_rndl_wings_fear,0), #clear the slot
                (agent_set_slot,":agent_no",slot_agent_is_in_scripted_mode,0), #clear the slot
            (try_end),
        (try_end),
    ]
)
rndl_wings_sound_effect = (0.5,0,0, #!#current sounds were designed for 0.5 sec frequency, if changed, all sound files must be redone from scratch
    [],
    [
        (store_random_in_range,":rand",0,5), #there is a limit of 32 sound files per sound definition, so we split our 70 sounds evenly between 5 definitions (the files are made randomly enough so that using only 1/5=20% of them for all agents in 1 loop should be fine - but not if we keep repeating the same 20% of sounds every 0.5 sec)
        (try_for_agents,":agent_no"),
            (agent_has_item_equipped,":agent_no","itm_rndl_hussar_heraldic_mail_riding"), #not checking if agent is human, because only humans can equip items anyway
            (agent_get_speed,pos15,":agent_no"), #get agent's speed
            #this is how speed works: it's stored in coordinates of the position register
            #X direction component: strafing speed to the sides, positive values mean moving right, negative values mean moving left (this is always zero for mounted agents, because horses can't strafe)
            #Y direction component: forwards/backwards speed, positive values mean forward, negative mean backwards
            #for humans on foot speed can only be calculated through Pythagorean theorem, but luckily for horses the X component is zero, so all we need to do is get the value
            #and we only need to do the operations below for mounted troops, so lucky us - let;'s get our value
            (position_get_y,":speed",pos15),
            #without tweaking the multipliers positions are generally in meters, so this speed is in meters per... god knows what, it's some unit of time, I don't know exactly - definitely not per frame, but not per sec or min either
            #but just to give a few examples:
            #human with high stats runs at the top speed of 458 m/unit forward, -308/+308 to the sides and around 286 backwards
            #the backward speed of a horse is -100 m/unit
            #horse switches from walk to trot around the speed of 200
            #slow gallop anim kicks in at 380, and fast gallop around 620
            #650 m/unit is required to couch a lance
            #top speed of Heavy Hunter (speed stat = 43) is 1003 m/unit (with maxed Riding stat of the rider)
            #sound duration is 3x longer than frequency of this trigger, meaning they will overlap and 3 sounds will usually play at once for 1 agent
            #this means gradual increase in volume when agent reaches sound making speed, and gradual disappearance of sound when he slows down beyond the sound making speed
            (ge,":speed",380), #as a threshold for wings to make sound we will take the slowest gallop speed
            (store_add,":wing_sound",":rand","snd_rndl_hussar_wings_1"), #5 loud sound definitions
            (agent_play_sound,":agent_no",":wing_sound"),
        (try_end),
    ]
)
#MOD END - hussar wings effects
Then we can reuse them in various mission templates below, without copying all their code.
(Code above has tons of comments explaining what it does.)

They should be used like this, by putting them in consequence block of the mission template (example for ai_training):
Python:
    ("lead_charge",mtf_battle_mode|mtf_synch_inventory,charge,"You lead your men to battle.",
        [
            (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
            (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
            (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
            (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
        ],
        [
            #MOD BEGIN - swap riding/on foot equipment
            rndl_riding_gear_swap_on_spawn,
            rndl_riding_gear_swap_on_dismount,
            rndl_riding_gear_swap_on_mount,
            #MOD END - swap riding/on foot equipment
            #MOD BEGIN - hussar wings
            rndl_wings_fear_effect,
            rndl_wings_sound_effect,
            #MOD END - hussar wings
            (ti_on_agent_spawn,0,0,
            #... the rest of the code continues, not important for us
repeat the same for 4 more triggers:
- lead_charge (already done in example above)
- village_attack_bandits
- village_raid
- ai_training ← for this one skip rndl_wings_fear_effect - it could mess with heavily scripted training sessions (add the other 4 definitions though)
- multiplayer_ccoop

Now for the finishing touches, you can add the item description, to inform the player that the armor has wings and why the heck are they not visible, by editing the existing script_game_get_item_extra_text. I'm pasting the entire script with changes clearly marked:
Python:
    ("game_get_item_extra_text",
        [
            (store_script_param,":item_no",1),
            (store_script_param,":extra_text_id",2),
            (store_script_param,":item_modifier",3),
            (try_begin), #food
                (is_between,":item_no",food_begin,food_end),
                (try_begin),
                    (eq,":extra_text_id",0),
                    (assign,":continue",1),
                    (try_begin),
                        (this_or_next|eq,":item_no","itm_cattle_meat"),
                        (this_or_next|eq,":item_no","itm_pork"),
                        (             eq,":item_no","itm_chicken"),
                        (eq,":item_modifier",imod_rotten),
                        (assign,":continue",0),
                    (try_end),
                    (eq,":continue",1),
                    (item_get_slot,":food_bonus",":item_no",slot_item_food_bonus),
                    (assign,reg1,":food_bonus"),
                    (set_result_string,"@+{reg1} to party morale"),
                    (set_trigger_result,0x4444FF),
                (try_end),
            (else_try), #readable books
                (is_between,":item_no",readable_books_begin,readable_books_end),
                (try_begin),
                    (eq,":extra_text_id",0),
                    (item_get_slot,reg1,":item_no",slot_item_intelligence_requirement),
                    (set_result_string,"@Requires {reg1} intelligence to read"),
                    (set_trigger_result,0xFFEEDD),
                (else_try),
                    (eq,":extra_text_id",1),
                    (item_get_slot,":progress",":item_no",slot_item_book_reading_progress),
                    (val_div,":progress",10),
                    (assign,reg1,":progress"),
                    (set_result_string,"@Reading Progress: {reg1}%"),
                    (set_trigger_result,0xFFEEDD),
                (try_end),
            (else_try), #reference books
                (is_between,":item_no",reference_books_begin,reference_books_end),
                (try_begin),
                    (eq,":extra_text_id",0),
                    (try_begin),
                        (eq,":item_no","itm_book_wound_treatment_reference"),
                        (str_store_string,s1,"@wound treament"),
                    (else_try),
                        (eq,":item_no","itm_book_training_reference"),
                        (str_store_string,s1,"@trainer"),
                    (else_try),
                        (eq,":item_no","itm_book_surgery_reference"),
                        (str_store_string,s1,"@surgery"),
                    (try_end),
                    (set_result_string,"@+1 to {s1} while in inventory"),
                    (set_trigger_result,0xFFEEDD),
                (try_end),
            #MOD BEGIN - hussar heraldic armor (winged on horseback, not winged on foot)
            (else_try), #hussar wings
                (eq,":item_no","itm_rndl_hussar_heraldic_mail_on_foot"),
                (try_begin),
                    (eq,":extra_text_id",0),
                    (try_begin),
                        (eq,":item_no","itm_book_wound_treatment_reference"),
                        (str_store_string,s1,"@wound treament"),
                    (else_try),
                        (eq,":item_no","itm_book_training_reference"),
                        (str_store_string,s1,"@trainer"),
                    (else_try),
                        (eq,":item_no","itm_book_surgery_reference"),
                        (str_store_string,s1,"@surgery"),
                    (try_end),
                    (set_result_string,"@Wings are detachable and worn only during mounted combat."),
                    (set_trigger_result,0xFFEEDD),
                (try_end),
            #MOD END - hussar heraldic armor (winged on horseback, not winged on foot)
            (try_end),
        ]
    ),
 
Last edited:
Thanks for the work you have put into this! I have however two concerns:
  1. My webbrowser shows warnings at your used webpage, it's also a rather unusual one to share files. Could you please use moddb or another filehoster for the file and screenshot?
  2. "Based on meshes from M&B With Fire and Sword", this sounds for me like you are using mesh parts from WFaS for your work here. That is fine for mods for WFaS but modders of Native/VC/NW wouldn't be allowed to make use of them. Did you keep that in mind?
 
I did keep that in mind, so I wrote - to quote myself - "Wings come from a hussar armor present in Mount & Blade: With Fire and Sword. (...) So basically, it would be fair to buy the game if you want to use this resource in Warband."
I can't exactly stop people from piracy, but I can inform them what's the fair use.
I just tweaked the description a bit to make it more clear: "So basically, you should own M&B With Fire and Sword if you want to use this resource in Warband (otherwise it's not fair use, according to TaleWorlds policy)."

As to the site giving you warnings - I'm surprised to hear that. LoversLab is a safe mod hosting that I've been using for Skyrim mods for the last 10 years or more. The community is mature and as such allows adult mods. Maybe that's where warnings come from? No idea. For example Dickplomacy Reloaded for Warband (18+) is also there.
I chose LoversLab because:
- MBRepository is gone (that's where I was posting Warband mods years ago)
- I will never (again) set foot on NexusMods, not as an uploader at least
- I already have an account on LoversLab and know the rules through and through, I know what will get me in trouble with admins and what's ok
- I've never had an account on ModDB and am not very familiar with their rules
 
You should own M&B With Fire and Sword if you want to use this resource in Warband (otherwise it's not fair use, according to TaleWorlds policy).
That's not how it works. If your base mesh is coming from WFaS, modders are only allowed to use the asset in WFaS mods. That has nothing to do with 'You owe WFaS? Then you are allowed to use this at Warband'. Even if the modders owns it, the modder would need to make sure that every player of his mod owns the game too which is not feasible.

LoversLab is a safe mod hosting that I've been using for Skyrim mods for the last 10 years or more. The community is mature and as such allows adult mods.
Loverslab seems to be primarily an "adult" modding community (which also explains why Dickplomacy is present there). It was unknown to me until now, I talked with a few other modders and they mentioned that it is ok even if a rather unusual choice. So it's fine for me now.
 
That's not how it works. If your base mesh is coming from WFaS, modders are only allowed to use the asset in WFaS mods. That has nothing to do with 'You owe WFaS? Then you are allowed to use this at Warband'. Even if the modders owns it, the modder would need to make sure that every player of his mod owns the game too which is not feasible.
What do you suggest I do then?
Is changing the description to "This asset should only be used in mods dedicated for players who own both Warband and With Fire and Sword - otherwise it's a breach of TaleWorlds policy and falls within the definition of piracy." enough?
Or should other steps be taken? Should I delete the asset?
 
Your work is then a LSP, a limited source pack, which means that modders are allowed to use it under specific conditions (you can also use LSP if you don't want that others make money with their mod etc.). My suggestion would be to add this passage:

Due to the base mesh coming from WFaS this is a limited source pack (LSP), which means that you are allowed to use it only at a mod/submod for WFaS.

With this sentence your work is clear and it's up to the modder to follow the rules.

Sorry to be bothering you at this, I still like the work you did here :grin:
 
Your work is then a LSP, a limited source pack, which means that modders are allowed to use it under specific conditions (you can also use LSP if you don't want that others make money with their mod etc.). My suggestion would be to add this passage:

Due to the base mesh coming from WFaS this is a limited source pack (LSP), which means that you are allowed to use it only at a mod/submod for WFaS.

With this sentence your work is clear and it's up to the modder to follow the rules.

Sorry to be bothering you at this, I still like the work you did here :grin:
Ok, added.
 
Last edited:
Updated the wing code.
Now wings can scare enemy troops and horses. They also make sounds, like they should.
 
Back
Top Bottom