Jump to content

cyckuan

Member
  • Content Count

    2
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About cyckuan

  • Rank
    Newbie
  1. To disable or reduce effectiveness of thermal imaging on infantry sights, you can reduce the viewDistance when TI is activated, like so: while { alive player } do { switch (currentVisionMode player) do { case 0 : { setViewDistance 1200; // setObjectViewDistance 1500; }; case 1 : { // NVG setViewDistance 600; // setObjectViewDistance 1200; }; case 2 : { // FLIR setViewDistance 400; // setObjectViewDistance 600; }; }; };
  2. Here's an example of a recursive function that builds turretpaths from the config structure .... _vehicle = vehicle player; _type = typeOf _vehicle; [_vehicle,_rearmInterval,(configFile >> "CfgVehicles" >> _type),[]] call rearmTurretRecursive; // highest level call contains essential starting conditions in params 2 and 3 rearmTurretRecursive = { private ["_vehicle","_config","_rearmInterval","_turretConfig","_turretPath","_currentTurretPath","_max"]; _vehicle = _this select 0; _rearmInterval = _this select 1; _config = _this select 2; _turretPath = _this select 3; _currentTurretPath = +_turretPath; _turretConfig = (_config >> "Turrets"); _max = count _turretConfig; if ( _max > 0 ) then { for "_i" from 0 to (_max - 1) do { _turret = _turretConfig select _i; _turretName = getText (_turret >> "gunnerName"); _vehicle vehicleChat format ["Rearming %1", _turretName]; _currentTurretPath set [count _turretPath,_i]; // working around some BI variable scoping fubar _magazines = getArray (_turret >> "magazines"); { sleep _rearmInterval; _vehicle removeMagazinesTurret [_x,_currentTurretPath]; sleep _rearmInterval; _vehicle vehicleChat format ["... %1", _x]; _vehicle addMagazineTurret [_x,_currentTurretPath]; } count _magazines; [_vehicle,_rearmInterval,_turretConfig,_currentTurretPath] call rearmTurretRecursive; }; }; }; There may already be a BIS function since 2010. If so, please share.
×