|
马上注册领取绝版勋章
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
作者: Pierre MGI
标签:无授权
描述
在Arma vanilla中,坦克在与MG一起射击,有时还有大炮射击。但是,默认情况下,大炮仍然装有穿甲弹,单位效果不佳。
这个脚本允许用精确的HE壳(如果可能的话)重新加载大炮以射击单位。发射MG或加农炮的发动机行为没有变化,除了将这种发射与AT AA步兵单位混合的额外优先权。
MP兼容。在服务器上运行。
产卵池没有考虑在内,但很容易做到。请参阅本节中的一般主题(WIP)。
Code
in a sqf or a trigger.
- {
- _x spawn {
- _tk = _this;
- _even = 0;
- _magAP = "";
- _magAT = "";
- while {true} do {
- _even = (_even + 1) mod 2;
- _magtrt = _tk magazinesTurret [0];
- _ammoTrt = _magTrt apply {getText (configfile >> "CfgMagazines" >> _x >> "ammo")};
- _usage = _ammoTrt apply {getText (configfile >> "CfgAmmo" >> _x >> "aiAmmoUsageFlags") splitString " + "};
- _wpnTrt = _tk weaponsTurret [0];
- _cannon = (_wpnTrt select {getText (configfile >> "CfgWeapons" >> _x >> "nameSound") == "cannon"}) select 0;
- _MG = (_wpnTrt select {getText (configfile >> "CfgWeapons" >> _x >> "nameSound") == "mgun"}) select 0;
-
- if (!((_tk nearTargets 1500 select {side (_x select 4) getFriend side _tk < 0.6}) isEqualTo [])) then {
- _tgt = (_tk nearTargets 1500 select {side (_x select 4) getFriend side _tk < 0.6}) select 0 select 4;
-
- if (_tk currentWeaponTurret [0] == _cannon) then {
-
- for "_i" from 0 to count _usage - 1 do {
- call {
- if ("64" in (_usage select _i) && (_tk magazineTurretAmmo [_magTrt select _i, [0]]) >0
- && (_magTrt select _i) in (getarray (configfile >> "CfgWeapons" >> _cannon >> "magazines")))
- exitWith {_magAP = _magTrt select _i};
- if ("512" in (_usage select _i) && (_tk magazineTurretAmmo [_magTrt select _i, [0]]) >0
- && (_magTrt select _i) in (getarray (configfile >> "CfgWeapons" >> _cannon >> "magazines")))
- exitWith {_magAT = _magTrt select _i};
- };
- };
- call {
- if (isnil "_tgt") exitWith {};
- if (_tgt isKindOf "man" && _magAP != "") exitWith {_tk loadMagazine [[0],_cannon,_magAP]};
- if (_tgt isKindOf "man" && {_magAP == "" && _magAT != ""}) exitWith {_tk loadMagazine [[0],_cannon,_magAT]};
- if (!(_tgt isKindOf "man") && _magAT != "") exitWith {_tk loadMagazine [[0],_cannon,_magAT]};
- };
- };
-
- if (!isnil "_tgt") then {
- if (_tk currentWeaponTurret [0] == _MG && secondaryWeapon _tgt != "" && _even == 0) then {
- _tk selectWeaponTurret [_cannon, [0]];
- if (_magAP != "") exitWith {_tk loadMagazine [[0],_cannon,_magAP]};
- };
- };
-
- };
- uisleep 0.2;
- }
- }
- } forEach (vehicles select {_x isKindOf "tank"})
复制代码 语法
可以修改范围。如果你不需要修改所有坦克,而不是(vehicles select {_x isKindOf "tank"}) (all tanks at mission start),只考虑一系列坦克:
[tank1,tank2 ......]
或 (vehicles select {_x isKindOf "tank" && side _x == west}) for BLUFOR tanks,
或 (vehicles select {_x isKindOf "tank" && group _x == group player}) (SP) ...
参数
无
使用
TRIGGER / WAYPOINT - On Act
或init.sqf(SP)initServer.sqf(MP)
|
|