Today I’m going to share a neat script hack which turns Mk6 mortar into a single man operation weapon and adds some sensible 3rd person view to it. By hack I mean that it could be done in a mission and you do not need to make a mod to change mortar behaviour. My goal was to make Mk6 mortar practical and simple to use. Whether I have achieved it or not, judge for yourself. Features:
- A simple function call will add mortar bag to a player (will remove existing bag).
- Action for mortar assembly is added to action menu and also gets bound to User1 action. So if you go to controls and define User1 shortcut key you can set up mortar without scrolling mouse wheel. I set User1 as left Ctrl+Shift for myself.
- Language of custom added action is localised.
- You can exit mortar as you exit a vehicle (with “V”) and player will pack the mortar automatically.
- You can drop mortar bag then pick it up later it will still work (the bag has to be added first with function call).
- The 3rd person view allows to use freelook, but not too good for aiming.
- If you get killed while on the mortar, it will get destroyed as well.
- You won’t be able to set it up while in vehicle.
- Artillery computer noob option is removed. If you need to know how to aim Mk6 like a man check this post.
- Finally, the type of the mortar bag added will correspond to player’s faction (currently only works with BLUFOR, since BETA is missing mortar bags for the other 2 classes. For the same reason it will not work with civilians).
I have designed it to work with my mission while still trying to keep it universal. If you use my script for your mission, please give the credit where it is due. To define the function:
To call the function:
Enjoy,
KK
EDIT1: Added handling for when player cannot enter mortar.
EDIT2: Added handling for when player is too far from the mortar.
EDIT3: Added handling for when created mortar is immediately destroyed.
EDIT4: Added handling for when there is an object between the player and the mortar.
EDIT5: Removed action id variable, no need as it passed back to script in param array.
EDIT6: Changed action script from string to code since it is also supported.
EDIT7: Great news! Dev branch finally had missing mortar bags added so you can now use it with opfor and independent units too.
EDIT8: For some reason BIS decided to create Mortar further away from the player and it broke my script. So I’ve changed the distance from 2.5 to 3.5 metres and updated the script.
EDIT9: New DEV branch update fixed 3rd person view, so some redundant code is removed.