Home   Help Search Login Register  

Author Topic: [SOLVED] Adding magazine to ZU-23  (Read 1438 times)

0 Members and 1 Guest are viewing this topic.

Offline Ext3rmin4tor

  • Members
  • *
[SOLVED] Adding magazine to ZU-23
« on: 27 Jan 2010, 18:54:33 »
I'm using a script to make a ZU-23 battery to fire continuously to the sky. The script code is the following
Code: [Select]
_battery = _this select 0;
_angle = _this select 1;
_distance = _this select 2;

_yt = _distance * cos(_angle);
_xt = _yt * tan(getDir _battery);
_zt = _distance * sin(_angle);
_target = _battery modelToWorld [_xt, _yt, _zt];

while {(alive _battery) and (count crew _battery > 0)} do
{
_battery addMagazine "1000Rnd_23mm_2A14_AP";
_battery selectWeapon "2A14";
_battery doWatch _target;
_battery fire "2A14";
sleep (random 1.5);
};

what I want to do is to reload the weapon continuously so it never runs out of ammo. The first line of the script "while-loop" doesn't seem to work though, do you have any hints on how I can restore the weapon ammo?
« Last Edit: 28 Jan 2010, 18:18:36 by Ext3rmin4tor »
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: Adding magazine to ZU-23
« Reply #1 on: 27 Jan 2010, 19:03:13 »
may be use the "sommeammo unitname" (returns true or false) condition to check if the unit is out of ammo?

Offline Ext3rmin4tor

  • Members
  • *
Re: Adding magazine to ZU-23
« Reply #2 on: 28 Jan 2010, 12:01:57 »
It seems that the ammo classname is wrong, since the removeMagazines command doesn't work either. Does anybody know how to check if the classname is correct (I used both the tables here and the one in the BIS wiki).

SOLVED: The classname listed in both the COMREF weapons table and in the BIS wiki is wrong. The correct magazine classname for the ZU-23 is "40Rnd_23mm_AZP85". Someone might want to warn an admin of this so they can correct the table and eventually tell the Biki admins to correct the table there as well.
« Last Edit: 28 Jan 2010, 12:19:58 by Ext3rmin4tor »
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Adding magazine to ZU-23
« Reply #3 on: 28 Jan 2010, 16:13:48 »
I think the magazine and ammo classnames must have undergone a revision in one of the patches since the weapons lists were first made.

Lists now edited to reflect the changes.


Planck
I know a little about a lot, and a lot about a little.