Jump to content
Sign in to follow this  
buliwyf

Ammunition for tank commander

Recommended Posts

Hi guys..

..does anyone knows how to set the ammunition of a commander gun like a M1Abrams has to full state. If i shoot out all the ammo and reload at an AmmoTruck, the commander will get only one magazine, but normally he has two magazines.

Is it possible to manage this with a script?

Share this post


Link to post
Share on other sites

Short answer: Yes

Longer answer:

To do it the simple way, give the commander an action which gives the tank an extra m2 magazine if there's only 1 when the tank is near an ammo truck.

You could also try doing it with a looping script or trigger somehow.

Share this post


Link to post
Share on other sites

Adding an extra M2 magazine to the vehicle is not the solution... or do i misunderstood?! huh.gif

Share this post


Link to post
Share on other sites

Start of mission - 2 mags in tank.

After firefight - a half mag in tank.

After rearm - 1 mag in tank.

After added mag through script - 2 mags in tank.

Share this post


Link to post
Share on other sites

Is it possible that you are speaking of singleplayer modus? I tested it only in multiplayer. And there it doesn`t work:

Example:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nameOfmyTank addMagazine "100Rnd_127x99_M2"

confused_o.gif

Share this post


Link to post
Share on other sites

According to the wiki the effects of the command is global, so it shouldn't be a problem.

Does it still not work with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nameOfmyTank setVehicleInit '

  nameOfmyTank addMagazine "100Rnd_127x99_M2";

';

processInitCommands;

Share this post


Link to post
Share on other sites

I build maps since OFP were released and also in ArmA. I guess i`m able to set correct namings or use corect scripting commands. You can be sure that i know what i do... wink_o.gif

But there MUST be a trick to add magazines to the commander turret... did you ever tried to reload it with scripting commands? I guess you should try it... xmas_o.gif

Share this post


Link to post
Share on other sites

No offense, just wanted to make sure of that before trying something obscure wink_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_u = _this select 0;

player groupChat format ["Type: %1", typeOf _u];

player groupChat format ["Weapons: %1", weapons _u];

player groupchat format ["M2 - true of false: %1", (_u hasWeapon "M2")];

_u removeMagazines "M2";

_u removeWeapon "M2";

{_u addmagazine "100Rnd_127x99_M2";} foreach [1,1];

_u addWeapon "M2";

The M2 is not listed in the weapons array, and hasweapon returns false...

Neither remove magazines or weapon seems to have any effect. I checked the config to make sure it used the weapon at all:

Quote[/b] ]class Turrets: Turrets {

class CommanderOptics: CommanderOptics {

gunBeg = "gun_muzzle";

gunEnd = "gun_chamber";

minElev = -25;

maxElev = 60;

initElev = 0;

minTurn = -360;

maxTurn = 360;

initTurn = 0;

weapons = {"M2"};

magazines = {"100Rnd_127x99_M2", "100Rnd_127x99_M2"};

outGunnerMayFire = 1;

inGunnerMayFire = 1;

gunnerAction = "Abrams_CommanderOut";

gunnerInAction = "Abrams_Commander";

gunnerOpticsModel = "\ca\Tracked\optika_M1A1_commander";

};

};

So... Maybe you'd have to refer to the turret when using addmagazine or something like that.

Edit: Added a magazines _u check; the magazines are added to the tank, but isn't used by the commander- looks like I just made the gunner receive the M2 weapon and magazines rofl.gif

Share this post


Link to post
Share on other sites

Has anyone figured this out yet?

Is there a way to select which turret you want the ammunition to go to?

I can't seem to find any script command that would allow this. This seems to explain why the "bug" that you cannot fully reload the secondary turrets is still here after 5 patches.

Any other workarounds for this besides deleting the vehicle and placing a new one?

Edit:

Where might I find the BIS script that does the rearming from an ammo truck? Since that script seems to rearm all turrets in a vehicle (albeit buggy in an MP environment), there might be a command or technique that we could use from there.

Share this post


Link to post
Share on other sites

That would be setVehicleAmmo, I think - but it won't give all the magazines a vehicle started with.

For now, the only way is to create a new tank, I suppose.

Share this post


Link to post
Share on other sites

That makes sense now.

Hmmm, well looks like I will have to rewrite a bunch of scripts then ...

It's a shame that deleting vehicles is the only way to rearm them, maybe something will done in the next patches to either fix the setVehicleAmmo command or add/modify existing commands to be able to access the individual turrets.

I guess I will go read the behemoth that is the ArmA Wishlist smile_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×