Modifying vehicle weapons for fun and profit

Workshop for all Mission Engineer Comrades. Home of the FA Mission Making Template.
Post Reply
darkChozo
Host
Posts: 207
Joined: Fri Aug 14, 2015 12:48 pm

Modifying vehicle weapons for fun and profit

Post by darkChozo »

So, I've been playing around with an interesting family of scripting commands, namely addWeaponTurret and its relatives. These commands let you modify vehicle loadouts by adding and removing weapons and magazines from "turrets". A turret seems to be any non-cargo position on a vehicle, though not all turrets are properly set up to fire weapons. This means you can add any weapon to any driver or gunner position, along with a few other oddities (the loadmaster position on the Taru is a turret, for example).

In my experimentation, this works shockingly well. Basically, if a position can fire a weapon, it can fire any vehicle weapon, up to including tank and artillery cannons. Even if it can't normally, you can still add weapons and sometimes it'll even work. If it doesn't, typically that's because the shot you fire spawns inside your vehicle and you instantly blow up and/or die.

So first step to doing this is figuring out the turret path to the turret. This is an array, [-1] always refers to driver, [0] typically refers to the main gunner, and I don't know what happens beyond that ([0,0] is a thing occasionally). You can get the turret path for a position by sitting in that position and pasting

Code: Select all

hint format ["%1", assignedVehicleRole player]
into your debug console. This gives you something like ["Turret",[0]]. [0] is the turret path in this case. If Turret is Driver, you're in the driver position which is always accessed with [-1]. If Turret is Cargo, you're in a cargo position, not a turret.

After that, it's actually pretty simple. Your main tools are addWeaponTurret, removeWeaponTurret, addMagazineTurret, and removeMagazineTurret. These all work pretty much the same, you give a weapon/magazine classname and a turret path and it adds/removes that thing from the turret. You can use weaponsTurret to see what weapons already exist on a turret. Classnames can be found at https://community.bistudio.com/wiki/Arm ... le_Weapons.

As an example, pasting this in the init field of a HMG Hunter will replace the .50 cal with a 105mm cannon with 40 rounds of APFSDS ammo:

Code: Select all

{this removeWeaponTurret [_x,[0]];} forEach (this weaponsTurret [0]);
{this removeMagazinesTurret [_x,[0]];} forEach (this magazinesTurret [0]);
this addWeaponTurret ["cannon_105mm",[0]];
this addMagazineTurret ["40Rnd_105mm_APFSDS", [0]];
A couple notes. First off, this won't change the model at all. You'll get a .50 cal that magically fires tank shells or a tank cannon that fires rockets. Likewise, animations are tied to the weapon, so you might get shell casing magically appearing out of an invisible minigun. Finally, sights are attached to the vehicle, not the weapon, so a technical with a cannon won't get tank sights, and anything with artillery won't have a computer.

Examples of stuff that works:
  • An AT technical with a tank cannon. The recoil is enough to flip a normal technical so increasing mass is recommended. setMass 5000 leaves a good kick without destroying the technical.
  • A static minigun (HMG firing heli minigun). This will even work if you disassemble and reassemble it.
  • A static AT gun (HMG firing tank cannon). Again, you'll need to setMass to handle the recoil. Disassembling the static will undo the setMass so you'll have to disable disassembly or reapply the setMass.
  • A Panther with a 20mm gattling cannon.
  • A remote designator that acts as a remote 50cal turret.
  • A Hunter with a flare mortar.
  • A Ghosthawk with gattling cannons for door guns.
  • An AH-9 that fires 230mm artillery rockets.
  • A Darter UAV that drops bombs.
  • A quadbike with a forward-mounted LMG.
  • A hatchback with a forward-mounted tank cannon.
  • A mortar that fires Skyfire rockets. The artillery computer seems like it works but I'm not very convinced that it actually does.
  • A Taru whose loadmaster has a backwards head and can fire a gattling cannon somehow.
I've got some scripts that make this a lot more convenient, I'll probably post them at some point.

EDIT: whoops, in retrospect I guess this is basically a guide. Oh well.

DOUBLE EDIT: also, if anyone wants to see the above there's a mission on the test server I used to make sure they don't break in multiplayer. Look for weird_vehicle_test, at least until the test server gods decide it's time for a wipe.

Pooter
Host
Posts: 117
Joined: Tue Jul 28, 2015 2:26 am

Re: Modifying vehicle weapons for fun and profit

Post by Pooter »

I would love it if arma had a static HMG that wasn't the super sighted one (like the one off a technical).
I suppose you could just take the technical and make it not move, but this adds another option. Making the static HMG shoot LMG rounds. The mount and sight make it dangerous at range, but at least it's not ultra powerful at any range.

darkChozo
Host
Posts: 207
Joined: Fri Aug 14, 2015 12:48 pm

Re: Modifying vehicle weapons for fun and profit

Post by darkChozo »

A similar thing you can do is replace vehicle homing missiles with rockets, so they still retain some armor effectiveness without being annoying about it. That's actually why I started looking into this; I wanted to put an Orca in an armor mission but it's not very fun to get sniped by DAGRs from a kilometer away.

User avatar
Eagle_Eye
Posts: 209
Joined: Wed Feb 11, 2015 2:35 am
Location: Cork, Ireland

Re: Modifying vehicle weapons for fun and profit

Post by Eagle_Eye »

darkChozo wrote:A similar thing you can do is replace vehicle homing missiles with rockets, so they still retain some armor effectiveness without being annoying about it. That's actually why I started looking into this; I wanted to put an Orca in an armor mission but it's not very fun to get sniped by DAGRs from a kilometer away.
Heads up about ORCAs.

Black and White orcas have the unguided missiles. Normal orcas have DAGRS

Post Reply