mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #251 from KoffeinFlummi/turrettweak
tweak turret functions
This commit is contained in:
commit
288c79fb46
@ -69,7 +69,7 @@ switch (_position) do {
|
||||
|
||||
case "gunner" : {
|
||||
private "_turretConfig";
|
||||
_turret = [typeOf _vehicle] call FUNC(getTurretGunner);
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
@ -82,7 +82,7 @@ switch (_position) do {
|
||||
|
||||
case "commander" : {
|
||||
private "_turretConfig";
|
||||
_turret = [typeOf _vehicle] call FUNC(getTurretCommander);
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
@ -95,7 +95,7 @@ switch (_position) do {
|
||||
|
||||
case "copilot" : {
|
||||
private "_turretConfig";
|
||||
_turret = [typeOf _vehicle] call FUNC(getTurretCopilot);
|
||||
_turret = [_vehicle] call FUNC(getTurretCopilot);
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
@ -108,7 +108,7 @@ switch (_position) do {
|
||||
|
||||
case "turret" : {
|
||||
private ["_turrets", "_turretConfig"];
|
||||
_turrets = [typeOf _vehicle] call FUNC(getTurretsOther);
|
||||
_turrets = [_vehicle] call FUNC(getTurretsOther);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index;
|
||||
CANGETINTURRETINDEX
|
||||
@ -136,7 +136,7 @@ switch (_position) do {
|
||||
|
||||
case "ffv" : {
|
||||
private ["_turrets", "_turretConfig"];
|
||||
_turrets = [typeOf _vehicle] call FUNC(getTurretsFFV);
|
||||
_turrets = [_vehicle] call FUNC(getTurretsFFV);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index;
|
||||
CANGETINTURRETINDEX
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Get the commander config of a vehicles turret.
|
||||
*
|
||||
* Argument:
|
||||
* 0: vehicle type (String)
|
||||
* 0: vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Commander config (Config)
|
||||
@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
|
||||
[_config, _turret] call FUNC(getTurretConfigPath)
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Get the gunner config of a vehicles turret.
|
||||
*
|
||||
* Argument:
|
||||
* 0: vehicle type (String)
|
||||
* 0: vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Gunner config (Config)
|
||||
@ -15,7 +15,7 @@ private ["_vehicle", "_config", "_turret"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
|
||||
[_config, _turret] call FUNC(getTurretConfigPath)
|
||||
|
@ -4,23 +4,23 @@
|
||||
* Gets the turret index of door gunners
|
||||
*
|
||||
* Argument:
|
||||
* 0: Vehicle type (String)
|
||||
* 0: Vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Turret indexes of the door gunner. Empty array means no gunner position. (Array)
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicleType", "_turrets", "_doorTurrets", "_config"];
|
||||
private ["_vehicle", "_turrets", "_doorTurrets", "_config"];
|
||||
|
||||
_vehicleType = _this select 0;
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turrets = [_vehicleType] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_doorTurrets = [];
|
||||
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> _vehicleType;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then {
|
||||
|
@ -64,7 +64,7 @@ switch (_position) do {
|
||||
};
|
||||
|
||||
case "gunner" : {
|
||||
_turret = [typeOf _vehicle] call FUNC(getTurretGunner);
|
||||
_turret = [_vehicle] call FUNC(getTurretGunner);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
@ -75,7 +75,7 @@ switch (_position) do {
|
||||
};
|
||||
|
||||
case "commander" : {
|
||||
_turret = [typeOf _vehicle] call FUNC(getTurretCommander);
|
||||
_turret = [_vehicle] call FUNC(getTurretCommander);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
@ -86,7 +86,7 @@ switch (_position) do {
|
||||
};
|
||||
|
||||
case "copilot" : {
|
||||
_turret = [typeOf _vehicle] call FUNC(getTurretCopilot);
|
||||
_turret = [_vehicle] call FUNC(getTurretCopilot);
|
||||
|
||||
if (CANGETINTURRETINDEX) then {
|
||||
_script = [
|
||||
@ -100,7 +100,7 @@ switch (_position) do {
|
||||
|
||||
case "turret" : {
|
||||
private "_turrets";
|
||||
_turrets = [typeOf _vehicle] call FUNC(getTurretsOther);
|
||||
_turrets = [_vehicle] call FUNC(getTurretsOther);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
|
||||
_script = [
|
||||
@ -127,7 +127,7 @@ switch (_position) do {
|
||||
|
||||
case "ffv" : {
|
||||
private "_turrets";
|
||||
_turrets = [typeOf _vehicle] call FUNC(getTurretsFFV);
|
||||
_turrets = [_vehicle] call FUNC(getTurretsFFV);
|
||||
|
||||
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
|
||||
_script = [
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Get the turret index of a vehicles commander.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Vehicle type (String)
|
||||
* 0: Vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Turret index of the vehicles commander. Empty array means no observer position. (Array)
|
||||
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turrets = [_vehicle] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Get the turret index of a vehicles copilot.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Vehicle type (String)
|
||||
* 0: Vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Turret index of the vehicles gunner. Empty array means no copilot position. (Array)
|
||||
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turrets = [_vehicle] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Get the turret index of a vehicles gunner.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Vehicle type (String)
|
||||
* 0: Vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Turret index of the vehicles gunner. Empty array means no gunner position. (Array)
|
||||
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turrets = [_vehicle] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
|
@ -18,7 +18,6 @@ _vehicle = vehicle _unit;
|
||||
|
||||
if (_unit == _vehicle) exitWith {[]};
|
||||
|
||||
//_turrets = [typeOf _vehicle] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_units = [];
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Get the turret indices of ffv turrets.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Vehicle type (String)
|
||||
* 0: Vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array)
|
||||
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turrets = [_vehicle] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Get the turret indices of other turrets (not gunner, commander, copilot or ffv).
|
||||
*
|
||||
* Argument:
|
||||
* 0: Vehicle type (String)
|
||||
* 0: Vehicle (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Turret index of the vehicles gunner. Empty array means no other turrets. (Array)
|
||||
@ -15,11 +15,11 @@ private ["_vehicle", "_turrets", "_turret", "_config"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turrets = [_vehicle] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
_turret = [];
|
||||
{
|
||||
_config = configFile >> "CfgVehicles" >> _vehicle;
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
_config = [_config, _x] call FUNC(getTurretConfigPath);
|
||||
|
||||
|
@ -30,7 +30,7 @@ if (_distance == 0) then {
|
||||
|
||||
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
|
||||
|
||||
if (_turret isEqualTo ([typeOf _vehicle] call EFUNC(common,getTurretCommander))) then {
|
||||
if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
|
||||
_weaponDirection = eyeDirection _vehicle;
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ private ["_weaponDirection", "_angleTarget"];
|
||||
|
||||
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
|
||||
|
||||
if (_turret isEqualTo ([typeOf _vehicle] call EFUNC(common,getTurretCommander))) then {
|
||||
if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
|
||||
_weaponDirection = eyeDirection _vehicle;
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@ private ["_vehicle", "_turret", "_weapons"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turret = [typeOf _vehicle] call EFUNC(common,getTurretCommander);
|
||||
_turret = [_vehicle] call EFUNC(common,getTurretCommander);
|
||||
|
||||
_weapons = _vehicle weaponsTurret _turret;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user