[HELP] Script changing from ranged to melee function

正在查看此主题的用户

DeepRedCee

Recruit
Hey there,

How would I script a weapon to change from its ranged function (i.e. a musket) into a melee function (i.e. bayonet/stock). This functionality exists in Fire and Sword by pressing 'x' but can't find a module system for WFaS so can't look at the code and as far as I'm aware the functionality isn't in warband. I know it exists in Mount and Musket though so it's possible.

Thanks loads!  :mrgreen:
 
Just take a look at existing weapons.

插入代码块:
["javelin",         "Javelins", [("javelin",0),("javelins_quiver_new", ixmesh_carry)], itp_type_thrown |itp_merchandise|itp_primary|itp_next_item_as_melee ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 
300, weight(5)|difficulty(1)|spd_rtng(91) | shoot_speed(25) | thrust_damage(34 ,  pierce)|max_ammo(5)|weapon_length(75),imodbits_thrown ],
["javelin_melee",         "Javelin", [("javelin",0)], itp_type_polearm|itp_primary|itp_wooden_parry , itc_staff, 
300, weight(1)|difficulty(0)|spd_rtng(95) |swing_damage(12, cut)| thrust_damage(14,  pierce)|weapon_length(75),imodbits_polearm ],

The thing you're looking for is itp_next_item_as_melee, which does exactly as it says.
 
Thanks loads!

Just one problem though, the weapon isn't actually showing up in my hands when i switch from ranged to melee however the functionality works fine. :smile:
 
后退
顶部 底部