Help me to get bayonet working

Users who are viewing this thread

MarcosPZero

Regular
So I'am new at modding M&B WB and I'am trying to make this musket to be also a polearm (like in many other musket mods). I've download the Flintlock Firearms OSP from Llew2 and put it in the game like this (as was said in other posts here) :

Code:
["flintlock_rifle", "Flintlock Rifle",[("flintlock_rifle_1",0)],itp_type_musket|itp_merchandise|itp_cant_reload_on_horseback|itp_primary|itp_next_item_as_melee|itp_two_handed, itcf_reload_musket|itcf_carry_spear|itcf_shoot_musket, 230 , weight(1.5)|abundance(90)|difficulty(0)|spd_rtng(38) | shoot_speed(160) | thrust_damage(160 ,pierce)|max_ammo(1)|accuracy(99),imodbits_none,[(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,0),(position_move_y, pos1,139),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]],
["flintlock_rifle_melee", "Flintlock Rifle Melee", [("flintlock_rifle_1",0)], itp_type_polearm|itp_primary|itp_penalty_with_shield|itp_wooden_parry , itc_staff, 0, weight(1.5)|difficulty(0)|spd_rtng(91) |swing_damage(12, blunt)| thrust_damage(14,  blunt)|weapon_length(75),imodbits_polearm ],

As you can see, I've put the rifle and next I put the Rifle Melee. But in game it just make me have two items a Rifle normal and a Rifle polearm, and when I press "X" with the rifle I've get it to switch to a invisible polearm. Evidentily its not what I want. I have also tried to do the "Alternate Weapon Modes" but I guess I'am just too noob to make it work. So... is anyone willing to help me in this matter ?
 
Solution
I've managed to make it work. I downloaded TOTSK (Twilight of the Sun King) mod source and look into it to see how it worked and here how I've put to make it work:

Code:
["flintlock_rifle", "Musket", [("flintlock_rifle",0)], itp_type_musket|itp_merchandise|itp_primary|itp_bonus_against_shield|itp_next_item_as_melee, itc_parry_polearm|itcf_shoot_musket, 300, weight(9.25)|abundance(100)|difficulty(0)|spd_rtng(32)|shoot_speed(140)|thrust_damage(45,pierce)|max_ammo(1)|accuracy(62), imodbits_none...
First thank you. Yes I change it, but I still get two items: a normal rifle and a polearm type rifle. when I use the normal rifle and press "X" to switch weapon mode to polearm(bayonet) the only thing I got its a invisible polearm.

Check it out:

Welcome at modding Warband :smile:

I think you need to have the same imodbits at both entries, so either both imodbits_polearm or imodbits_none
 
Upvote 0
Give the items also the same name, different ID but the same names. Otherwise I don't see something strange which could cause this. In the video you press x and it puts the weapon on your back and an invisible stick in your hand, yes?

Yes, that what is happening. So I did what you said I put the same names and kept diferent ID, but still happens the same thing. I press "X" and an invisible stick appears in my hand instead of the polearm rifle mode.
 
Upvote 0
I am not sure if it works out, just a thought which came into my mind. Try at the melee version itp_secondary instead of itp_primary. Also try it with another carry animation, so replace the itcf_carry_spear with another carry animation. I suspect that every carry animation which switches the weapon to the back might cause it.
 
Last edited:
Upvote 0
I've managed to make it work. I downloaded TOTSK (Twilight of the Sun King) mod source and look into it to see how it worked and here how I've put to make it work:

Code:
["flintlock_rifle", "Musket", [("flintlock_rifle",0)], itp_type_musket|itp_merchandise|itp_primary|itp_bonus_against_shield|itp_next_item_as_melee, itc_parry_polearm|itcf_shoot_musket, 300, weight(9.25)|abundance(100)|difficulty(0)|spd_rtng(32)|shoot_speed(140)|thrust_damage(45,pierce)|max_ammo(1)|accuracy(62), imodbits_none, [(ti_on_weapon_attack,[(play_sound,"snd_pistol_shot"),(position_move_x,pos1,-18),(position_move_y,pos1,15),(particle_system_burst,"psys_pan_smoke",pos1,15),(position_move_y,pos1,95),(particle_system_burst,"psys_musket_smoke",pos1,10),(particle_system_burst,"psys_firearm_flash",pos1,15)])] ],
["flintlock_rifle_melee", "Musket Melee", [("flintlock_rifle",0)], itp_type_polearm|itp_wooden_parry|itp_two_handed|itp_secondary|itp_unbalanced, itc_parry_polearm|itc_poleaxe, 202, weight(9.25)|difficulty(0)|spd_rtng(88)|weapon_length(121)|swing_damage(22,blunt)|thrust_damage(14,blunt), imodbits_none ],

So this matter its solved now.

Thank you Eärendil Ardamírë for your support and attention.
 
Upvote 0
Solution
Back
Top Bottom