Author Topic: Navy's Modding Tutorial & Archive  (Read 2869 times)

0 Members and 1 Guest are viewing this topic.

Offline usnavy30

  • Colonel
  • *
  • Posts: 1980
  • Former Freelance Modder
    • View Profile
  • Side: Neutral
Navy's Modding Tutorial & Archive
« on: July 30, 2014, 11:12:07 am »


So I have now been in the modding scene for Mount & Blade: Warband for nearly a year now and wished to share my knowledge with the community.
(and as an archive of information should I ever forget something)


Native



Napoleonic Wars
NW is a lot simpler yet different from Native, but the source code has been rewritten from Native to be easier to modify.

As a beginning point, please read this basic modding tutorial before proceeding.
https://www.fsegames.eu/forum/index.php?topic=11836.0

Now I will pick up where Willhelm left off at the end of the above tutorial, that's right this section is about coding and specifically openBRF and how to use it. So you have openBRF program, it's a great program once you get to know it. The first thing to acknowledge is the difference how Napoleonic Wars (NW) works along with openBRF.

The most basic unit that I chose to start replacing is France's 45e ranker bit by bit and I discovered how the models work to form the troop itself, in openBRF the models from a hat to a torso to pants and to weapons all are called meshes in openBRF.

1. The hat/shako

France's hats are located in mm_french_hats.brf, scroll a bit to find the 45e hat located among the rest of the headwear.
Open for 45e hat in openBRF
[close]

Once you have found it now you need to go back and forth between openBRF and notepad++ windows to locate a mesh then to study the coding how it is actually added in-game.

Let's see how the MS (Module System) functions to add a new item.

Open notepad++ and select the mmdev - MS then select the following file module_items.py and open it in notepad++
module_items.py
[close]
As you can see all the items the game uses are stored here, in a organized method so that it is easy to find and differentiate between hats, uniforms, pants, weapons, flags, horses, etc

So now we can see the game sorts the items by types and we go on to the next file on how they are added to the playable troops.

Next open up the python file module_troops.py and find France's troop codes, you will notice the item's name in this case is exactly the same for the itm name to assign to a troop! Also a good tip, itm names do not like capital Letters!
module_troops.py
[close]

Now that you know how the module system works to add items to a troop we can begin to replace the troop's inventory equipment.

The most easiest way is just to replace the mesh while keeping the same name of the mesh in openBRF in order to do this getting used to renaming meshes to disable and enable is key.

We are examining the mesh french_inf_shako_45e_ranker you can use any hat to replace it with and it will be client-side only if you keep the mesh name as is. In a stand alone module one can easily rename the mesh entirely to something different.

So say we like the look of the 45e officer bicorne let's use that instead for this tutorial.

Rename (press F2 as a hotkey) the french_inf_shako_45e_ranker to french_inf_shako_45e_ranker_old as this disables the mesh from the troop's inventory.
Copy french_inf_bicorne_45_officer mesh and duplicate it with right click on the mesh > Duplicate and it will create a copy. Rename the bicorne copy to french_inf_shako_45e_ranker.
Like so
[close]
To note for the hat you will notice the hat uses meshes with the end tag names of .1 and so on these are attached like feathers, emblems or in this case envmap straps and plate. To totally disable these for the bicorne added, rename these attached meshes to french_inf_shako_45_ranker_old.1 like so to disable them.
Lastly you will notice these meshes called lod2 and lod4 for the hat, these meshes are used when the item is far away in-game else you would see bald troops miles away and it ruins 'immersion' so rename these meshes also to french_inf_shako_45e_ranker_old.lod2/4 to totally disable the 45 shako, attached meshes and lods, then after duplicating and renaming the one bicorne lod so you know your bicorne looks right in-game up close and far away.

Flair of bicorne on ranker because why not
[close]


That was a lot of information I know, but practice makes perfect and the info you just read now can also be applied in the same method for the rest of a troop.

2. The uniform itself, the torso


The torso makes up the main body except the pants, as those are separate. The torso is your actual uniform and like the hat, it has attached meshes to complete the field equipment the troop carries like the white straps of our ranker and his backpack along with the lods for the most important meshes that disappear at a noticeable distance.

The uniforms can be found in mm_french_uniforms.brf Find french_45e_body_ranker then back to notepad and you will notice the torso is set up exactly how the hats worked in module_items and module_troops

module_items torso location
[close]
The torso mesh and material name is exactly the same so that is convenient.

module_troops
[close]

Here you see the torso of the ranker/troop always comes first in the equipment.

So let's give our ranker a different torso for his uniform, in my experience I used the AEF mini mod to begin getting to use to 1812 items to code in. I used the 1st US Infantry's torso for this replacing

Link to AEF mini-mod
https://www.fsegames.eu/forum/index.php?topic=14586.0
Copy Napoleonic Wars and use the copy module to install the AEF mini mod to see U.K. faction changed to U.S.

Find in your AEF mini mod copy module's mmbrituniforms.brf the british_infantry_ranker mesh to see the blue uniform
mmbrituniforms
[close]

Now to code in the torso, edit in module_troops.py this line
Code
   ### FRANCE ###
  ["french_infantry","45e Regiment d'Infanterie de ligne","Line Infantry",tf_guarantee_all,0,0,fac_france,
   [itm_french_45e_body_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville],
   def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],

To replace the 45e torso like this in the troop's equipment
Code
   ### FRANCE ###
  ["french_infantry","45e Regiment d'Infanterie de ligne","Line Infantry",tf_guarantee_all,0,0,fac_france,
   [itm_british_infantry_ranker,itm_french_voltigeur_officer_pants,itm_french_inf_shako_45_ranker,itm_bullets,itm_french_charleville],
   def_attrib_multiplayer|level(20),wpex(50,5,130,5,150,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2],

Go to your mmdev - MS and make sure to SAVE your notepad++ edits before compiling every time. Now compile the module from build_module and if you did it correctly with no syntax errors you will get a nice and short, clean compiling successful.
A standard compile with no errors
[close]

Boot up your copy module and go in-game to France and check the first infantry ranker's torso you will now see it looks like the image below in the spoiler.
Torso replaced
[close]

>>>Notes
For a mesh you mostly just have to edit it from the get-go in a BRF file, if not you must import it as a .obj and as a static obj in most cases. OpenBRF features the Import option in it's bar to import static/rigged objects that are not already in a BRF file but must be to work. In my case with the AEF mini mod I had all the beginning items in BRF files thanks to the mini mod.

Meshes work like so, you have the actual mesh which references to a Material in the middle that says Data above it. The Material is used to give the mesh it's texture by being a bridge between the mesh and Texture as both material and texture must be accounted for to have a new item. The Material then references the Texture for the main texture called DiffuseA in the Material tab of mmmaterials in most cases in this case it is mmtextures for the mini-mod. Material uses bump and spec textures to further improve upon a base texture and bumps are blue, specs are black and grey.
mmbrituniforms mesh
[close]
the material tab
[close]

Now if you go to Textures tab right next to it you will see textures are simpler than materials.
the adjacent texture tab
[close]
Lastly for textures you will see under Data again this time a part called location and a button saying open it right next to it, click that and it will automatically open into your module's Textures folder to show you the DDS file the game loads in for every item.
Jumping automatically to Textures folder
[close]

Congratulations you have successfully replaced a hat and a torso, the most basic of items to begin replacing a troop of his equipment. Now are you up to the task to complete the gear replacing? I will admit it is no easy task the first time doing, and is tedious but such is modding the game if you want to make total conversion modules that take place in a different theme or time period. Many mods starting out don't have a coder, this is where you and I come into the picture to do the foundation work of a module, like I did for War of 1812 that was in need of another coder and quick. Hence I dropped by to offer my service to get the mod back up to speed, and when I saw players testing the module in the beta test it is very satisfying seeing a job well done so far and continue to do so to make a module people enjoy, it's the personal peace and achievement coders receive when all is said and done of the backbone coding, else mods would continue to fail when highly expected to release. The items won't code themselves in you know.

« Last Edit: July 30, 2014, 02:17:32 pm by usnavy30 »
How To Run A Mod Installer.exe
Quote
Hello.. I have a problem... It says I don't have Mount&Blade Warband: Napoleonic War and I have to buy it
Try joining a regular Napoleonic Wars server and then re-running the installer.

Offline usnavy30

  • Colonel
  • *
  • Posts: 1980
  • Former Freelance Modder
    • View Profile
  • Side: Neutral
Re: Navy's Modding Tutorial & Archive
« Reply #1 on: July 30, 2014, 12:07:32 pm »
Reserved

Today's feature presentation: Fixable Bayonets (OSP) by Azrooh http://forums.taleworlds.com/index.php/topic,272505.0.html
Quote from: Azrooh
Hey everyone, I've gotten a lot of requests for this code I wrote awhile back, so I figured I'd post it open-source as it seems to be something that quite a few people could use.
This was originally made for NW, but it will work for either module.

This allows you to detach or attach a bayonet. That's all it does. Well, I guess you could use it for switching between two weapons that aren't bayoneted versions if you'd like. You get to pick a fancy animation for it and there's a cooldown to prevent you from spamming it. It should 'remember' your ammo status as long as you can fire from the bayoneted version of the gun, so attaching and detaching the bayonet won't magically give you a round in the chamber or take one away.

Uses:
1 multiplayer event
2 item slots
1 agent slot

Many times people would like this feature but have some things missing from the original post of codes.


I have set a name to each new code as (code) so you know which PY file it goes in.
Quoted lines as (Quote) indicates points of reference in the guide.

header_common.py
1st is under line 53 starting at #server events put the following second code below this first line:
multiplayer_event_return_agent_set_item                       = 122
Code: header_common.py
multiplayer_event_fixBayonet                                  = 123

module_constants.py
2nd is under line 15 starting at Item Slots put the following second code below this first line:
slot_item_multiplayer_availability_linked_list_begin = 3 #temporary, can be moved to higher values
Code: module_constants.py
slot_item_bayonetItem = 4
slot_item_isFixed = 5
Under line 26 starting at Agent Slots put the following second code below this first line:
slot_agent_walker_occupation      = 26
Code: module_constants.py
slot_agent_bayonetCooldown        = 27

module_mission_templates.py
3rd is under line 53 starting at end of multiplayer_server_log_player_leave  script
Code: module_mission_templates.py
Fixbayoneta = (
      ti_before_mission_start, 0, 0, [],
       [
(item_set_slot,"itm_british_brown_bessnobayonet",slot_item_bayonetItem,"itm_british_brown_bessb"), #set each non-bayoneted rifle to its bayoneted version
(item_set_slot,"itm_british_brown_bessb",slot_item_bayonetItem,"itm_british_brown_bessnobayonet"), #set each bayoneted rifle to its non-bayoneted version
(item_set_slot, "itm_british_brown_bessb", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed    
(item_set_slot,"itm_french_charlevillenobayonet",slot_item_bayonetItem,"itm_french_charlevilleb"), #set each non-bayoneted rifle to its bayoneted version
(item_set_slot,"itm_french_charlevilleb",slot_item_bayonetItem,"itm_french_charlevillenobayonet"), #set each bayoneted rifle to its non-bayoneted version
(item_set_slot, "itm_french_charlevilleb", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed
#(display_message,"@MTA"),
   ])

Fixbayonetb = ( 
      0, 0, 0, [(key_is_down,key_b),],
       [
(multiplayer_get_my_player,":player"),
(player_get_agent_id,":playerAgent",":player"),
(multiplayer_send_2_int_to_server,multiplayer_event_fixBayonet,1,":playerAgent"),
#(display_message,"@MTB"),
   ])
   
Fixbayonetc = (
      3, 0, 0, [],
       [
   (multiplayer_is_server),
   (try_for_agents,":curAgent"),
(agent_get_slot,":bayonetCooldown",":curAgent",slot_agent_bayonetCooldown),
(val_sub,":bayonetCooldown",3),
(try_begin),
(lt,":bayonetCooldown",0),
(assign,":bayonetCooldown",0),
(try_end),
(agent_set_slot,":curAgent",slot_agent_bayonetCooldown,":bayonetCooldown"),
#(display_message,"@MTC"),
(try_end),
   ])    #Bajo  
Stop at multiplayer_event_kill_stray_horses  script start
Under line 3468 starting at mm_multiplayer_common  script add the following lines at the end of   #MM Multiplayer Commons like so below this first line:
  multiplayer_client_surrender,
Code: module_mission_templates.py
  Fixbayoneta,
  Fixbayonetb,
  Fixbayonetc,
This ^^^^^^^^^^^^^^^^^^^^^ part is the part forgot to be mentioned on the original thread, thanks to B&I mod I found the missing pieces

module_scripts.py
4th is under line 7391 starting at the end of this script:
Quote
            (multiplayer_send_message_to_player, ":player_no", multiplayer_event_return_confirmation),
          (else_try),
            (try_begin),
              (eq,":spawn_is_ok",0),
              (assign,":error_message","str_invalid_prop_place"),
            (else_try),
              (assign,":error_message","str_invalid_prop_select"),
            (try_end),
            (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_show_multiplayer_message, multiplayer_message_type_error, ":error_message"),
            (multiplayer_send_message_to_player, ":player_no", multiplayer_event_return_rejection),
          (try_end),
        (try_end),
       # Beaver End
       (else_try),
After the last else_try the #Bajo script goes immediately after no empty line as space in-between
Code: module_scripts.py
	   #Bajo script
  (eq, ":event_type", multiplayer_event_fixBayonet),
(store_script_param,":eventNo",3),
(store_script_param,":var2",4),
(try_begin),
(eq,":eventNo",1), #Event 1 - Fix Bayonet
(assign,":itemFound",0),
(assign,":playerAgent",":var2"),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_slot,":bayonetCooldown",":playerAgent",slot_agent_bayonetCooldown),
(eq,":bayonetCooldown",0),
(agent_get_wielded_item,":curRifle",":playerAgent"),
(item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),
(neq,":bayonetItem",0),
(try_for_range,":curSlot",0,3),
(neq,":itemFound",1),
(agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
(eq,":curItem",":curRifle"),
(assign,":itemFound",1), #break loop
(assign,":itemSlot",":curSlot"),
(try_end),
(eq,":itemFound",1), #the item was found and no witchcraft occurred
(agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
(agent_get_ammo_for_slot,":rifleAmmo",":playerAgent",":itemSlot"),
(agent_get_slot,":isFixed",":playerAgent",slot_item_isFixed),
(try_begin),
(eq,":isFixed",0),
(agent_set_animation,":playerAgent","anim_fix_bayonet"),
(else_try),
(agent_set_animation,":playerAgent","anim_unfix_bayonet"),
(try_end),
(agent_unequip_item,":playerAgent",":curRifle"),
(agent_equip_item,":playerAgent",":bayonetItem"),
(agent_set_wielded_item,":playerAgent",":bayonetItem"),
(try_begin),
(eq,":rifleAmmo",0),
(agent_set_ammo,":playerAgent",":bayonetItem",0),
(try_end),
    (agent_is_active, ":playerAgent"),
                (agent_is_alive, ":playerAgent"),
(agent_set_slot,":playerAgent",slot_agent_bayonetCooldown,6), #unable to spam bayonet on/off
(try_end), #Bajo script
The script stops at else_try right under Client Events no empty line as space in-between
Quote
      (else_try),         
        ###############
        #CLIENT EVENTS#
        ###############
        (neg|multiplayer_is_dedicated_server),

module_items.py
5th and now it is time to add item codes as fix bayonet makes the firearm unique from it's regular counterpart.
The following code is first the item code I put the new codes right under as a test for War of 1812 mod.
Quote
#Muskets
# French
["french_charleville", "Infantry Musket", [("french_charleville",0)], itp_cant_use_on_horseback|itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_cant_reload_while_moving|itp_next_item_as_melee ,itcf_shoot_musket|itcf_carry_crossbow_back,
683 , weight(3.5)|difficulty(0)|spd_rtng(23) | shoot_speed(250) | thrust_damage(100 ,pierce)|max_ammo(1)|accuracy(75),imodbits_none,[]],
# [(ti_on_weapon_attack, [(store_trigger_param_1,":user_agent"),(call_script, "script_server_fire_musket", ":user_agent", firearm_type_musket),])]],
["french_charleville_melee", "Infantry Musket", [("french_charleville",0)], itp_cant_use_on_horseback|itp_has_upper_stab|itp_type_polearm |itp_primary|itp_is_pike|itp_no_blur,itc_spear|itcf_carry_crossbow_back,
180 , weight(0)|difficulty(0)|spd_rtng(85) | weapon_length(138)|swing_damage(40 ,  pierce) | thrust_damage(45 ,  pierce),imodbits_none ],

Code: module_items.py
# Bayonet fix test
["french_charlevillenobayonet", "Infantry Musket", [("french_charleville2",0)], itp_cant_use_on_horseback|itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_cant_reload_while_moving|itp_next_item_as_melee ,itcf_shoot_musket|itcf_carry_crossbow_back,
683 , weight(3.5)|difficulty(0)|spd_rtng(23) | shoot_speed(250) | thrust_damage(100 ,pierce)|max_ammo(1)|accuracy(78),imodbits_none,[]],
# [(ti_on_weapon_attack, [(store_trigger_param_1,":user_agent"),(call_script, "script_server_fire_musket", ":user_agent", firearm_type_musket),])]],
["french_charlevillenobayonet_melee", "Infantry Musket", [("french_charleville2",0)], itp_has_upper_stab|itp_type_polearm |itp_primary|itp_no_blur|itp_offset_musket|itp_can_knock_down,itc_musket_melee|itcf_carry_crossbow_back,
180 , weight(0)|difficulty(0)|spd_rtng(85) | weapon_length(85)|swing_damage(23 , blunt) | thrust_damage(22 ,  blunt),imodbits_none ],
["french_charlevilleb", "Infantry Musket with Bayonet", [("french_charleville",0)], itp_cant_use_on_horseback|itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_cant_reload_while_moving|itp_next_item_as_melee ,itcf_shoot_musket|itcf_carry_crossbow_back,
683 , weight(3.5)|difficulty(0)|spd_rtng(23) | shoot_speed(250) | thrust_damage(100 ,pierce)|max_ammo(1)|accuracy(75),imodbits_none,[]],
["french_charlevilleb_melee", "Infantry Musket with Bayonet", [("french_charleville",0)], itp_cant_use_on_horseback|itp_has_upper_stab|itp_type_polearm |itp_primary|itp_is_pike|itp_no_blur,itc_spear|itcf_carry_crossbow_back,
180 , weight(0)|difficulty(0)|spd_rtng(85) | weapon_length(138)|swing_damage(40 ,  pierce) | thrust_damage(45 ,  pierce),imodbits_none ],


Same method for the Brown Bess
Quote
# British
["british_brown_bess", "Infantry Musket", [("brown_bess_musket",0)], itp_cant_use_on_horseback|itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_cant_reload_while_moving|itp_next_item_as_melee ,itcf_shoot_musket|itcf_carry_crossbow_back,
683 , weight(3.5)|difficulty(0)|spd_rtng(23) | shoot_speed(250) | thrust_damage(100 ,pierce)|max_ammo(1)|accuracy(75),imodbits_none,[]],
["british_brown_bess_melee", "Infantry Musket", [("brown_bess_musket",0)], itp_cant_use_on_horseback|itp_has_upper_stab|itp_type_polearm |itp_primary|itp_is_pike|itp_no_blur,itc_spear|itcf_carry_crossbow_back,
180 , weight(0)|difficulty(0)|spd_rtng(85) | weapon_length(136)|swing_damage(40 ,  pierce) | thrust_damage(45 ,  pierce),imodbits_none ],

Code
# Bayonet fix test
["british_brown_bessnobayonet", "Infantry Musket", [("brown_bess_musket2",0)], itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_cant_reload_while_moving|itp_next_item_as_melee ,itcf_shoot_musket|itcf_carry_crossbow_back,
683 , weight(3.5)|difficulty(0)|spd_rtng(23) | shoot_speed(250) | thrust_damage(100 ,pierce)|max_ammo(1)|accuracy(78),imodbits_none,[]],
# [(ti_on_weapon_attack, [(store_trigger_param_1,":user_agent"),(call_script, "script_server_fire_musket", ":user_agent", firearm_type_rifle)])]],
["british_brown_bessnobayonet_melee", "Infantry Musket", [("brown_bess_musket2",0)], itp_has_upper_stab|itp_type_polearm |itp_primary|itp_no_blur|itp_offset_musket|itp_can_knock_down,itc_musket_melee|itcf_carry_crossbow_back,
180 , weight(0)|difficulty(0)|spd_rtng(85) | weapon_length(85)|swing_damage(23 , blunt) | thrust_damage(22 ,  blunt),imodbits_none ],
["british_brown_bessb", "Infantry Musket with Bayonet", [("brown_bess_musket",0)], itp_cant_use_on_horseback|itp_type_crossbow |itp_merchandise|itp_primary|itp_two_handed|itp_cant_reload_on_horseback|itp_cant_reload_while_moving|itp_next_item_as_melee ,itcf_shoot_musket|itcf_carry_crossbow_back,
683 , weight(3.5)|difficulty(0)|spd_rtng(23) | shoot_speed(250) | thrust_damage(100 ,pierce)|max_ammo(1)|accuracy(75),imodbits_none,[]],
["british_brown_bessb_melee", "Infantry Musket with Bayonet", [("brown_bess_musket",0)], itp_cant_use_on_horseback|itp_has_upper_stab|itp_type_polearm |itp_primary|itp_is_pike|itp_no_blur,itc_spear|itcf_carry_crossbow_back,
180 , weight(0)|difficulty(0)|spd_rtng(85) | weapon_length(136)|swing_damage(40 ,  pierce) | thrust_damage(45 ,  pierce),imodbits_none ],

module_animations.py
6th if you have an animation here is the code:
Replace these unused animation lines as they will be used now
Quote

 ["unused_human_anim_62", 0, 0, [1.0, "anim_human", 0, 1, 0]],
 ["unused_human_anim_63", 0, 0, [1.0, "anim_human", 0, 1, 0]],
 ["unused_human_anim_64", 0, 0, [1.0, "anim_human", 0, 1, 0]],
 ["unused_human_anim_65", 0, 0, [1.0, "anim_human", 0, 1, 0]],
Replace unused_human_anim_62-65 with the following below.
Code: module_animations.py

 ["fix_bayonet", acf_enforce_all, amf_priority_reload|amf_play, [2, "fix_bayonet", 0, 119, arf_blend_in_8]],
 ["fix_bayonet_end", 0, amf_priority_mount|amf_play, [0.1, "fix_bayonet", 50, 119, arf_blend_in_1]],
 ["unfix_bayonet", acf_enforce_all, amf_priority_reload|amf_play, [2, "unfix_bayonet", 0, 119, arf_blend_in_8]],
 ["unfix_bayonet_end", 0, amf_priority_mount|amf_play, [0.1, "unfix_bayonet", 50, 119, arf_blend_in_1]],
Oddly enough the module_animations.py file already has the fix and unfix bayonet animation lines done for you
Quote
["equip_bayonet", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
  [0.3, "equip_musket", 5, 13, arf_blend_in_0],
 ##   [0.8, "equip_arms", 253, 276, arf_blend_in_0]
 ],
 ["unequip_bayonet", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
  [0.3, "equip_musket", 5, 13, arf_blend_in_0],
 ##   [0.2, "equip_arms", 254, 250, arf_blend_in_0]

Finally the OSP animation for fix and unfix bayonet, located in modified vanilla mmanimations BRF file for your convenience.
Download this:
https://drive.google.com/file/d/0B_XEt5J8_HVnN3lDVEhtYWFpNk0/edit?usp=sharing
And replace your mmanimations.brf with it and enjoy the fix/unfix bayonet OSP code & animation.

Let me know how this guide works for you, if you need any help feel free to post your issues. Feedback is appreciated!
The things I do when I can't sleep, ha.

Credits of the animation goes to caseofinsanity

Quote from: caseofinsanity
Credits:
•The musket models without bayonet are modified versions of the original fixed muskets.


•The fixing&unfixing animations were made by me, CaseOfInsanity and it's free to use. If your mod ends up using the animations, it would be nice of you to mention my name  :)
« Last Edit: August 17, 2014, 12:06:42 am by usnavy30 »
How To Run A Mod Installer.exe
Quote
Hello.. I have a problem... It says I don't have Mount&Blade Warband: Napoleonic War and I have to buy it
Try joining a regular Napoleonic Wars server and then re-running the installer.

Offline Crescent Glow

  • Major General
  • **
  • Posts: 4352
    • View Profile
  • Side: Neutral
Re: Navy's Modding Tutorial & Archive
« Reply #2 on: July 30, 2014, 04:50:36 pm »
Nice guide

Offline Malkolm R. Lind

  • Major
  • *
  • Posts: 1591
  • Why do drugs when you can listen to music?
    • View Profile
  • Nick: Illya
  • Side: Neutral
Re: Navy's Modding Tutorial & Archive
« Reply #3 on: August 03, 2014, 10:15:51 am »
Nice guide
Yup, really nice guide. 1+ rep

Offline DanyEle

  • FSE Associate
  • ***
  • Posts: 517
  • Sssh! I'm coding, don't disturb :D
    • View Profile
  • Nick: DanyEle
  • Side: Confederacy
Re: Navy's Modding Tutorial & Archive
« Reply #4 on: August 04, 2014, 10:24:10 am »
Good, good!