Fandom

武装突袭 Wiki

WeaponsTurret

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 Share

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

  Arguments of this scripting command don't have to be local to the client the command is executed on

点击图片可看到更多讯息

开始使用于

游戏:
Arma 2: Operation Arrowhead
版本:
1.52

描述

描述:
Returns all weapons of given turret. Use turret path [-1] for driver's turret.

基本句法

句法:
vehicle weaponsTurret turretPath
参数:
vehicle: Object

turretPath: Array
返回值:
Array of Strings

范例

范例1:
_weapons = vehicle player weaponsTurret [0,0]

范例2:
_weapons = _tank weaponsTurret [0]

范例3:
_driverWeapon = _ka50pilot weaponsTurret [-1]

范例4:
_weaponsForAnyTurrentPosition = (vehicle player) weaponsTurret ((assignedVehicleRole player) select 1)

额外资讯

多人游戏:
-
也可以看看:

addMagazineTurretmagazinesTurretremoveMagazinesTurretremoveMagazineTurretweaponsassignedVehicleRoleaddWeaponTurretremoveWeaponTurretturretLocal

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Posted on 11 March 2011
kju
Use assignedVehicleRole in combination to easily determine the weapons for any vehicle position. You need to check for -1 if the unit is in the driver/pilot position. See example 3 and 4.

Posted on 11 March 2011

Returns information (including the turrets paths) about all weapons on turrets

 funcGetTurretsWeapons = {
     private ["_result", "_getAnyMagazines", "_findRecurse", "_class"];
     _result = [];
     _getAnyMagazines = {
         private ["_weapon", "_mags"];
         _weapon = configFile >> "CfgWeapons" >> _this;
         _mags = [];
         {
             _mags = _mags + getArray (
                 (if (_x == "this") then { _weapon } else { _weapon >> _x }) >> "magazines"
             )
         } foreach getArray (_weapon >> "muzzles");
         _mags
     };
     _findRecurse = {
         private ["_root", "_class", "_path", "_currentPath"];
         _root = (_this select 0);
         _path = +(_this select 1);
         for "_i" from 0 to count _root -1 do {
             _class = _root select _i;
             if (isClass _class) then {
                 _currentPath = _path + [_i];
                 {
                     _result set [count _result, [_x, _x call _getAnyMagazines, _currentPath, str _class]];
                 } foreach getArray (_class >> "weapons");
                 _class = _class >> "turrets";
                 if (isClass _class) then {
                     [_class, _currentPath] call _findRecurse;
                 };
             };
         };
     };
     _class = (
         configFile >> "CfgVehicles" >> (
             switch (typeName _this) do {
                 case "STRING" : {_this};
                 case "OBJECT" : {typeOf _this};
                 default {nil}
             }
         ) >> "turrets"
     );
     [_class, []] call _findRecurse;
     _result;
 };

This call:

"M1A2_US_TUSK_MG_EP1" call funcGetTurretsWeapons 

will return all turrets weapons, its magazines and its paths:

 [
     ["M256", ["20Rnd_120mmSABOT_M1A2", "20Rnd_120mmHE_M1A2"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"],
     ["M240_veh", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret"],
     ["M2BC", ["100Rnd_127x99_M2"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"],
     ["SmokeLauncher", ["SmokeLauncherMag"], [0, 0], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/CommanderOptics"],
     ["M240_veh_2", ["100Rnd_762x51_M240", "1200Rnd_762x51_M240"], [0, 1], "bin\config.bin/CfgVehicles/M1A2_US_TUSK_MG_EP1/Turrets/MainTurret/Turrets/LoaderTurret"]
 ]

denisko.redisko (denvdmj)

Bottom Section

更多维基

随机维基