Actually I made a addon to let soldier can load bayonet like loading mortar for rifle, and I already scripted the both cfgAmmo and cfgWeapons. I scripted it use like stroke gun not firing bullets from muzzle for I don't know how to creat my own animation for fighting with bayonet. It works fine when I loaded the bayonet and killing some enermies. But no matter how close to the enermies, the AI soldier will not engage when they loaded the bayonet. So, I keep trying till now.
Any one are intresting in developing the same thing like that? or good any idea could share with us?
Operation Flashpoint Taiwan Workshop.
Create a custom recoil class and define the bayonet as another muzzle of your gun -as a rifle without spotable ammo/flash. If you pull the trigger of your bayonet-weapon, the recoil simulates the movement. Advantage: it's like any other weapon, so the ai should use it. Problem: how to limit the damage range of the imaginary bullet?
I will try to set the ai fire distance and hit range.