OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Ext3rmin4tor on 27 Jan 2010, 18:54:33

Title: [SOLVED] Adding magazine to ZU-23
Post by: Ext3rmin4tor 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?
Title: Re: Adding magazine to ZU-23
Post by: fleepee 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?
Title: Re: Adding magazine to ZU-23
Post by: Ext3rmin4tor 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.
Title: Re: Adding magazine to ZU-23
Post by: Planck 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